Captured HD-TS (MPEG2) into H.264 (AVC)

Discuss about generic usage of MediaCoder.

Moderator: HuggiL

Locked
meRobs
Expert
Expert
Posts: 3116
Joined: Tue Jun 23, 2009 2:45 pm
Location: Sydney, Australia

Captured HD-TS (MPEG2) into H.264 (AVC)

Post by meRobs » Sat Apr 09, 2011 9:39 am

[Updated: 9 Apr 2011]

The Test Report on MediaCoder builds 5000 onwards (viewtopic.php?f=17&t=10383, and that for earlier builds (viewtopic.php?f=17&t=9611, involve relatively simple tests on source files that are either VOBs or FLVs. The findings in these tests would generally apply to other common varieties, such as: MPG, AVI, MP4, WMV and MKV, since there is no particular reason why they wouldn’t. Also, as a check, I occasionally convert them as well.

These reports include the success or otherwise of the conversion scenarios suggested in the Encoding Guide (viewtopic.php?f=17&t=9643). However, these results do not necessarily apply to a TS source file (see Section 1). Indeed, until recently, virtually all builds of MediaCoder failed to achieve a proper conversion of TS files (see Section 3).

As a result, Akira Kawamoto has been systematically doing extensive testing of the various builds of MediaCoder. His reports are usually placed in the Bug Report sections of the Forum under the alias: “kawamoto76”. The test results given in this Guide (Sections 2 and 3, below) are from his Posts, especially:
(1) viewtopic.php?f=28&t=10462 and
(2) viewtopic.php?f=17&t=10262.

Section 1: What are TS files and why the fuss?

Basically, there are two types of MPEG2 files. The first is the common variety as used in DVDs, also referred to as MPEG2-PS, and is what results when “MPEG2” is chosen as the container in MediaCoder. The video stream in a VOB is MPEG2-PS and usually is accompanied by one of more audio streams (stereo or 5.1 channels), usually as AC3. The second type is the MPEG2-TS, where TS is short for Transport Stream, a variety intended for less-than reliable transmissions, such as terrestrial or satellite broadcasts. There is also a version suitable for Blu-ray disc video, the M2TS format.

HD (High-Definition) Television broadcasts are often distributed on the internet via TS, and may be captured with a TV-tuner board or a USB tuner. The included audio is usually AC3 or AAC. Moreover, ‘soft-telecine’ techniques are commonly employed, presumably to help reduce band width requirements. Telecine is a process for transferring motion picture film, usually at 24 frames per sec (fps), to the video form as required by TV, either 25 fps or 29.976 fps. This is done in two stages: (1) slow down the video and audio by 0.1% (not noticeable) to 23.97 fps and (2) if converting the progressive frames into interlaced video (nominally 2 fields for each frame), a suitable number of extra fields are added by duplicating others. This is called the Telecine process.

The extra fields are either added before or after transmission. They are either:
(1) ‘hard-telecined’, where the extra fields are inserted by repeating fields (Pulldown) at suitable positions during the interlacing. For USA and Japan, the result would be interlaced video at 29.97 fps or
(2) ‘soft-telecined’, where the video is kept progressive at 24 or 23.976 fps and RFF/TFF flags are inserted to enable a player to properly interlace at the frame rate required by TV, such as 29.97 fps. For more information on the Telecine process, see the Wikipedia article at: http://en.wikipedia.org/wiki/Telecine.

In the future, when analogue TV is no longer transmitted (digital only), all broadcasting done with 3:2-pulldown will be replaced by soft-telecined video using RFF/TFF flags.

Why the fuss? This is because MPEG2-TS files are difficult to convert. Partly because the video is telecined and partly because information about the CODECs that had been used for the file and the audio channel mapping, etc, is not available from the file header and must be obtained from the stream itself. Also, such data may change throughout the stream!

Section 2: the Tests

The tests were done by kawamoto76 who captured HD TS files broadcast by satellite-TV service in Japan, such as NHK-BS and WOWOW. The TS files (24 Mbps) had MPEG2 video at 1920x1080 and AAC audio, usually 2-3 hours in duration and were of four types:
(1) Hard-telecined with stereo audio – interlaced at 29.97 due to 3:2 pulldown
(2) Hard-telecined with 5.1 ch audio – interlaced at 29.97 due to 3:2 pulldown
(3) Soft-telecined with stereo audio – 23.976 progressive with RFF/TFF flags
(4) Soft-telecined with 5.1 ch audio – 23.976 progressive with RFF/TFF flags

The ability of the various builds of MediaCoder were judged as to whether they could:
(a) convert the large-duration files completely (settings in Section 4)
(b) accurately keep Audio-Video sync over the entire duration
(c) and correctly treat dual audio tracks, if present.

Section 3: Results

The ability of various builds to convert the 4 types of TS source file described above was tested as was their ability to treat dual audio tracks.

MediaCoder .... Hard TC .... Hard TC .... Soft TC .... Soft TC .... Dual
... Build ......... stereo ...... 5.1 ch ...... stereo ...... 5.1 ch .... audio
4399 ** ............ OK ........... ? ........... OK ......... faulty ...... OK
4450-4668 ...... failed .......... ? ......... failed ....... failed .... failed
4672-4677 ........ OK ........... ? ......... failed ....... failed .... faulty
4685-4730 ........ OK ........... ? ........... OK ......... faulty .... faulty
4740-4797 ........ OK .......... OK .......... OK .......... OK ...... faulty
4798-4799 ........ OK .......... OK .......... OK ........ faulty ...... OK
5000-5075 ........ OK .......... OK ........ faulty ....... faulty ...... OK
5100 ............... OK ......... OK? ......... OK .......... OK ........ OK

NOTE: “failed” = serious failure (aborted, no audio, etc) ….. “faulty” = out of sync.
“?” = not yet tested ….. “OK?” = not yet tested but likely to work ….. ‘TC” = Telecine
** The multiplexer TSmuxer is not included in build 4399, so the streams need to be treated separately and muxed together later.

Section 4: MediaCoder Settings

Samples were converted in MediaCoder to H264/AC3 in M2TS with the settings:

Video Tab: Format/Encoder/Source = H264/x264/Auto at 4000 kbps (VBR) and at right, on the Xvid tab: Profile/Level/Preset = High/4.1/Medium

Audio Tab: Format/Encoder/Source/Resample = AC3/FFmpeg/Auto/44.1 kHz and Dual Audio Track, if relevant. At right, on the FFmpeg tab: 448 kbps

Container Tab: Container/Muxer = M2TS/Auto (TSmuxer)

Picture Tab: Resize/Frame Rate = Original/23.976 (2400/1001) with Keep Display AR and Crop disabled. The Effects were at default values (no trimming)

Sound Tab: Channels to match the source (Stereo or 5.1 channels) with Audio Delay, Normalise and Gain disabled.
Have you checked out the Tips & Guides for MediaCoder? Try: http://forum.mediacoderhq.com/viewtopic.php?f=17&t=8061
Also, get older builds at: http://www.videohelp.com/tools/MediaCoder/old-versions#download

Locked