Log in

View Full Version : Removing commercials from shows


twinceramic
16th January 2005, 05:04
I'm downloading MPEG2 programs from my DirecTivo (Tytools multiplexed), and using GK / AutoGK to convert Xvid. I've read through the guides on using VirtualDub to cut out commercials. It doesn't seem to let me cut at the exact spot where the commercials start. I'm performing the splicing after processing through GK.

Should I use TMPGEnc to splice out the commercials before converting to Xvid? Any advice would be appreciated!

Thanks!
Ken

killingspree
16th January 2005, 11:02
hi and welcome to the forum,

the reason why you cannot cut the video whereever you want is, that you can cut mpeg4 videos only on key frames, which of course is most likely not where you want the cut to exactly be.

so yes, the way to go here is to do the cutting before the encoding with GK/AutoGK.

i'd do it like this: do all the settings in GK as usual until you hit the save&encode button. when you do so, only save the avs file (avisynth script) and exit GK. load the avs script file into VirtualDubMod and use the Trim() command (http://www.avisynth.org/Trim) to do your trimming, as at this stage you can do the cutting at the exact frame you want...

afterwards load the avs file into GK again to get the new bitrate settings (do not alter any other settings like frame size, AR, or any avisynth filters - you should have done all this in the first run) and encode...

kr
steVe

twinceramic
21st January 2005, 09:38
Just getting around to trying this out.

So I've opened the .avs file in VirtualModDub. I've found the starting and ending frames of the commercial segments. Do I edit the .avs file with the trim(start_frame,end_frame)? Or is there a function in VirtualDubMod to input the trim info?

After loading the manually altered avs into GK, and finishing the Save&Encode process, I have two .avs files. The first refers to the original video source, and contains the trim() statements. The second refers to the first .avs. Which sort of makes sense... I noticed the reported bitrate and "Bits/(Pixel*Frames)" look very strange...

Thanks again for the help!
Ken

jggimi
21st January 2005, 09:57
GK treats audio separately, so Trim() won't work unless the audio is added to the .avs script. Rather complicated, since it would need to be demuxed and converted to .wav first.

As your source is MPEG-2, you may find Cuttermaran (http://www.doom9.org/Soft21/DigiTV/Cuttermaran%201.62.zip) helpful; it is an MPEG-2 editor that allows frame accurate cutting. I've not used it, but many members here find it very helpful for MPEG-2 sources.

twinceramic
21st January 2005, 10:28
Thanks for the suggestion... I'll keep that in mind if the trim() method doesn't work. I edited my original reply after trying to get through a few more steps....

The explanation of the trim() function from the avisynth page mentions that the audio is cut as well. I'll add this test job to GK and let it run... we'll see how the experiment goes in the morning. :-)

Ken