Log in

View Full Version : Editing Commercials


tikyle
26th October 2006, 14:31
I've used both HDTV2MPEG and VideoRedo to edit out commercials. They both do a great job at detecting and removing the commercials. The only problem is when playing the file back after the commercials are removed they're flawed.

When using VideoRedo after I play the file back sometimes the video freezes for a couple of seconds and shows a video frame from minutes before or minutes ahead while the audio continues to play fine then the video comes out of freeze and is right back on track. This happens all over the file not just where cuts where made.

When using H2M after I play the file back the entire file (video and audio) will freeze for about 10 seconds (where the cut would be) and then find it's place and pick up after the point where the commercial was cut.

Is there any solution to either of these as I enjoy using both tools and don't want to pay for another one.

I'm using .TS HDTV files captured on a DVICO card and also with VideoRedo I'm experience the same effect when editing non-HD MPEG files I record from analog cable.

Pookie
26th October 2006, 17:27
Open the resulting file (the file after you've cut out the commercials) up in Mpeg2cut2 and scroll through the video, looking closely at the edit points. Can you see the errors?

http://www.geocities.com/rocketjet4/

Another test is to run the UNedited transport stream file through Mpeg2repair http://users.adelphia.net/~mwilczyn/mpeg2repair/ , and edit the output. Videoredo has a similar function built in.

Turtleggjp
29th October 2006, 23:50
I suspect it has to do with the way the audio and video are stored in the .TS file. The audio is usually a ways ahead of the video in terms of when it comes in the transport stream. It is marked with a delay value though so that when the video finally comes through, the audio matches the video. I'm not sure why they do it like this, but this is what I've seen. This becomes an issue when you start to cut the .TS file at certain points. I've noticed when I do cuts (using HDTV2MPEG) I end up with a little bit of audio that plays before the video does, and then at the end, the audio stops for a short time before the video ends. So when you make cuts on your .TS file, you end up with sections like this:

Video: ___***********************
Audio: ***********************

When you put two or more of these cut sections together, you may end up with weird things happening at the cut points. The only thing I can suggest is to find some program that will first correct the audio delay (in the stream) so that when you cut it, you cut both together evenly. Even then, if your .TS file has Open GOPs (which end with B frames refrencing the next I frame) you may still get unpredictable results at the cut points.

If you are converting this video to another format (XviD, DivX, AVC, etc.) you don't need to worry about cutting your .TS file precisely before processing. I tried this too at first and was not happy with the results. I use ProjectX to split my .TS file into a .m2v file and .ac3 file (which now has no delay). I then use VirtualDub to help me figure out where I want to cut the video down to the exact frame (doesn't have to be an I frame in this case) and I then make up my AVISynth script file to do the cutting. Trimming the audio in this manner can be tricky if you plan to leave it in its original form (such as AC3), but if you can first convert it to an uncompressed WAV file, you shouldn't have any trouble editing it. If you do want to keep your audio unprocessed, you can try using VirtualDubMod to cut it, but it tends to not do it correctly all the time. To help me with this, I created an Excel file that I can paste in my video cutting points, and it figures out which AC3 frames also need to be taken, and it gives me the results in a form that I then paste into a file and use AC3 Cutter to give me my cut AC3 file. A bit more complicated, but the results are much better, and I never have any of the problems you were having (yet...).

JamPS
8th November 2006, 15:43
This sounds very complicated, have you tried this free opensource program, StaxRip?
It handles the whole process, though you have to manually find the commercials and cut them out.
http://www.planetdvb.net/staxrip