Difference between revisions of "Configuring HDTV"

From MythTV Official Wiki
Jump to: navigation, search
Line 5: Line 5:
 
= Understanding HDTV =
 
= Understanding HDTV =
  
HDTV (High Definition Television) is sent as stream of binary data encoded in the radio spectrum.  A digital tuner works much like a modem extracting the original digital data.  Unlike analog television capture, where a hardware encoder is desirable, compression of High Definition material takes place at the provider.  HD material is received as a digital stream and written directly to disk.  In North America, HD material is transmitted in [[MPEG-2]] format.  In Europe, Australia, and other parts of the world using the [[DVB]] standard, some streams are available as MPEG-2, and others as [[h.264]].   
+
HDTV (High Definition Television) is sent as stream of binary data encoded in the radio spectrum.  A digital tuner works much like a modem extracting the original digital data.  Unlike analog television capture, where a hardware encoder is desirable, compression of High Definition material takes place at the provider.  HD material is received as a digital stream and written directly to disk.  In North America, HD material is transmitted in [[MPEG-2]] format.  In Europe, Australia, and other parts of the world using the [[DVB]] standard, some streams are available as [[MPEG-2]], and others as [[h.264]].   
  
 
HDTV can be delivered via three mediums:  Broadcast (Over the Air), Cable, and Satellite.  The modulation for each is different, sometimes requiring different hardware.
 
HDTV can be delivered via three mediums:  Broadcast (Over the Air), Cable, and Satellite.  The modulation for each is different, sometimes requiring different hardware.
  
== MPEG-2 versus H.264 ==
+
=== MPEG-2 versus H.264 ===
  
 
When agreeing upon standards for digital television, Europe and much of the rest of the world implemented the DVB standard, which permits broadcasters to use either MPEG-2 or H.264 codecs.  In the United States, ATSC permits only MPEG-2 as the codec.  Each format has its advantages.  MPEG-2 is a well understood, established video format.  Playback is not computationally demanding, and most modern dual-core (and many recent single core) systems can easily manage playback.  H.264 is a newer standard, but improves upon MPEG-2 in several ways.  H.264 can achieve identical quality to MPEG-2 at 60% of the bitrate.  Accordingly,  a full-channel-bitrate (17.89 Megabit/s) H.264 stream compared with an identical-bitrate MPEG-2 stream will look substantially better.  This comes at a much higher computational expense.  Playing 720p and 1080i H.264 streams (at full bitrate) can be difficult, even on recent systems.  Playing 1080p H.264 can often be nightmarish for those unfamiliar with tweaking playback options.  
 
When agreeing upon standards for digital television, Europe and much of the rest of the world implemented the DVB standard, which permits broadcasters to use either MPEG-2 or H.264 codecs.  In the United States, ATSC permits only MPEG-2 as the codec.  Each format has its advantages.  MPEG-2 is a well understood, established video format.  Playback is not computationally demanding, and most modern dual-core (and many recent single core) systems can easily manage playback.  H.264 is a newer standard, but improves upon MPEG-2 in several ways.  H.264 can achieve identical quality to MPEG-2 at 60% of the bitrate.  Accordingly,  a full-channel-bitrate (17.89 Megabit/s) H.264 stream compared with an identical-bitrate MPEG-2 stream will look substantially better.  This comes at a much higher computational expense.  Playing 720p and 1080i H.264 streams (at full bitrate) can be difficult, even on recent systems.  Playing 1080p H.264 can often be nightmarish for those unfamiliar with tweaking playback options.  
  
== Bitrate (Or, if you read nothing else, read this) ==
+
=== Bitrate (Or, if you read nothing else, read this) ===
  
Uninformed users frequently make a point of asking whether their hardware is capable of "1080p playback."  Similarly uninformed users reply that a given setup is "enough" or "not enough."  In reality, resolution of the material is a relatively minor part of the playback equation.  Users who get their 1080p material via bittorrent or other questionable means often think that because they are able to play back the file, their system is capable of playing back all 1080p material.  This is seldom the case.  Most pirated HD material has been transcoded to substantially lower bitrates, often cutting the file size/bitrate more than in half.  At proportionately lower bitrates, processor requirements are also proportionately lower.  In reality, a full-bitrate H.264 or MPEG-2 from a Blu-ray/HD-DVD Disk may be substantially more difficult or impossible to play back for the same machine.  While "true" Blu-ray and HD-DVD material may be encoded up to 40 Megabits per second, television has bitrates only up to 17.89 Megabits per second, and many "1080p rips" found on the internet are transcoded below 10 Megabits per second.  In effect, processor requirements for the "real thing" may be up to four times as high as the user expects.
+
Uninformed users frequently make a point of asking whether their hardware is capable of "1080p playback."  Similarly uninformed users reply that a given setup is "enough" or "not enough."  In reality, resolution of the material is a relatively minor part of the playback equation.  Users who get their 1080p material via bittorrent or other questionable means often think that because they are able to play back the file, their system is capable of playing back all 1080p material.  This is seldom the case.  Most pirated HD material has been transcoded to substantially lower bitrates, often cutting the file size/bitrate more than in half.  At proportionately lower bitrates, processor requirements are also proportionately lower.  In reality, a full-bitrate H.264 or MPEG-2 from a Blu-ray/HD-DVD Disk may be substantially more difficult or impossible to play back for the same machine.  While "true" Blu-ray and HD-DVD material may be encoded up to 40 Megabits per second, television is broadcast in bitrates up to 17.89 Megabits per second, and many "1080p rips" found on the internet are transcoded below 10 Megabits per second.  In effect, processor requirements for the "real thing" may be up to four times as high as the user expects.
  
== Multiplexing and Transport Streams ==  
+
=== Multiplexing and Transport Streams ===
  
 
Central to any discussion of HDTV reception is the notion of multiplexes.  With the advent of digital television, broadcasters and cable companies are capable of tuning the resolution, bitrate, and packaging of their channels.  A 6 Mhz Channel can accommodate 17.89 Megabits per second worth of data.  Television providers are now free to carve the bandwidth of a single channel up into as many Transport Streams as they like.  In short, one 17.89 Mbit/s channel can be simultaneously carrying multiple Transport Streams, each of which can have multiple audio tracks.  Broadcasters now commonly "multiplex," or package, many standard definition channels in the space of a single 6 Mhz channel.  In MythTV .21, it is possible to record any number of streams you like from a single multiplex, assuming the user is receiving television via ATSC or DVB.  In effect, this enables the user to record multiple channels at once on a single tuner.
 
Central to any discussion of HDTV reception is the notion of multiplexes.  With the advent of digital television, broadcasters and cable companies are capable of tuning the resolution, bitrate, and packaging of their channels.  A 6 Mhz Channel can accommodate 17.89 Megabits per second worth of data.  Television providers are now free to carve the bandwidth of a single channel up into as many Transport Streams as they like.  In short, one 17.89 Mbit/s channel can be simultaneously carrying multiple Transport Streams, each of which can have multiple audio tracks.  Broadcasters now commonly "multiplex," or package, many standard definition channels in the space of a single 6 Mhz channel.  In MythTV .21, it is possible to record any number of streams you like from a single multiplex, assuming the user is receiving television via ATSC or DVB.  In effect, this enables the user to record multiple channels at once on a single tuner.
Line 28: Line 28:
 
=== HDTV on Cable ===   
 
=== HDTV on Cable ===   
 
Its standard is called [[QAM]] ATSC. Many of the OTA Tuner cards like AirStar HD-5000 or PcHDTV work with Clear (unencrypted) QAM.  It just takes a little bit more time and energy getting it to work. Verizon FIOS also uses QAM for its unencrypted channels.
 
Its standard is called [[QAM]] ATSC. Many of the OTA Tuner cards like AirStar HD-5000 or PcHDTV work with Clear (unencrypted) QAM.  It just takes a little bit more time and energy getting it to work. Verizon FIOS also uses QAM for its unencrypted channels.
 +
 +
Another popular option is [[FireWire]] capture of digital streams directly from a cable box.  As with the [[ATSC]] tuners mentioned above, the CPU requirements for this capture method are minimal, as the backend machine is simply copying an MPEG-2 video stream to disk.
  
 
=== HDTV and Satellite TV ===
 
=== HDTV and Satellite TV ===
Line 41: Line 43:
 
There is talk of being able to use a cable or satellite STB's RF output to capture HDTV sourced from cable or satellite.  This CANNOT be done!  Cable & satellite receivers for the home do not & cannot remodulate HDTV signals to ATSC/QAM.  If channels are encrypted on cable/satellite - that's how they stay.
 
There is talk of being able to use a cable or satellite STB's RF output to capture HDTV sourced from cable or satellite.  This CANNOT be done!  Cable & satellite receivers for the home do not & cannot remodulate HDTV signals to ATSC/QAM.  If channels are encrypted on cable/satellite - that's how they stay.
  
Much fuss has been made over a HDMI capture card which has recently (as of May 2007) become available.  This is also a non-starter for many reasons, #1 being that there are no linux drivers for the card and even if there were, MJPEG capture of HDTV (which is all the card does) would require an enormous amount of HDD space (and by proxy, network bandwidth for remote frontends!).  Then there's HDCP...
+
Much fuss has been made over a HDMI capture card which has recently (as of May 2007) become available.  This is also a non-starter for many reasons, #1 being that there are no linux drivers for the card and even if there were, MJPEG capture of HDTV (which is all the card does) would require an enormous amount of HDD space (and by proxy, network bandwidth for remote frontends!).  Further, all HMDI capture cards require a stream free of HDCP (HDMI copy protection).
  
 
== Europe ==
 
== Europe ==
Europe uses [[DVB]] (Digital Video Broadcasting) for HDTV and digital standard definition video.
+
Europe uses [[DVB]] (Digital Video Broadcasting) for HDTV and digital standard definition video.  The concepts of DVB transmission are identical to those of ATSC transmission.  A stream is encoded and multiplexed at the television provider, and the user merely writes the stream to disk, preserving a perfect digital copy of the program.  
  
 
=== DVB-C For Cable ===
 
=== DVB-C For Cable ===
Line 54: Line 56:
 
=== DVB-S For Satellite ===
 
=== DVB-S For Satellite ===
 
Cards Exist
 
Cards Exist
 
= Recording HDTV =
 
 
As discussed above, OTA ATSC and Clear QAM ATSC HDTV can be recorded at this time.
 
  
 
== Hardware ==
 
== Hardware ==
  
Several cards are now available for HD capture in Linux. The [[pcHDTV HD-2000]], [[pcHDTV HD-3000]], [[pcHDTV HD-5500]], [[Air2PC]], [[Technisat AirStar HD-5000]], [[AVerTV HD A180]], and [[ATI HDTV Wonder]] are just a few that have Linux drivers available.  There is little reason to worry about the differences between the HD-2000, HD-3000 and HD-5500 cards, except that the HD-5500 is being sold, while the HD-2000, HD-3000 and the Air2PC have been discontinued (there are reported reliability problems with the 3000 though, so get a 5500 if you have a choice).   If you get the HD-5500 card, you will need to disable the embedded cx88-alsa sound portion of the cards to make audio work properly; add cx88-alsa to /etc/modprobe.d/blacklist.
+
Several cards are now available for HD capture in Linux. The [[pcHDTV HD-2000]], [[pcHDTV HD-3000]], [[pcHDTV HD-5500]], [[Air2PC]], [[Technisat AirStar HD-5000]], [[AVerTV HD A180]], and [[ATI HDTV Wonder]] are just a few that have Linux drivers available.  There is little reason to worry about the differences between the HD-2000, HD-3000 and HD-5500 cards, except that the HD-5500 is being sold, while the HD-2000, HD-3000 and the Air2PC have been discontinued. Each card has its own idiosyncrasiesRefer to individual card pages for further details.
 
 
Here is a listing of ATSC cards supported in Linux and their capabilities: http://linuxtv.org/wiki/index.php/ATSC_Devices.
 
 
 
The CPU requirements are quite minimal for recording because it's simply a matter of copying the transport stream from the card to the hard driveI believe that people have reported success with less than 1GHz processors. While Playback is a completely different story.
 
 
 
Another popular option is [[FireWire]] capture of digital streams directly from a cable box.  As with the [[ATSC]] tuners mentioned above, the CPU requirements for this capture method are minimal, as the backend machine is simply copying an MPEG video stream to disk.
 
 
 
In the near future, cards should become available that will capture HD signals directly from component or other input in raw form and convert them to compressed format. Hauppauge has announced once such card at CES 2008, the HD-PVR. These newer capture cards should enable users to capture HD from satellite or cable-boxes, post-encryption.
 
  
== Drivers ==
+
A good guide to capture hardware that will work well in MythTV is the Linux TV wiki at http://www.linuxtv.org/wiki/index.php/Main_Page.
  
The drivers are a bit temperamental; it can take some effort to get them to work correctly.
+
CPU requirements for HD recording at minimal because no encoding takes place.  Playback of HD content is far more computationally intensive.
  
FIXME: Explain the different drivers, kernel versions, and such.
+
= Playing HD Material =
  
= Playing HDTV =
+
For information on hardware used by users to play back HD content, please see (and update) [[HD Playback Reports]].
  
 
== Hardware ==
 
== Hardware ==
  
 
There are two ways to go about playing back HDTV. One is to rely on an XvMC capable video card with a slower CPU, the other is to use pure CPU processing (the developers are currently working on a third option, but this may not be available in the next release version). '''The XvMC route requires an NVIDIA graphics card and the equivalent of a around an AthlonXP 2000+ or better.'''
 
There are two ways to go about playing back HDTV. One is to rely on an XvMC capable video card with a slower CPU, the other is to use pure CPU processing (the developers are currently working on a third option, but this may not be available in the next release version). '''The XvMC route requires an NVIDIA graphics card and the equivalent of a around an AthlonXP 2000+ or better.'''
 +
 +
XvMC (X Video Motion Compensation) is a method of offloading some of the processing of MPEG-2 video onto the Graphics hardware.  In marginal systems it can enable smooth video playback, but should be avoided when possible.  XvMC does not accelerate H.264 material.
  
 
=== Video ===
 
=== Video ===
Line 95: Line 87:
 
NVIDIA has also recently released a line of integrated video GPU's numbered the 6100 and 6150. These are designed to be integrated as onboard video for motherboards such as the Asus M2N-MX, Asus M2NPV-VM, Asus A8N-VM CSM, Abit NF-M2 and DFI C51PV-M2/G. These chipsets use integrated RAM, much like the Turbo-Cache models which means they require system memory, so if you choose one of these solutions you will probably want to spring for 512MB or more RAM.
 
NVIDIA has also recently released a line of integrated video GPU's numbered the 6100 and 6150. These are designed to be integrated as onboard video for motherboards such as the Asus M2N-MX, Asus M2NPV-VM, Asus A8N-VM CSM, Abit NF-M2 and DFI C51PV-M2/G. These chipsets use integrated RAM, much like the Turbo-Cache models which means they require system memory, so if you choose one of these solutions you will probably want to spring for 512MB or more RAM.
  
It should also be mentioned here that for HDTV use it is recommended to use the 9xxx series drivers with the xorg.conf "UseEvents" option,
+
For HDTV use it is recommended to use the most recent drivers and enable the xorg.conf "UseEvents" option:
  Option    "UseEvents" "True"
+
 
and enabling Xv Vsync in the nvidia-settings application. This has proven to solve many "tearing" and other odd video issues people have experienced. This driver also seems to use a bit less CPU than the old 8xxx series.
+
  <code>Option    "UseEvents" "True"</code>
 +
 
 +
After adding UseEvents, Xv Vsync needs to be enabled in the nvidia-settings application. This has proven to solve many "tearing" and other odd video issues people have experienced.  
  
 
Additionally, it is worth noting that nVidia has made some changes to their driver to eliminate the need for customized Modelines for the popular formats (480i, 480p, 720p, 1080i, 1080p).  Check out the [http://www.mythtv.org/wiki/index.php/ComponentOut ComponentOut] wiki entry for more information.  The settings listed on that page are no longer specific to Component Output, as they can be applied to HDMI interfaces as well (for those using DVI to HDMI connections).  Be sure to check your display (television set) manual to see what it supports and how.
 
Additionally, it is worth noting that nVidia has made some changes to their driver to eliminate the need for customized Modelines for the popular formats (480i, 480p, 720p, 1080i, 1080p).  Check out the [http://www.mythtv.org/wiki/index.php/ComponentOut ComponentOut] wiki entry for more information.  The settings listed on that page are no longer specific to Component Output, as they can be applied to HDMI interfaces as well (for those using DVI to HDMI connections).  Be sure to check your display (television set) manual to see what it supports and how.
 
==== ATI ====
 
The minimum recommended ATI card is the Radeon 9600, which is also fanless, found for about $60. Although there are many that prefer nvidia and will tell you to avoid ATI, many that use ATI have great success with MythTV and HDTV content. With AMD's recent move with their ATI driver strategy you can soon expect even better drivers for ATI cards.
 
  
 
=== CPU For MPEG2 ===
 
=== CPU For MPEG2 ===
 
The CPU requirements for playing HDTV are significant.  While [[XvMC]] support (NVIDIA only) offloads ''some'' of the work to the video card, it is not recommended to design a new system around using XvMC since it can be a hassle to get working well.
 
The CPU requirements for playing HDTV are significant.  While [[XvMC]] support (NVIDIA only) offloads ''some'' of the work to the video card, it is not recommended to design a new system around using XvMC since it can be a hassle to get working well.
  
The minimum CPU requirement for broadcast HDTV playback (720p or 1080i) with de-interlacing is a CPU such as an Athlon64 3200+ or Pentium 2.8 Ghz, either Pentium D 820 or Pentium 4. Since the Athlon64 line is much cheaper many people end up purchasing an Athlon.
+
'''Tip and Tricks'''
 
 
This though, is only really the minimum for playback, and as a standalone frontend the Athlon64 3200+ is more than capable. If you look to run a combined frontend and backend, which most new users do, it is '''highly''' suggested to spring for a dual core such as an Athlon64 x2 or Intel Core 2 Duo. This will provide enough processing power for the combined duties of the backend processes (mythbackend, mysql, software raid, commercial flagging, etc) and software based playback of 1080i with deinterlacing.
 
 
 
'''Caveat Emptor'''
 
 
   
 
   
 
The actual minimum requirements are hard to pin down, as people have reported conflicting results.  Relevant factors may include the bus speed, memory speed, CPU speed, kernel version, Linux distribution, and compiler version and optimizations.   
 
The actual minimum requirements are hard to pin down, as people have reported conflicting results.  Relevant factors may include the bus speed, memory speed, CPU speed, kernel version, Linux distribution, and compiler version and optimizations.   
Line 119: Line 106:
 
* Some recent experimentation seems to indicate that the most common hardware bottleneck in P4-based frontend systems is memory bandwidth.
 
* Some recent experimentation seems to indicate that the most common hardware bottleneck in P4-based frontend systems is memory bandwidth.
  
=== CPU For x/h264 (ie BluRay and HD-DVD) ===
+
== Ripped Media ==
Now that HD-DVD and BluRay drives have arrived for the PC, which offer extremely high quality 1080p content, cpu "requirements" have increased again.
 
 
 
==== XvMC ====
 
It doesn't support x/h264 so don't ask!
 
  
 
==== Reencoded Rips ====
 
==== Reencoded Rips ====
Legality aside, many re-encoded HD rips of BluRay, HD-DVD and TV shows have appeared on the seedier side of the internets. These won't play back properly with the internal player so [[mplayer]] is required.
+
Legality aside, many re-encoded HD rips of BluRay, HD-DVD and TV shows have appeared on the internet.  
 
 
720p reencoded rips should playback fine on an AMD Athlon64 3800+ equivalent processor or faster.
 
 
 
1080p reencoded rips require quite a bit more processing power but should play fine on an AMD Athlon64 X2 4600+ equivalent or faster.
 
  
 
==== Real 1080p Rips ====
 
==== Real 1080p Rips ====
Odds are, to playback a true BluRay or HD-DVD movie you will need a Core 2 Duo 6300 or AMD Athlon64 X2 6000+.
+
Many users who believe their machine capable of HD-DVD or Blu-ray playback have only attempted to play transcoded rips which, as discussed above, often have their bitrates reduced by 50 to 75 percent.
 
 
Blu-ray and HD-DVD rips are, for feature only, generally between 17 GB and 35 GB, and up to 50 GB for the entire disc.  The bitrate generally varies between approximately 20 Mbit and 35 Mbit.  The .m2ts and .EVO files contained on these discs can be played back with occasional dropped frames on a Core 2 Duo E4500 @ 2.20 Ghz, and without dropped frames on a Core 2 Quad Q6600.  This comes with multiple caveats.  If the bitrate goes higher on the lower spec machine, it could choke entirely on 1080p content.  Further, most Blu-ray and HD-DVD discs now use E-AC3, mlp, or Dolby TrueHD as their only sound format.  Older discs have both the new formats and AC3 Tracks, but this is less and less common.  Ffmpeg SVN was recently updated to support TrueHD/mlp.  Support should appear soon in mplayer.  E-AC3 patches are in line for inclusion in ffmpeg, and are available on the ffmpeg development list.
 
 
 
==== User Reports ====
 
[[User:Steveadeff]] - I've managed to playback 1080p rips on my overclocked Athlon64 X2 4400+ in mplayer
 
 
 
[[User:Phlepper]] - "I don't know the *minimum*, but I am able to playback at 1080p without XvMC using an AMD 64 X2 6000+ with over 60% idle cpu for both 720p and 1080i sources"
 
 
 
== Software ==
 
 
 
If you have an nVidia video card, you may want to try [[XvMC]] along with nVidia's proprietary drivers. If you have an ATI card, be sure to use their proprietary "fglrx" drivers, and [[XvMC]] will not be available.
 
  
FIXME: Discuss setting up MythTV, including adjusting the minimum signal strength.
+
Blu-ray and HD-DVD rips are, for feature only, generally between 17 GB and 35 GB, and up to 50 GB for the entire disc.  The bitrate generally varies between approximately 20 Mbit and 40 Mbit.  Most Blu-ray and HD-DVD discs now use E-AC3, mlp, or Dolby TrueHD as their only sound format.  A few older discs have both the new formats and AC3 Tracks, but this is less and less common.  Ffmpeg SVN was recently updated to support TrueHD/mlp.  Support should appear soon in mplayer.  E-AC3 patches are in line for inclusion in ffmpeg, and are available on the ffmpeg development list.  the only way to play back the audio on new Blu-ray and HD-DVD rips is to patch mplayer yourself.
  
 
= Transcoding HDTV =
 
= Transcoding HDTV =
Line 153: Line 121:
  
 
As of 0.19 a "lossless" mpeg2 transcode has been implemented. This method is used for the default transcode. This method will allow you to cut commercials without losing any of the HDTV quality as only the frames necesary to be reencoded to maintain proper playback will be encoded. For commercial cutting these frames are usually all black, with a possible station logo, and so no quality loss should be seen at all. This transcode also has the added benefit of audio sync correction similar to what ProjectX does, as well as converting the MPEG2 TS stream to a PS stream with up to a possible 20% savings in file size on top of any cuts made.
 
As of 0.19 a "lossless" mpeg2 transcode has been implemented. This method is used for the default transcode. This method will allow you to cut commercials without losing any of the HDTV quality as only the frames necesary to be reencoded to maintain proper playback will be encoded. For commercial cutting these frames are usually all black, with a possible station logo, and so no quality loss should be seen at all. This transcode also has the added benefit of audio sync correction similar to what ProjectX does, as well as converting the MPEG2 TS stream to a PS stream with up to a possible 20% savings in file size on top of any cuts made.
 
FIXME: I haven't figured out how to do this yet.  The editor function works to set a cutlist, but there is no option to set up a transcoding profile specifically for HDTV recordings.  I suspect that further development effort is required before MythTV can transcode HDTV.  Several people have reported on the mailing lists methods of using external programs for transcoding.
 
:[[mencoder]] works well for xvid encoding. I've got a script that will take any 30min or 1hr show and convert it to what "the scene" terms an [[HR HDTV]] encode. It automatically uses the correct IVTC/frame removal filters and properly sizes the output files which I can post here if there is interest. I'm also thinking of looking into a modification to the script that would convert the file using the same input Q for output encoding with the IVTC/frame removal filters which should result in a good deal of space savings while maintaining the proper HDTV quality.--[[User:Steveadeff|Steve Adeff]] 17:29, 17 May 2006 (UTC)
 
 
::Steve, I think that there's lots of people out here that would be interested in that script.  Would you mind posting it somewhere?
 
:::It's now on my [[User:Steveadeff#Encoding|userpage]].
 
 
FIXME: There should be a discussion of the alternatives for keeping the original sound stream.  How much space does a full surround sound stream take per hour?  If you don't have a surround sound setup, you might as well convert to stereo; is there a way to preserve the original stereo stream only?
 
: [[AC3]] for HDTV is usually 384Kb/s and for a 1 hour show (approx 44mins) comes out to something along the lines of 120MB. This can be cut further down in transcoding but the space savings is ill worth the time and possible quality loss.--[[User:Steveadeff|Steve Adeff]] 17:29, 17 May 2006 (UTC)
 
  
 
= See also =
 
= See also =

Revision as of 18:57, 16 January 2008

HDTV Help Pages

Setting up MythTV to fully use HDTV can be rather complicated. There are different HDTV formats for North America and Europe. Parts of this information may apply to other countries that use HDTV as well.

Understanding HDTV

HDTV (High Definition Television) is sent as stream of binary data encoded in the radio spectrum. A digital tuner works much like a modem extracting the original digital data. Unlike analog television capture, where a hardware encoder is desirable, compression of High Definition material takes place at the provider. HD material is received as a digital stream and written directly to disk. In North America, HD material is transmitted in MPEG-2 format. In Europe, Australia, and other parts of the world using the DVB standard, some streams are available as MPEG-2, and others as h.264.

HDTV can be delivered via three mediums: Broadcast (Over the Air), Cable, and Satellite. The modulation for each is different, sometimes requiring different hardware.

MPEG-2 versus H.264

When agreeing upon standards for digital television, Europe and much of the rest of the world implemented the DVB standard, which permits broadcasters to use either MPEG-2 or H.264 codecs. In the United States, ATSC permits only MPEG-2 as the codec. Each format has its advantages. MPEG-2 is a well understood, established video format. Playback is not computationally demanding, and most modern dual-core (and many recent single core) systems can easily manage playback. H.264 is a newer standard, but improves upon MPEG-2 in several ways. H.264 can achieve identical quality to MPEG-2 at 60% of the bitrate. Accordingly, a full-channel-bitrate (17.89 Megabit/s) H.264 stream compared with an identical-bitrate MPEG-2 stream will look substantially better. This comes at a much higher computational expense. Playing 720p and 1080i H.264 streams (at full bitrate) can be difficult, even on recent systems. Playing 1080p H.264 can often be nightmarish for those unfamiliar with tweaking playback options.

Bitrate (Or, if you read nothing else, read this)

Uninformed users frequently make a point of asking whether their hardware is capable of "1080p playback." Similarly uninformed users reply that a given setup is "enough" or "not enough." In reality, resolution of the material is a relatively minor part of the playback equation. Users who get their 1080p material via bittorrent or other questionable means often think that because they are able to play back the file, their system is capable of playing back all 1080p material. This is seldom the case. Most pirated HD material has been transcoded to substantially lower bitrates, often cutting the file size/bitrate more than in half. At proportionately lower bitrates, processor requirements are also proportionately lower. In reality, a full-bitrate H.264 or MPEG-2 from a Blu-ray/HD-DVD Disk may be substantially more difficult or impossible to play back for the same machine. While "true" Blu-ray and HD-DVD material may be encoded up to 40 Megabits per second, television is broadcast in bitrates up to 17.89 Megabits per second, and many "1080p rips" found on the internet are transcoded below 10 Megabits per second. In effect, processor requirements for the "real thing" may be up to four times as high as the user expects.

Multiplexing and Transport Streams

Central to any discussion of HDTV reception is the notion of multiplexes. With the advent of digital television, broadcasters and cable companies are capable of tuning the resolution, bitrate, and packaging of their channels. A 6 Mhz Channel can accommodate 17.89 Megabits per second worth of data. Television providers are now free to carve the bandwidth of a single channel up into as many Transport Streams as they like. In short, one 17.89 Mbit/s channel can be simultaneously carrying multiple Transport Streams, each of which can have multiple audio tracks. Broadcasters now commonly "multiplex," or package, many standard definition channels in the space of a single 6 Mhz channel. In MythTV .21, it is possible to record any number of streams you like from a single multiplex, assuming the user is receiving television via ATSC or DVB. In effect, this enables the user to record multiple channels at once on a single tuner.

North America

Antenna HDTV broadcast

This is called OTA (Over-The-Air) ATSC. You can get a tuner card that will extract the raw transport stream for a given channel. Antenna Broadcasters sometimes include multiple subchannels, all of which are part of the same transport stream. In some areas, subchannels include encrypted pay channels.

HDTV on Cable

Its standard is called QAM ATSC. Many of the OTA Tuner cards like AirStar HD-5000 or PcHDTV work with Clear (unencrypted) QAM. It just takes a little bit more time and energy getting it to work. Verizon FIOS also uses QAM for its unencrypted channels.

Another popular option is FireWire capture of digital streams directly from a cable box. As with the ATSC tuners mentioned above, the CPU requirements for this capture method are minimal, as the backend machine is simply copying an MPEG-2 video stream to disk.

HDTV and Satellite TV

All channels off of Satellite are digital but not all of them are in HDTV Format. Most are Encrypted, but not all of them (For example LyngSat Free OTA).

Other Methods

There are other Methods of grabbing data from the above Sources. Fortunately, for cable and satellite some of the converter boxes include a firewire port where the raw MPEG data is sent. In theory, MythTV can record unencrypted channels from this port. At this time, this is something that a few people have experimented with, but it is not yet ready for general use.

In January 2008, Hauppauge Computer Works announced that they would be releasing a component capture device capable of on-the-fly H.264 hardware transcoding of material up to 15 Megabits per second at 1080i. When this device reaches the market and Linux drivers are available, it will become possible to record HD material from any device with a component output. While there will be a quality hit from the Digital->Analog->Digital conversion, the quality of the capture will still be substantially higher than any Standard Definition source.

Impossible Stuff

There is talk of being able to use a cable or satellite STB's RF output to capture HDTV sourced from cable or satellite. This CANNOT be done! Cable & satellite receivers for the home do not & cannot remodulate HDTV signals to ATSC/QAM. If channels are encrypted on cable/satellite - that's how they stay.

Much fuss has been made over a HDMI capture card which has recently (as of May 2007) become available. This is also a non-starter for many reasons, #1 being that there are no linux drivers for the card and even if there were, MJPEG capture of HDTV (which is all the card does) would require an enormous amount of HDD space (and by proxy, network bandwidth for remote frontends!). Further, all HMDI capture cards require a stream free of HDCP (HDMI copy protection).

Europe

Europe uses DVB (Digital Video Broadcasting) for HDTV and digital standard definition video. The concepts of DVB transmission are identical to those of ATSC transmission. A stream is encoded and multiplexed at the television provider, and the user merely writes the stream to disk, preserving a perfect digital copy of the program.

DVB-C For Cable

Cards Exist

DVB-T For Terrestrial (Antenna)

Cards Exist

DVB-S For Satellite

Cards Exist

Hardware

Several cards are now available for HD capture in Linux. The pcHDTV HD-2000, pcHDTV HD-3000, pcHDTV HD-5500, Air2PC, Technisat AirStar HD-5000, AVerTV HD A180, and ATI HDTV Wonder are just a few that have Linux drivers available. There is little reason to worry about the differences between the HD-2000, HD-3000 and HD-5500 cards, except that the HD-5500 is being sold, while the HD-2000, HD-3000 and the Air2PC have been discontinued. Each card has its own idiosyncrasies. Refer to individual card pages for further details.

A good guide to capture hardware that will work well in MythTV is the Linux TV wiki at http://www.linuxtv.org/wiki/index.php/Main_Page.

CPU requirements for HD recording at minimal because no encoding takes place. Playback of HD content is far more computationally intensive.

Playing HD Material

For information on hardware used by users to play back HD content, please see (and update) HD Playback Reports.

Hardware

There are two ways to go about playing back HDTV. One is to rely on an XvMC capable video card with a slower CPU, the other is to use pure CPU processing (the developers are currently working on a third option, but this may not be available in the next release version). The XvMC route requires an NVIDIA graphics card and the equivalent of a around an AthlonXP 2000+ or better.

XvMC (X Video Motion Compensation) is a method of offloading some of the processing of MPEG-2 video onto the Graphics hardware. In marginal systems it can enable smooth video playback, but should be avoided when possible. XvMC does not accelerate H.264 material.

Video

Most people use nVidia cards to play HDTV, although ATI cards are capable as well. AGP is a minimum as the PCI bus does not have the bandwidth for HDTV unless XvMC is used. Which is a fine option for those looking to make use of an older system, but due to the hassle it can be to getting it working well it is not really recommended.

One common thread here will be fan-less. Video card fans are notoriously loud, and since they are not needed for HDTV playback, purchasing a fan-less card will help lower the overall noise level of your MythTV computer.

NVIDIA

The minimum recommended NVIDIA card is the FX 5200. Depending on the manufacturer/model, many have exhibited some odd display issues when playing video at 1920x1080(i or p) via DVI even when not using XvMC. Interestingly, underscanning by 3% in the horizontal direction within MythTV solves the FX 5200s problems.

Recently the market has shifted to the point where the GeForce 6xxx series has entered the sub $50US range. The GeForce 6200 does not exhibit these problems. The 6200TC is used by quite a few list members with excellent results.

NVIDIA has also recently released a line of integrated video GPU's numbered the 6100 and 6150. These are designed to be integrated as onboard video for motherboards such as the Asus M2N-MX, Asus M2NPV-VM, Asus A8N-VM CSM, Abit NF-M2 and DFI C51PV-M2/G. These chipsets use integrated RAM, much like the Turbo-Cache models which means they require system memory, so if you choose one of these solutions you will probably want to spring for 512MB or more RAM.

For HDTV use it is recommended to use the most recent drivers and enable the xorg.conf "UseEvents" option:

Option     "UseEvents" "True"

After adding UseEvents, Xv Vsync needs to be enabled in the nvidia-settings application. This has proven to solve many "tearing" and other odd video issues people have experienced.

Additionally, it is worth noting that nVidia has made some changes to their driver to eliminate the need for customized Modelines for the popular formats (480i, 480p, 720p, 1080i, 1080p). Check out the ComponentOut wiki entry for more information. The settings listed on that page are no longer specific to Component Output, as they can be applied to HDMI interfaces as well (for those using DVI to HDMI connections). Be sure to check your display (television set) manual to see what it supports and how.

CPU For MPEG2

The CPU requirements for playing HDTV are significant. While XvMC support (NVIDIA only) offloads some of the work to the video card, it is not recommended to design a new system around using XvMC since it can be a hassle to get working well.

Tip and Tricks

The actual minimum requirements are hard to pin down, as people have reported conflicting results. Relevant factors may include the bus speed, memory speed, CPU speed, kernel version, Linux distribution, and compiler version and optimizations.

  • It is generally advised to go with two RAM DIMM's to allow for dual channel operation which can provide a significant boost in overall system speed.
  • It is also wise to go with a newer kernel (2.6.16 or better, a minimum of 2.6.18 for those wishing to use firewire), preferably one compiled for your specific processor, or at a minimum an i686 kernel.
  • When compiling MythTV from source it is also imperative to use the --enable-proc-opt configure option!
  • Some recent experimentation seems to indicate that the most common hardware bottleneck in P4-based frontend systems is memory bandwidth.

Ripped Media

Reencoded Rips

Legality aside, many re-encoded HD rips of BluRay, HD-DVD and TV shows have appeared on the internet.

Real 1080p Rips

Many users who believe their machine capable of HD-DVD or Blu-ray playback have only attempted to play transcoded rips which, as discussed above, often have their bitrates reduced by 50 to 75 percent.

Blu-ray and HD-DVD rips are, for feature only, generally between 17 GB and 35 GB, and up to 50 GB for the entire disc. The bitrate generally varies between approximately 20 Mbit and 40 Mbit. Most Blu-ray and HD-DVD discs now use E-AC3, mlp, or Dolby TrueHD as their only sound format. A few older discs have both the new formats and AC3 Tracks, but this is less and less common. Ffmpeg SVN was recently updated to support TrueHD/mlp. Support should appear soon in mplayer. E-AC3 patches are in line for inclusion in ffmpeg, and are available on the ffmpeg development list. the only way to play back the audio on new Blu-ray and HD-DVD rips is to patch mplayer yourself.

Transcoding HDTV

HDTV recordings typically consume slightly under 9GB per hour. Unless you have tons of storage, this will restrict you to a fairly small number of recordings unless you transcode.

As of 0.19 a "lossless" mpeg2 transcode has been implemented. This method is used for the default transcode. This method will allow you to cut commercials without losing any of the HDTV quality as only the frames necesary to be reencoded to maintain proper playback will be encoded. For commercial cutting these frames are usually all black, with a possible station logo, and so no quality loss should be seen at all. This transcode also has the added benefit of audio sync correction similar to what ProjectX does, as well as converting the MPEG2 TS stream to a PS stream with up to a possible 20% savings in file size on top of any cuts made.

See also

Optimizing Performance