View Full Version : How do I remove commercials correctly without audio sync problems?
think_harder
30th September 2002, 15:55
when I delete the frames using nandub the audio goes out of sync with the video, but I don't know how to fix this; is there a special program that I can use to resync the segments or a special guide?
help!!! :(
Ookami
30th September 2002, 16:02
Er, never had this problems. I hope you don't use Nandub for capturing? And, BTW, are you sure your files are not asynch even BEFORE you cutted out the commercials?
Use a VirtualDub version with the sync patch for capturing (take a look at the FAQ!).
Doom9's VD procedures: http://www.doom9.org/virtualdub_procedures.htm
Cheers,
Mijo.
think_harder
30th September 2002, 16:07
I used powervcrII to capture to mpeg2 and then convert it to divx, the file was in sync before I cut the commercials out
anybody have any suggestions on what program I should use to fix this?
bb
30th September 2002, 17:27
Let me guess: you cut out the commercials before you converted to DivX, right?
bb
think_harder
30th September 2002, 17:37
no I didn't I cut them with nandub after I had converted to divx
I had to use nandub because virtualdub doesn't handle VBR mp3
any suggestions?
Swan
30th September 2002, 19:16
anybody have any suggestions on what program I should use to fix this?
How do you cut out the commercials? I'm a bit thick, I don't get that part. :)
You capture in Mpeg-1 or Mpeg-2? What resolution and so on?
Have you tried editing the Mpeg-file directly, cutting out the commercials with, say TMPGenc, then, after that, encoding it to DivX?
How long is the show you recorded that went out of sync? My guess is longer than 30 minutes?
Did the file have any frame drops? I know PowerVCR does not report this, but when you watch the Mpeg-file, does it jerk from time to time or look otherwise odd at times?
Try this:
Cut out the commercials with TMPGenc and create a commercial free-file for each segment. You'll end up with several Mpeg-files, depending on how many commercial breaks there were. Threat these just as you would vob-files.:)
Here's how I do it:
I capture a show each night that is 50 minutes long, and three commercial breaks.
After 15 minutes, there's a break.
After 35, there's another, etc.
I cut out the commercials, so that I have three separate Mpeg-2 files.
I then treat these just like a DVD and you can follow Doom9's guide for DivX encoding pretty much straight through. Yes, even use GordianKnot for a compressability test (great stuff!) :).
Most of the time, I have no sync issues on the encoded DivX files, but sometimes I do (the Mpeg-2 files are always in perfect sync) especially on video clips that are above 40 minutes long. And I don't have any frame drops. I believe many of the Mpeg-2 capturing softwares create a bit fishy (non compliant to the standard) files, and also that it's possible to insert time codes in Mpeg-files that perhaps DVD2Avi doesn't understand) Whatever the reason, this is a common problem on long Mpeg-2 captures for me too. For those occasions I do a workaround (see below).
But if you like, you can try my method with the problematic show.
Cut out the commercials = create separate, commercial-free Mpeg-files. Name these files, 1,2,3, etc and save in one and the same folder. Create a DVD2Avi project (just feed it file #1 and it will load the following files too because of the naming) and use Avisynth to frameserve these to Nandub. Encode as usual. Convert the .mpa to wav, then to mp3. There's a free mpa (mp2) to wav converter called dBpowerAMP Music Converter (dMC) that I recommend highly: http://www.dbpoweramp.com/dmc.htm
I always convert the .mpa (mpeg audio) file to wav and insert into the avisynth script, with the proper audio delay (if DVD2Avi reported any) written in the avisynth script. I then load the avs file into Mediaplayer and see if the audio is in sync, before encoding! :)
Workaround:
If the audio goes out of sync anyway (which sometimes is the case), then I simply encode the three Mpeg's to *separate DivX files*. That is; create a DVD2Avi project for each file, etc. That is a bulletproof method for me, the audio is always in sync when I do that.
I play the DivX files with a software like BSplayer that can create playlists, so it doesn't matter that it's not one big avi to me. I think the sync is more important. I have not had a single out-of-sync file using this method. But if your Mpeg-files contain dropped frames, etc, then it may be tricky.
/Swan
think_harder
30th September 2002, 21:56
thanks for the tip I will use TMPGenc to edit the mpeg2 files
before I convert to avi :cool:
I am encoding at 4000kbps in mpeg 2 at 320x240, I then use dvd2avi to
seperate the mpa BUT I use Gordian Knot to encode directly to mp3, is there a problem with this? when I watched the avi video without the cuts, I noticed that it was in sync. I cut the avi segments out with nandub using the set beginning segment, set end segment, and delete frames commands listed under edit (I think)
my machine is 2ghz pentium 4 with 512 megabytes of ram, I have yet to encounter a capture where I have droped frames. thank you for the feedback I will come post here again if I have any problems recording Buffy.
please give me any further tips if necessary:cool:
droolian01
30th September 2002, 22:15
This is probably a crap suggestion but i would never edit a vbr containing avi for just this reason. I would suggest you convert to divx with .wav sound, then edit (in either vdub or nandub) out the commercials then convert the edited .wav to vbr mp3 and remux. More hasstle but i think this would garantie a perfectly synced avi.
Hope this is useful.
p.s. why not cap in huffuv - i do and i think the qualities better like that.
Swan
30th September 2002, 22:18
seperate the mpa BUT I use Gordian Knot to encode directly to mp3, is there a problem with this?
No, not at all. I just like to make a wave file because I want to to edit the audio (fade in and out, etc) before I encode it to mp3 and insert it back in the video, that's all. Also, you may notice that you won't always get the precision cuts you want in your Mpeg-file.
If you should notice this when you start editing in TMPGEnc now, here's a tip for the future captures you'll make with PowerVCR: set it to capture using I and P frames only. Encoding using just I-frames is the best when one wants to edit the file, but in my view, PowerVCR's i-frames only encoding looks bad. If you let it use at least 1 P-frame, the video will look great.
You often can not cut on the exact frame where you want to. This will cause that some unwanted audio at the cut points may come through. By exporting the mpa to wav, you can silence out the parts you don't want (not delete, just mute). Don't change the length of the file by the changes you make in the wave, though, or you'll get sync issues again. I don't think you're dumb or anything, I'm sure you understand this already. :)
my machine is 2ghz pentium 4 with 512 megabytes of ram, I have yet to encounter a capture where I have droped frames.
Great, I was just asking to make sure. These problems occur even when there are no frame drops. I just didn't want to give you false hope of fixing the sync issue, if indeed you had frame drops in your Mpeg-2 file. :)
/Swan
kempodragon
30th September 2002, 22:48
Here's my own method for keeping audio in synch.
1. Record in MPEG2 with ATI Radeon AIW. Use highest bitrate and resolution that won't drop frames. In my case 352x480, 29.97 frames/sec, 10 Mb/sec VBR. Audio is 224 kb/s, 44100 Hz. I could probably use 48 kHz, but my soundcard is only a SoundBlaster Live PCI card and I'm not sure it's up to the task. Operating system is Win2k so I don't have to worry about 4 gig limit.
2. Use Gordian Knot to create .d2v file and .mpa sound file. Convert .mpa to .wav with Winamp. Don't convert to mp3 just yet. Resize and crop as necessary and create avs file. Don't deinterlace or IVTC.
3. Audiodub the wav file with the video. Doom9's Mpeg2Dec frameserving guide explains how to do this. Check for any errors with preview function.
4. Open the avs in VirtualDub. Mark and delete the frames with commercials. Once all the commercials are deleted, check direct stream copy in the audio section and save the sound in a new wav file.
5. If you have enough disk space, save the video in a Huffyuv avi file. Create a new avs file and deinterlace or IVTC as needed. You don't need to add the audio in this file. By using an avs file, the color space is kept in yuv format. Open it in either Virtualdub or Nandub and compress the video. If you can't create a Huffyuv file, then save you settings, close the file and re-edit the original avs to strip out the audiodub function and activate the deinterlace or IVTC function. Reopen the avs, load your settings, and compress the video.
6. Now convert the wave file to an mp3. If you use Gordian Knot, the audio offset is 0ms.
7. Use Nandub to join audio and video. Result, perfect A/V synch. I recorded the Iron Chef France Battles this way, with over 1/2 an hour of commercials spread throughout the entire show.
bb
1st October 2002, 06:46
All this hassle just to capture and encode to DivX? You should really think about it again...
My recommendation: Drop PowerVCR, get the free VirtualDubVCR+Sync from www.virtualdub.net and capture in Huffyuv (free, lossless) or MJPEG (PicVideo recommended, no longer free, lossy, use quality 18 or 19). VirtualDub's multisegment capture will let you use FAT filesystem even for long captures, as it can split e.g. at 2GB, and it will treat the segments as one large AVI file when editing later on. No more synch issues, no more MPEG-2 incompatibilities, better quality. IMO MPEG-2 capturing is not for archiving, but for the capture-view-throw-away people.
bb
Swan
3rd October 2002, 11:55
Heres another tip: Capture with Ulead Videostudio instead. :)
I think PowerVCR is the guilty party of the audio and video going out of sync when editing the final Mpeg-2 video!
Yesterday I did a test. I captured one and a half hour (!) 90 minutes of video with VideoStudio. I used a resolution of 720 x 576, audio bitrate 384 (highest possible), video bitrate 9000, I-frames only, interlaced.
The final file size was 6.13 GB. After editing out the stuff I didn't want, I got 2 separate files, one 43 minutes long, 2.89 GB large and the second was 43 minutes, 2.86 GB large.
I chained these together with DVD2Avi and there were no sync issues whatsoever. Perfect sync. I have suspected that PowerVCR creates unstandard Mpeg-2 files for a while and now I am convinced.
Why have I suspected it? Well, running a bitrate check on the files reveals that the bitrate always is about 2000 below what i set. If I select a videobitrate of 10.000, it turns out the final file has about 8000. Also, M2-Edit pro's "DR. M" feature always tell me that the files I've captured with PowerVCR have time codes that are incorrect (only a few milliseconds every now and then, but even so..). Also, the manual says that the quality slider set to the highest level means the files will be encoded with CBR, but they're always VBR, no matter how you set the slider.
So, a hot tip from me is: Try Ulead VideoStudio and see if it wont help in your future captures. Or other Mpeg-2 capturing software titles. PowerVCR has the best timer and since the show I capture every night runs from 4 AM to 5 AM, I'm stuck with it. But as long as one cuts out the commercials and create separate Mpeg files and encode these to DivX separately too, the sync is always right.
/Swan
FreQi
7th October 2002, 07:32
I use AVI_IO for a capture program because you can set timers to capture while you're away. I capture to avi using the Huffyuv codec (I used to use mjpeg, but I capture at 640x480, so it's interlaced now and I don't want to loose any info in that. Keeps the image cleaner). AVI_IO captures the audio to WAV, and I just select the "CD Quality" setting.
All my editing is done using AVISynth. If you don't know what it is, you should check the AVISynth forum. There's a FAQ there. But, it's a scripting language that you use to do edits and all kinds of crazy alterations to the video/audio (I can show you some tricks if you want, but ask/look in the avisynth forum).
After I write the avisynth script, I open it in virtualdub and "Save WAV". This exports the audio with all the trimmings you did with avisynth. The wav gets encoded to an VBR MP3 using RazorLAME, and then I use NanDub's two-passes to encode the video, and "Direct Stream Copy" the VBR MP3. Never had a problem with sync.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.