ExtraTorrent.cc - The Largest Bittorent SystemLogin   |   Register
Latest Articles
Most searched
Hot torrents
First Cams
View Torrent Info: The.Fate.of.the.Furious.2017.HDTS.H264.AC3.HQ.Hive-CM8
View Torrent Info: The Boss Baby 2017 720p HD-TS x264 AC3-CPG
View Torrent Info: Before I Fall 2017 HDCAM 700MB x264-DiRG
View Torrent Info: The Belko Experiment 2017 HDCAM 700MB x264-DiRG
Hot torrents
View Torrent Info: Fifty.Shades.Darker.2017.UNRATED.BRRip.XViD.AC3-ETRG
View Torrent Info: Mythica.The.Iron.Crown.2016.BRRip.XviD.AC3-EVO
View Torrent Info: The.Void.2016.BRRip.XviD.AC3-EVO
View Torrent Info: Joes.War.2017.HDRip.XviD.AC3-EVO
Hot torrents
H264 X264
View Torrent Info: The.Void.2016.720p.BluRay.X264-AMIABLE[EtHD]
View Torrent Info: Mythica.The.Iron.Crown.2016.720p.BluRay.x264-PFa[EtHD]
View Torrent Info: Fifty.Shades.Darker.2017.UNRATED.720p.WEB-DL.H264.AC3-EVO[EtHD]
View Torrent Info: Jurassic World (2015) 720p BluRay x264 DTS Soup
Hot torrents
BluRay, 4k UHD
View Torrent Info: The Void 2016 Bluray 1080P x264 DTSHD 5.1 -DDR
View Torrent Info: The Legend of Ben Hall 2016 Bluray 1080p x264 DTSHD5.1 -DDR
View Torrent Info: Hacker.2016.BluRay.1080p.AVC.DTS-HD.MA5.1-DDR
View Torrent Info: Carmen.1984.1080p.Blu-ray.x264.DTSHD.5.1-DDR
Hot torrents
View Torrent Info: Arrow.S05E19.WEB-DL.x264-FUM[ettv]
View Torrent Info: Fargo.S03E02.WEB-DL.x264-FUM[ettv]
View Torrent Info: Blindspot.S02E19.WEB-DL.x264-FUM[ettv]
View Torrent Info: The.100.S04E09.WEB-DL.x264-FUM[ettv]
View Torrent Info: Painkiller (2013) x264 720p UNCUT WEB-DL {Dual Audio} [Hindi ORG DD 2.0   English 2.0] Exclusive By DREDD
View Torrent Info: Chandni Bar 2001 480p NFRip ESub -DDR
View Torrent Info: Bhadram (2014) Bluray 1080p x264 DTSHD 5.1 -DDR
View Torrent Info: Ho Mann Jahaan (2016) 1080p Untouched WEBHD AVC AAC [DDR]
To add new messages please Login or Register for FREE
Warning! Stop Government from Tracking Your Torrenting!
Your IP Address is   Location is United States
Your Internet Provider and Government can track your internet activity! Hide your IP and LOCATION with a VPN
ExtraTorrent strongly recommends using Trust.Zone VPN to anonymize your torrenting. It's FREE!

Convert HDTV H264 Transport Stream (TS) to H264 in MKV

Post a Reply    Subscribe to Topic    
No avatar
Posted: Fri Sep 17, 2010 11:47
Author: Blocked
Convert HDTV H264 Transport Stream (TS) to H264 in MKV

Lately I changed my HTPC setting in order to get the full experience of HDTV. Because of that I installed Windows 7 and MediaPortal 1.1 RC1 instead of the Microsoft Media Center.

Well, MediaPortal is able to record SDTV and HDTV. The recordings are stored in a Transport Stream file *.ts and because of that those files are merely a dump of the TV signal and rather big. A movie that lasts 2 hours takes about 12 GB (1 Video Stream, 2 MPEG Audio Streams, 1 AC3 Stream, Teletext)

I needed a solution to compress and convert those files somehow. The problem is that there are not many applications out there that can handle Transport Streams with H264 content so far. Most people suggest ProjectX, however ProjectX does NOT SUPPORT Transport Streams with H264 (07.04.2010) and is unable to demux or repair the video of such TS files.

With TS Files you usually can’t use normal video editing tools because a TS file most likely contains errors. In fact, the purpose of Transport Stream files is to transport information that may get corrupted on its way. At the other end, the recipient (TV, HTPC, Player,..) has to work out a way to fix the errors or at least don’t crash while decoding the streams. Most video editing tools and players however work with “Program Streams” and assume that the video and audio data contains no errors.

After some try & error I found a way to convert those TS files using MeGUI.

STEP 1 – Unmux the Streams
Open MeGUI and select TOOLS -> HD STREAMS EXTRACTOR. Check the radio box that you will use a file as input and select your TS file. Mark all Streams in the “Streams(s)” section in order to extract them. The video should be extracted as MKV. Select an output folder and hit Queue.
In the main MeGUI window switch to the queue and start the job.



MeGUI: HD Stream Extractor

MeGUI: Queue

After the job is finished you should see several files in the output directory you specified. In my example:

T1_Video – .mkv
T2_Audio – German.mp2
T3_Audio – German.mp2
T4_Audio – German.ac3
T1_Video – - Log.txt (don’t delete this file, we need it later)

This step demuxes and muxes the video stream of the TS file in a MKV file and somehow fixes small errors on the way. I guess the video stream still contains some errors (you cannot fix what’s missing) but the container and seeking functionality get fixed [critication needed]. MeGUI most times displays several errors when you try to create a AVS file with the TS file, however it seems to work with the MKV file created in this step.

STEP 2 – Create a AviSynth Script + Cropping
After the extraction process 2 new windows should appear automatically.
If no windows appear check if you have started the job specified in Step 1 or open it manually with TOOLS -> AVS SCRIPT CREATOR and select the mkv file you created in step 1, not the TS file.
One is the preview window and the other one is a settings window. Most likely your recorded video has some black bars on top, left, right or bottom. If you want to crop the video to remove the black bars you should select “Clever (TM) anamorphic encoding” -> “Overcrop to achieve mod16? and specify the crop parameters in the Crop & Resize section. Hit “Save” after you entered your prefered settings.

If you don’t want to crop anything, just hit “Save” immediately. This Action will create a Avi Synth script *.avs.


MeGUI: AviSynth Script Creator

You can also resize the video in this dialog. If you want to resize it you can choose “resize to mod16? instead of “Overcrop to achieve mod16?.
If you want to cut some parts of the video you can do that afterwards by editing the AVS file with TOOLS -> AVS CUTTER. However I recommend to cut the file after the encoding and muxing everything together simply because if you cut the video file now you have to cut the audio files later manually.

STEP 3 – Encode Video
After you saved the AVS Script a new preview window should appear because MeGui loads the new script right away. If that’s not the case you have to select the script in the input tab of the main MeGUI window. You can close the video preview window.

Choose a place and a filename where the new video file should be created in “Video Output” and the file format should be MKV.

In this step you can also calculate and set a desired filesize using TOOLS -> BITRATE CALCULATOR. However I skip that part and just use the default settings.

Select your prefered encoder settings from the dropdown. hit “Enqueue” and start the job.


MeGUI: Encoder Settings

In my example I use “x264: DXVA-HD-HQ” as encoder setting. That profile ensures that the file that will be created is DXVA compatible and because the input source is HDTV I choosed a HD profile. If the source contains SD Content you should use one of the “x264: DXVA-SD-*” profiles. What kind of profile you use, “Anime_Toons Fast”, “Anime_Toons HQ”, “Balanced”, “Extra Quality”, “Fast”, “HQ” or “Insane” depends on your content. There’s no real guideline for that, just try the different profiles and see what looks best.

STEP 4 – Mux the Streams
After some minutes/hours/days MeGUI has finished the encoding of the video. The last step is the muxing of all the streams (Audio+Video) in a single MKV Container. Select TOOLS -> MUXER -> MKV MUXER from the MeGUI main window.

“Video Input” is the file that MeGUI just created for you.
In the Audio Section of the muxer, add the audio tracks you want to include with your video file. In my case there were 3 audio streams that were broadcasted. Most times *.MP2 files contain Mono or Stereo Audio and *.AC3 files contain Stereo or 5.1 Audio.

We open the small *.txt file that was created in Step 1 with a text editor and see what audio streams we got. In my case I found those sections in my *.txt file:

TS, 1 video track, 3 audio tracks, 2:12:00, 50p
1: h264/AVC, 720p50 (16:9)
2: MP2, German, 2.0 channels, 256kbps, 48khz, -1349ms
3: MP2, German, 2.0 channels, 256kbps, 48khz, -1351ms
4: AC3, German, 2.0 channels, 448kbps, 48khz, dialnorm: -22dB, -1391ms

As you see, all my 3 audio files are Stereo (2.0 channels). A very important information in this file is the delay of each audio track, marked bold.

Back to the muxer. Select the audio file(s) you want to include in your Video. You have to enter the right delay of the audio file you selected. If you don’t enter the right delay, the audio will be ahead or after the video.


MeGUI: MKV Muxer

Choose a path and a filename for the file in “Muxed Output”, hit “Queue” and start the job. This should only take a few seconds/minutes.


Post a Reply    

Forum Search

  search in post message
  search in topic subject

Home - Browse Torrents - Upload Torrent - Stat - Forum - FAQ - Login
ExtraTorrent.cc is in compliance with copyrights
Can't load ExtraTorrent? Try our official mirrors: etmirror.com - etproxy.com - extratorrentonline.com - extratorrentlive.com
2006-2017 ExtraTorrent.cc5