Advanced MythTV Video Processing
Because of its stability and extensibility, Linux is often found at the frontier of computing. Linux has emerged as a promising platform for home theater audio/visual applications. My television viewing is now handled by a special-purpose Linux PC running MythTV. As I set up MythTV, the two major pain points I encountered were both related to video processing. The first challenge is to configure smooth video playback, and the second challenge is to take recorded programs on the road.
To work within the limitations of the electronics of the day, television frames are transmitted as two separate “fields”. A field consists of either the even-numbered or the odd-numbered horizontal lines in the picture. On playback, the even-numbered and odd-numbered fields are weaved together, and viewers far enough away from the display see continuous blended motion.
Two consecutive fields are related, but are not identical. During periods of rapid side-to-side motion of the camera, a field will be slightly ahead of its predecessor, and there may be jagged edges to images sliding across the screen. Figure 1 is a screenshot from a 1080i high-definition broadcast. In the scene, the camera is panning from left to right, causing the objects in the image to slide rapidly across the screen. Each field is in a slightly different position, leading to sawtooth-edge distortion, which is also called combing, serrations or mice teeth. In scenes with a great deal of sideways motion, it may be extremely difficult to follow the content through the distortion.
To make a video like Figure 1 watchable, it can be converted into a smooth picture by a process called deinterlacing. MythTV offers users a choice between several deinterlacing methods:
One field—instead of using two fields for one frame, this extremely simple method keeps only one of the two fields. Every other field is displayed as a still image, and the unused fields are discarded.
Linear—this method blends directly adjacent lines, which by definition come from alternate fields, together. A slight ghost image may appear, but the sawtooth distortion will be gone.
Kernel—this method blends several lines together instead of just adjacent lines. Ghost images do not appear, though faint remnants of one field may remain.
Bob—Bob is the most taxing method. Each field is line-doubled to create a frame, and then the reconstructed frames are played at double the frame rate.
Deinterlacing does require significant processing power, but most modern CPUs have multimedia instruction sets that reduce the load of the processing power. If you have an Intel processor with MMX or SSE instructions, or an AMD processor with 3Dnow!, deinterlacing should not be too difficult.
Bob is the best deinterlacing method to use with a synchronous TV output, though it can tax a less-capable machine. My personal MythTV front end is a 2GHz AMD Athlon64, and it has more than enough power to display Bob-deinterlaced high-definition video to an analog TV set. Although the CPU requirement is higher than the other deinterlacing methods, it is still well within the performance capabilities of my system.
Linear deinterlacing and kernel deinterlacing have similar visual effects, with the latter having a slightly larger CPU impact. Both are less taxing than Bob, which may be helpful on underpowered CPUs. Between the two, I prefer kernel deinterlacing because it blends several adjacent lines and eliminates ghosts, which make the resulting picture sharper.
One of the initial reasons for setting up a MythTV system was a desire to take my television programs on the road. Now that “television” means “files on hard disk”, it is much easier to store, transport and watch where it it is convenient for me. Like many mobile professionals, my laptop has practically become an extra appendage, and it is an ideal platform for playing back video while mobile, especially now that many airplanes have added power ports for mobile electronics.
The basic tension in exporting video from MythTV is a trade-off between size and processing time. Digital TV broadcast standards describe how to send an MPEG-2 video stream over a TV channel, so it is natural for MythTV to store digital TV broadcasts in their “natural” MPEG-2 format. Converting the MPEG-2 digital TV stream to another MPEG-2-based video format is relatively easy and can be done without lots of processing time. Converting the digital TV stream to MPEG-4 requires much more processing power, but the resulting video file will be much smaller.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- New Products
- Linux Systems Administrator
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Web & UI Developer (JavaScript & j Query)
- Designing Electronics with Linux
- Dynamic DNS—an Object Lesson in Problem Solving
- Using Salt Stack and Vagrant for Drupal Development
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Nice article, thanks for the
4 hours 19 min ago - I once had a better way I
10 hours 5 min ago - Not only you I too assumed
10 hours 23 min ago - another very interesting
12 hours 16 min ago - Reply to comment | Linux Journal
14 hours 9 min ago - Reply to comment | Linux Journal
21 hours 3 min ago - Reply to comment | Linux Journal
21 hours 19 min ago - Favorite (and easily brute-forced) pw's
23 hours 11 min ago - Have you tried Boxen? It's a
1 day 5 hours ago - seo services in india
1 day 9 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?





Comments
An easier way
Something I found out recently: these days mplayer can be used to replay the nuv container format used by mythtv directly. So, you can simply copy the nuv files onto your laptop and play them with mplayer.
I was using mplayer 1.0pre6 for windows.
Much faster than transcoding them into another format. nuvexport can also be used to export the files directly as nuv, but there seems little advantage to that over simply copying them, except it might be a bit easier to identify the correct files.