cengique
22nd February 2008, 16:37
I have been recording from SD/HDTV digital cable broadcasts in the US (Comcast) and more recently transferring recorded shows from my Motorola DCT3614 HD-DVR to my PC via firewire. From this, I get Transport Stream (TS) files with MPEG2 video and AC3 audio.
This is a guide that I normally follow to cut the commercials out and then compress to constant-quality H.264 encoding with the x264 encoder into Matroska (MKV) files.
I am hoping to help other people who has a similar need, and also would like to get feedback from you other guys who know how to do this better :)
Here's my guide on how to compress Comcast transport stream (TS) files to H.264 MKV. I listed links to the programs at the bottom of the post. Follow one of the methods below:
The best method is using ProjectX. If it doesn't work, there are two alternatives (B,C) below.
Open TS in ProjectX (follow tutorial in http://freqi.net/tutorials/projectx/)
Process the output M2V file with DGIndex using MeGUI->Tools->D2V Creator (without demuxing any audio tracks! ProjectX does the job right.)
Create AVISynth script with MeGUI
Compress with MeGUI into a MKV format (use x264 with constant quantizer qp26 (default) or qp24 for a little higher granularity.)
Mux video and audio togeher using the MKV mux in MeGUI (Mkvtoolnix). No need to put in any audio delay.
VDM method: works, but tedious. you will also get small delays after several cuts. This is due to the inherent problems with the AVS cutter in MeGUI.
DGIndex the whole file and demux all audio (don't choose a range, audio doesn't follow it)
Create AVISynth script with MeGUI
Choose either one that works:
Use MeGUI to create a cut script and embed cut points into the AVS at the same time
If MeGUI is too slow because of AVS processing, use VirtualDub[Mod] to find cut points, then translate them by factoring in framerate change
Cut the audio file (AC3) with the same cut points, using the MeGUI Audio Cutter (besplit)
Process AVS with cut points to compress with MeGUI into a MKV format
After getting a MKV video, mux the audio into it (don't forget to put in the audio delay written in the filename)
Mpg2Cut2: may or may not work with your files, and small audio delays *may* appear arbitrarily.
Load TS file in Mpg2Cut2 and select ranges to include, adding them to the edit list after each time. Save list often to prevent against crashes.
Save new TS file from Mpg2Cut2
DGIndex it (MeGUI->Tools->D2V Creator) with demux audio option
Create AVISynth script with MeGUI
Compress with MeGUI into a MKV format
Mux video and audio togeher using the MKV mux in MeGUI (Mkvtoolnix). Put in the audio delay.
Once you get a few AVS scripts, you can reuse them without re-generating them everytime. That requires an understanding of how the underlying video is encoded by stepping through the frames, though.
Here's where I got these programs:
ProjectX
(original site: http://project-x.sourceforge.net/, pre-compiled bundles here: http://www.oozoon.de/main_en.html)
VDM: VirtualDubMod (http://sourceforge.net/projects/virtualdubmod/) or VirtualDubMPEG2 (http://fcchandler.home.comcast.net/~fcchandler/stable/)
MeGUI: http://mewiki.project357.com/wiki/Main_Page
MeGUI will download many tools and automatically update them for you.
AvisSynth: http://avisynth.org/mediawiki/Main_Page
Mpg2Cut2: http://www.geocities.com/rocketjet4/
Happy compressing everybody!
This is a guide that I normally follow to cut the commercials out and then compress to constant-quality H.264 encoding with the x264 encoder into Matroska (MKV) files.
I am hoping to help other people who has a similar need, and also would like to get feedback from you other guys who know how to do this better :)
Here's my guide on how to compress Comcast transport stream (TS) files to H.264 MKV. I listed links to the programs at the bottom of the post. Follow one of the methods below:
The best method is using ProjectX. If it doesn't work, there are two alternatives (B,C) below.
Open TS in ProjectX (follow tutorial in http://freqi.net/tutorials/projectx/)
Process the output M2V file with DGIndex using MeGUI->Tools->D2V Creator (without demuxing any audio tracks! ProjectX does the job right.)
Create AVISynth script with MeGUI
Compress with MeGUI into a MKV format (use x264 with constant quantizer qp26 (default) or qp24 for a little higher granularity.)
Mux video and audio togeher using the MKV mux in MeGUI (Mkvtoolnix). No need to put in any audio delay.
VDM method: works, but tedious. you will also get small delays after several cuts. This is due to the inherent problems with the AVS cutter in MeGUI.
DGIndex the whole file and demux all audio (don't choose a range, audio doesn't follow it)
Create AVISynth script with MeGUI
Choose either one that works:
Use MeGUI to create a cut script and embed cut points into the AVS at the same time
If MeGUI is too slow because of AVS processing, use VirtualDub[Mod] to find cut points, then translate them by factoring in framerate change
Cut the audio file (AC3) with the same cut points, using the MeGUI Audio Cutter (besplit)
Process AVS with cut points to compress with MeGUI into a MKV format
After getting a MKV video, mux the audio into it (don't forget to put in the audio delay written in the filename)
Mpg2Cut2: may or may not work with your files, and small audio delays *may* appear arbitrarily.
Load TS file in Mpg2Cut2 and select ranges to include, adding them to the edit list after each time. Save list often to prevent against crashes.
Save new TS file from Mpg2Cut2
DGIndex it (MeGUI->Tools->D2V Creator) with demux audio option
Create AVISynth script with MeGUI
Compress with MeGUI into a MKV format
Mux video and audio togeher using the MKV mux in MeGUI (Mkvtoolnix). Put in the audio delay.
Once you get a few AVS scripts, you can reuse them without re-generating them everytime. That requires an understanding of how the underlying video is encoded by stepping through the frames, though.
Here's where I got these programs:
ProjectX
(original site: http://project-x.sourceforge.net/, pre-compiled bundles here: http://www.oozoon.de/main_en.html)
VDM: VirtualDubMod (http://sourceforge.net/projects/virtualdubmod/) or VirtualDubMPEG2 (http://fcchandler.home.comcast.net/~fcchandler/stable/)
MeGUI: http://mewiki.project357.com/wiki/Main_Page
MeGUI will download many tools and automatically update them for you.
AvisSynth: http://avisynth.org/mediawiki/Main_Page
Mpg2Cut2: http://www.geocities.com/rocketjet4/
Happy compressing everybody!