Difference between revisions of "Transcoding"

From MythTV Official Wiki
Jump to: navigation, search
m (whoops, I really should use the preview button)
 
(8 intermediate revisions by 8 users not shown)
Line 1: Line 1:
'''Transcoding''' is when you decode video compressed in one format, and re-encode it in another.  Usually, it's done for 2 reasons:
+
'''Transcoding''' is when you decode video compressed in one format, and re-encode it in another.  Usually, it's done for a couple of reasons:
  
* to remove commercials
+
* [[Removing Commercials]] - decompressing a compressed video, removing the parts marked to be removed (the commercials) and re-encoding the video stream, to the original or to a different video encoder using a codec.
* to free up hard disk space
+
* to support devices that desire a particular format, like H.264 on handheld devices.
 +
* to free up hard disk space; by reducing the quality or changing the encoding of the video to a more efficient codec (or a combination of these) space can be saved.
  
MythTV commonly marks commercials in a recorded show immediately after recording is complete, then these commercials are cut in the transcoding pass.
+
Video is broadcast (for TV or streamed internet content) using a "lossy" method of encoding, whether it is a digital or analogue transmission. This is due to two constraints: Initially the technology at the start of TV broadcasts couldn't transmit all the data and interference introduced much more. In the modern digital era, the cost-benefit of broadcasting perfect video would reduce the number of television channels (due to the limited bandwidth available) while significantly increasing the cost of each channel and reception equipment AND many users would not notice the improvement provided since the incremental improvement  comparing the lossy and lossless transmission.  
  
(Some of us, who actually *like* the commercials, would prefer to be able to leave them in during the transcoding pass, but we haven't read the code deeply enough to figure out how yet...)
+
Decompressing then re-compressing using a lossy encoder ALWAYS results in some data loss and some reduction of fidelity in the data that went through this process. Video should be converted as infrequently as possible. compressing video streams is processor intensive, and the better the resolution of the video the more pixels to be considered Full HD content may only be roughly twice the number or rows (500px high compared to 1080px high) but there is 4 times the amount of pixels to be converted.
 +
 
 +
A frame of video is one still image. A traditional video, such as on a piece of film run through a projector comprises still frame after still frame which when played quickly is perceived by the brain as a moving image. This is how [[Video_capture_card#Analog_Framebuffer_Cards|framegrabber]] video acquisition devices work but it is not how broadcast video is transmitted. Most compressed videos encode a full frame of information, only making approximations in the information and discarding using a mathematical model to determine what pieces of information will be kept so that using the fixed amount of bandwidth available the best possible perceived quality is achieved. Peoples perception of quality with moving pictures is not simple.
 +
 
 +
From this one encoded frame, also known as a key-frame or [http://en.wikipedia.org/wiki/I-frame I-frame], each subsequent frame is derived from it, using various transformations, like pan, skew and tilt. this is filled in with missing information that wasn't in the key-frame. The following frame is then also derived from the previous frame. This process continues until a new key-frame is transmitted. The amount of times the same or related information has to be sent is minimised saving considerable disk space. This is why if there is transient interference on a digital television show, such as a single bolt of lightning, the effect on the TV recording may continue for several seconds until the next key-frame is received.
 +
 
 +
There is a belief that frame-grabbers are higher-quality, however frame-grabbers compress each frame usually with a lossy image codec such as jpeg and as more information is repeated time and again in each frame of information more information must be stored. So for any given picture quality a frame-grabber file will be a larger file, unless each frame is unrelated to the previous, which is highly unlikely in a video.
 +
 
 +
The [[mythtranscode]] utility performs these functions and can provide a near lossless removal of adverts from an mpeg2 video stream by only re-encoding the few frames affected by the removal of  transcode
 +
 
 +
See the [[User_Manual:Daily_Use#Editing.2C_Transcoding.2C_Removing_Commercials|User Manual section on Transcoding]] for more information.
 +
 
 +
See also [[Transcode Video]].
  
 
[[Category:Glossary]]
 
[[Category:Glossary]]

Latest revision as of 11:50, 10 September 2015

Transcoding is when you decode video compressed in one format, and re-encode it in another. Usually, it's done for a couple of reasons:

  • Removing Commercials - decompressing a compressed video, removing the parts marked to be removed (the commercials) and re-encoding the video stream, to the original or to a different video encoder using a codec.
  • to support devices that desire a particular format, like H.264 on handheld devices.
  • to free up hard disk space; by reducing the quality or changing the encoding of the video to a more efficient codec (or a combination of these) space can be saved.

Video is broadcast (for TV or streamed internet content) using a "lossy" method of encoding, whether it is a digital or analogue transmission. This is due to two constraints: Initially the technology at the start of TV broadcasts couldn't transmit all the data and interference introduced much more. In the modern digital era, the cost-benefit of broadcasting perfect video would reduce the number of television channels (due to the limited bandwidth available) while significantly increasing the cost of each channel and reception equipment AND many users would not notice the improvement provided since the incremental improvement comparing the lossy and lossless transmission.

Decompressing then re-compressing using a lossy encoder ALWAYS results in some data loss and some reduction of fidelity in the data that went through this process. Video should be converted as infrequently as possible. compressing video streams is processor intensive, and the better the resolution of the video the more pixels to be considered Full HD content may only be roughly twice the number or rows (500px high compared to 1080px high) but there is 4 times the amount of pixels to be converted.

A frame of video is one still image. A traditional video, such as on a piece of film run through a projector comprises still frame after still frame which when played quickly is perceived by the brain as a moving image. This is how framegrabber video acquisition devices work but it is not how broadcast video is transmitted. Most compressed videos encode a full frame of information, only making approximations in the information and discarding using a mathematical model to determine what pieces of information will be kept so that using the fixed amount of bandwidth available the best possible perceived quality is achieved. Peoples perception of quality with moving pictures is not simple.

From this one encoded frame, also known as a key-frame or I-frame, each subsequent frame is derived from it, using various transformations, like pan, skew and tilt. this is filled in with missing information that wasn't in the key-frame. The following frame is then also derived from the previous frame. This process continues until a new key-frame is transmitted. The amount of times the same or related information has to be sent is minimised saving considerable disk space. This is why if there is transient interference on a digital television show, such as a single bolt of lightning, the effect on the TV recording may continue for several seconds until the next key-frame is received.

There is a belief that frame-grabbers are higher-quality, however frame-grabbers compress each frame usually with a lossy image codec such as jpeg and as more information is repeated time and again in each frame of information more information must be stored. So for any given picture quality a frame-grabber file will be a larger file, unless each frame is unrelated to the previous, which is highly unlikely in a video.

The mythtranscode utility performs these functions and can provide a near lossless removal of adverts from an mpeg2 video stream by only re-encoding the few frames affected by the removal of transcode

See the User Manual section on Transcoding for more information.

See also Transcode Video.