PDA

View Full Version : MPEG-2 edit/trim


Eagle117
28th February 2003, 05:16
Hello.

I've done some searches in this forum for an answer, but can't seem to find one. I capture TV using WinDVR which creates MPEG2 files. Normally, I would Flask these into DivX and then cut the commercials out, but this results in having a keyframe either just before or just after I want it.

I would like to cut the commercials out of the MPEG2 in that format, so when I encode to DivX 5 it will flow.

So my question is, what would be some good (preferably free) software that would allow me to cut various sections of MPEG2 files out, leaving the rest intact as a giant file. I thought I could do something close to this with PowerVCR's trimmer, but I really don't want to install that program again. I love using VirtualDub to set a start at the beginning of the commercials, set an end, and then press delete and all the commercials go bye bye. I'm looking for something with an interface like that.

I tried TMPGEnc and it wouldn't open the file created by WinDVR. So I'm looking for recommendations for any other software. I'm open to trying just about anything. Thanks for your help!


-=Edit=-

I just saw VirtualDub with MPEG2 support built in, which I will check out, but since I'm looking to go with DivX 5 I'm thinking automatic two pass. I've been playing with GordianKnot, which I would like to try to use, which is why I would like to edit the files before, and then load them into GK. But if that doesn't work out, maybe i"ll just use that edited version of VDub and work it that way.

P.S. In another thread they mentioned some programs to clean up MPEG2 files that were created with realtime compressors like WinDVR. Anyone know any more about that?

TelemachusMH
28th February 2003, 09:21
Your best bet is to use dvd2avi and avisynth with the trim command to cut out the frames for the commercials. Read this thread (http://forum.doom9.org/showthread.php?s=&threadid=28973&highlight=trim) for a more complete answers on a few ways of doing it.

TelemachusMH

jggimi
28th February 2003, 16:37
VirtualDubMod supports MPEG-2 streams. If you like Vdub, you might give VdubMod a try.

Disclaimer: I actually use DVD2AVI and AviSynth's Trim command, as Telemachus recommends.

Eagle117
28th February 2003, 19:17
That looks like what I want to do, but how can I incorporate that into Gordian Knot? When I save the AVISyth file, I go back in to edit it and add my trim commands, but won't that leave my audio way out of sync? The audio was extracted when I created the DVD2AVI project, so it won't be trimmed along with the video, correct?


I like that idea of getting it to trim perfectly. What settings do you use in VDub if you dont' use Gordian Knot?

TelemachusMH
28th February 2003, 19:30
To solve your audio problem you would either have to decode the sound into wav format (you can probably use besweet for this, it will decode just about every commen format) and then add it to the script with the WavSource command (as shown in the script I wrote in the thread about) then you can open the avs in VitualDub and File/Save wav. After that it will be trimmed without the commercials exactly as the video is and you can change the wav into the format of your choice. Then when the video is done, just mux!

TelemachusMH

Eagle117
28th February 2003, 19:53
AhHa! That makes perfect sense. I didn't catch onto that earlier. For some reason in my situation it seems like the only program that can make a good wav that stays in sync is WinAmp, but once I get it into a Wav, then I'll do the virtualdub trick. Thank you very much! Now maybe I can actually get some good captures.

BaronVlad
1st March 2003, 02:15
Hi,

You could also use MPEG2toVirtualDub ( http://forum.doom9.org/showthread.php?s=&threadid=47035 )

This will clean up the files (using PVAStrumento) generate an avisynth script and load it with VDub, You can easily edit the script (i.G. adding filters...) then cut the ads in VDub and compress the movie. Sound included (mpasource by Warpenterprises)

Your audio problem should also be solved then.:)

Eagle117
6th March 2003, 18:20
Gave up on Goridion Knot for doing TV captures, since I want to be able to set it to a constant bitrate for DivX to try, and GK keeps changing it to match the file size, which I don't care about.

Now using VirtualDub with MPEG-2 support which is working. Couple more questions though.

1) If using VirtualDub, what MP3 codec do you use? Right now I'm using the Fraunhofer codec from 99 and I didn't know if any new releases had been made. Or do you just write the wave and use LAME to encode? Using the audio compression in Vdub sounds like a better thing to me, but I'm looking for quality/speed.

2) Do you use any filters, such as denoise or resizing? I've been playing with the built-in smoother and not exactly happy with the results, but I just downloaded the smart smoother filter, so I'll give that a shot.

Slowly working all this out. Thanks for your input!

Eagle117
7th March 2003, 06:10
Followup to my last post. I got the SmartSmoother from David Graff (SP?) and it really slows me down, like from going at 100fps down to 30fps. Do I need to do this on both DivX5 passes, or only on the second one? I know I /can/ only do it on the second one, but I'm wondering if I'm messing up, since the first pass doesn't get to analyze what happens with the filter in place.

Just wondering.

TelemachusMH
7th March 2003, 06:21
If you don't do it on both passes the file size is not as predictable, and the output video will not be optimally compressed. You CAN do it for just the second, but it is BEST if you do it both times.

TelemachusMH

btw ... How are you getting 100fps?

Eagle117
7th March 2003, 06:24
I was afraid of that. I guess I'll do the filter on both passes then.

I get 95-100 FPS when I was doing 320x240, second pass, VirtualDub on a 2.53Ghz P4.


Any other suggestions on filters or MP3 codecs for use inside VirtualDub?

lusid
12th March 2003, 10:09
There is an optimised version of 2D Cleaner that can produce similar results, and it's way faster.

Also, for editing mpegs, M2-Edit works really well. It can do frame accurate edits so you don't need to worry about editing on keyframes. Not free though, and it's not strictly linear like virtualdub's editing features.

Eagle117
12th March 2003, 14:38
Thanks. I'll look into it.