VideoHelp Forum




+ Reply to Thread
Results 1 to 30 of 30
  1. Hello,

    I need to know what you guys do to edit out commercials of captured video in avi format. I use virtualdub and/or iuVCR to do the capturing either off of TV or off VHS. When I capture, everything is in sync. I try and edit out commercials in virtualdub using the marker tags where you specify a start and an end point for each spot on the video you want erased, then I hit delete. When I play it back in vdub, the audio is out of sync. When I try to frameserve it the way it is to TMPGEnc the audio is still out of sync. Is there a way to edit out commercials out of a captured avi file? I'm using PicVideo Jpeg codec to capture and I set the audio to the highest PCM 172kb/s. I thought I figured out how to do all of this awhile back, but cannot get it to work the way I thought I did it. I want to edit out the commercials, then frameserve the avi to TMPGEnc to encode it to the format I want it to be in.

    I might have done something along these lines: edit out commercials, then set video to direct stream copy, audio to full processing mode, then frameserver to TMPGEnc and make sure that do not framerate convert box is checked in tmpgenc. Any help would be appreciated. Thank you
    Quote Quote  
  2. Member
    Join Date
    Jul 2003
    Location
    Madison Wisconsin
    Search Comp PM
    This is interesting to me, too. I have assumed that
    framserving TMPEGEnc with AviSynth would work.
    There is a function in the AVIsynth script called
    "alignedSplice" that is supposed to:

    "AlignedSplice cuts off the first sound track or inserts
    silence as necessary to ensure that the second sound track
    remains synchronized with the video."

    So I plan to put the following:

    Trim(0,200) ++ Trim(300,500) ++ .....

    ...as necessary to copy the non-commercial portions of the
    video. Have you tried such a thing?
    Quote Quote  
  3. I haven't tried that. I'm not familiar with AviSynth, I've never used it before. I thought there was a way to do it within vdub as I have done it before and got perfect results. I would just capture to raw avi, but I don't have the drive space to do it. Did your AviSynth routine work for you?
    Quote Quote  
  4. Member
    Join Date
    Jul 2003
    Location
    Madison Wisconsin
    Search Comp PM
    Did it work for me???? Good question. It is currently
    working. It has been encoding for 6.9 hours and has
    a half-hour to go. Moreover, it is a doumentary with
    very old film footage and a off-screen narator....so
    I am not sure that I will be able to tell whether it is
    in synch or not! I will let you know in 40 minutes or so.
    Quote Quote  
  5. Member
    Join Date
    Mar 2003
    Location
    Uranus
    Search Comp PM
    You need to see if you have dropped frames in the AVI
    with Vdub. Edit>Next Drop Frame.
    If have lots and lots it may be difficult. (not impossibe)

    If not, you may have a fixed offset. I always have a 650 ms
    early audio with PicVideo Mjpeg.
    If so you can adjust the audio in Vdub before you serve it to the encoder.
    Audio->Interleaving->delay Audio By...
    Play with this number till it's in sync.
    Make sure you check at beginning AND end of the video.

    If you have lotsa driopped frames you have my most hated problem
    the fix is...
    1. save the audio to wave with Vdub
    2. delete all the dropped frames (there is an automated way)
    3. frameserve that to ANOTHER instance of Vdub
    and import the previously saved wav.

    You are now in sync.
    Quote Quote  
  6. Member
    Join Date
    Jul 2003
    Location
    Madison Wisconsin
    Search Comp PM
    Sorry. There are some interviews in the first segment
    that provide an indication of 'synchness'. But the last
    two segments have no such clues. All the voice is off-
    camera. It is certainly not grossly out-of-synch.....like
    one of my efforts that was 20 seconds off! (Even that
    was not noticeable to the casual observer.)

    This is one reason I wanted to see if you had tried this
    and if it had worked for you. This synch business is a
    terrible problem to diagnose and repair. I even wrote
    my own MPEG-2 decoder to see what was going on.

    I cannot disagree with the the notion that dropped frames
    cause this problem. But I don't understand it. If the
    original recording plays in perfect synch then it seems to me
    that the editor should be able to cut and splice it without
    losing that precious synchronization. At any rate, let me
    know if you do try it (and the results) and I will let you know
    if I try it with some other material that is more appropriate
    for such a test.
    Quote Quote  
  7. Member
    Join Date
    Mar 2003
    Location
    Uranus
    Search Comp PM
    I didn't notice that the original capture was in sync.
    The dropped frames thing results in the capture out of sync
    to start with.
    I don't believe I've seen an AVI go from in sync to out
    just from deleting sections.
    Definitely a mystery.

    Tell us if you find out
    Quote Quote  
  8. I didn't have any dropped frames and vdub said everything was okay. The original video was in sync too. Like I said, I was curious as to how everyone edits out their commericals for the videos that they make.
    Quote Quote  
  9. Save the audio as a WAV file. Open the AVI and the seperate WAV file, check for synch in Vdub. If this plays OK, then edit and frameserve it. If not, you got a problem with the original capture.

    The seperate WAV file approach has always worked to maintain synch for me as long as the file is valid. If I understand it correctly, what this does is remove any time cues from the original file (I think it is only interleaving) and simply plays the two files from start to finish. I have had files which did NOT synch until the audio was seperated this way.
    Quote Quote  
  10. Member
    Join Date
    Jan 2003
    Location
    India
    Search Comp PM
    Set both video and audio to direct stream copy
    Quote Quote  
  11. Nelson,

    I'm not sure what you mean by open the separate avi and wav file and check for sync in vdub. I can open the original file with the audio/video in it and then use vdub to save the audio only as a wave file. AFter that I don't know how to open the wav and avi file in vdub and how to check for sync? Could you walk me through how to do this please? Thanks.
    Quote Quote  
  12. Go to AVI, Audio, WAV Audio. Select your WAV file. Play and check for synch, make sure to skip to near the end and check for synch here. Do this by playing the movie and visually checking speech versus lip movements. You may need to frameserve (after editing) and encode, and then play the resulting MPG. Make sure and try several players as some will de-synch a file which will play fine in a DVD player. I find WinDVD gives best results.
    Quote Quote  
  13. Strange.

    Just for info this is my chain for processing.

    DC10+ { hardware MJPeg encoder card }
    AVI_IO { Set up for 640x480 for DVD
    or 320x240 for VCD but either with 44.1khz Stereo Audio }
    virtualdub { Strings the parts together }
    Tmpeg { compressor }
    { Use the range to cut into segments minus ad's or
    the cutter abblity to egnore segments I dont need }

    OR

    DC10+ { hardware MJPeg encoder card }
    AVI_IO { Set up for 640x480 for DVD
    or 320x240 for VCD but either with 44.1khz Stereo Audio }
    Tmpeg { compressor with load segment on }
    { Use the range to cut into segments minus ad's or
    the cutter to egnore segments I dont need }

    Have no problems with audio at all and even takes care of the 71 minute bug from the DC10+ card.
    Quote Quote  
  14. The approach I use is idiosyncratic but it completely avoids problems with audio/video sync and AVI editing.
    When I capture from TV I run TMPG on each segment ussisng the "source" settings to start MPEG-2 encoding and end it at the right points to eliminate commercials.
    Then, once each of hte segments of hte TV program have been
    encoded to MPEG-2 I just stich 'em all together using TMPG's
    "ADD" function under MPEG TOOLS. I also include 1 seconds of
    TMPG-encoded video black at the start and end of hte TV episode.
    You can do the same thing with M2-edit pro if you want to use
    a high-end tool.
    I have encoutnered no audio/video sync problems using this
    method and I don't have to wait hours to write the edited AVI
    file back to the hard disk either. No one has ever had a problem
    playing the DVDs created using this stich-together method with
    the encoded MPEG-2 files.
    Quote Quote  
  15. Thanks for all the suggestions.

    Foo - I'm using iuVCR to capture and I always get a "video stream latency" number of about 120ms or so. I am assuming this means that the video is running behind, or in essence the audio is ahead of the video? Not sure. I tried using that offset number of whatever it comes up as in iuVcr and putting it the audio skew correction in vdub. Seems to work okay, but not perfect sync.

    I also noticed that I did not drop any frames on the capture, however when I go into vdub and click on "find next dropped frame", it finds some right where the commericals are, like where I originally stopped the recording on the vcr and then started it again when the commercials were over with as I was recording the show.

    The thing is though, that I am editing out commercials with vdub so all these bad spots get deleted anyways, so they are history, right?

    When I view the file info in vdub for either the original capture file or the one where I edited out the commercials, I notice that the audio and video times do not match up. The audio goes something like 22:40:39s and the video stream would be 22:40.69s. For something to be in sync, do these times have to be equal?

    Under the video tab in vdub there's an option to change the framerate so that audio and video durations match. The number that is there in fps is slightly higher than 29.97. I don't want to change the framerate because I want to frameserve this to TMPGEnc for a SVCD encode. When I do use TMPGEnc, I always check the box that says "do not framerate convert".

    One last thing, I even tried stretching the audio (wav) to = the exact time of the video portion. I'm not sure if that was a good idea or not. Then in vdub I use the avi file and the newly strecthed wav and then I check the file info and the times match and also in the video area for "change framerate so audio and video durations match", the fps is 29.97 just like the no change option which is also 29.97.

    It seems like I've done so much yet still confused on exaclty what is the right thing. Any other insights would be helpful, thank you for the long read. :)
    Quote Quote  
  16. Member
    Join Date
    Mar 2003
    Location
    Uranus
    Search Comp PM
    If there was a 300 ms latency in the Audio you could be in sync
    and have different times..

    Ok when I get the No Dropped Frames from the capture App and
    I find dropped frames in the file it's bad news. My capture App
    is duplicating frames without duplicating the audio. In other words
    all the D frames are spurious and are exact copies of the previous
    frame. This makes more Video than audio, and it's out of sync.
    I don't understand why the hell it does that !

    It sucks because if you delete the D frames in Vdub, it gets some audio
    too, which we don't want.

    You may not have the same problem as me.
    If you just have an offset problem - you set an offset on the audio
    in Vdub and try it until it works
    Quote Quote  
  17. Glad to hear from you. :-)

    I tried this suggestion of yours:

    "If you have lotsa driopped frames you have my most hated problem
    the fix is...
    1. save the audio to wave with Vdub
    2. delete all the dropped frames (there is an automated way)
    3. frameserve that to ANOTHER instance of Vdub
    and import the previously saved wav.

    You are now in sync."

    I deleted maybe about 20 frames that were dropped, but according to ivVCR, no frames were dropped. You said there was an automated way to delete dropped frames? Easier than doing them one at a time I am sure, that's what I did.

    I then followed your instructions and saved the audio to a wav file. Instead of frameserving the capture, I just saved it with no audio (was that ok?) then I opened that up in vdub and used the saved wav file as the audio source. Everything was in sync until the first commercial area where the stop and start record went on, that's where the dropped frames were found and I deleted. After that point, the audio seems to run way ahead of the video stream. Unless I did something wrong, I thought they were going to sync up.

    I may just be able to use the audio skew offset to fix everything like I described before, seems a lot easier. I thought there would be a cut and dry way to get it right for once.
    Quote Quote  
  18. Member
    Join Date
    Dec 2002
    Location
    United States
    Search Comp PM
    Originally Posted by Paul Stevens
    So I plan to put the following:

    Trim(0,200) ++ Trim(300,500) ++ .....

    ...as necessary to copy the non-commercial portions of the
    video. Have you tried such a thing?
    I use the above technique all the time. I use Vdub to get the frame numbers then paste them into the AVISynth script (vdub even lets you highlight and copy the frame number from the status line). Then I load the AVISynth script into TMPGEnc and encode. I've never had any audio sync problems doing this, though I use a Canopus ADVC-100 for capture so I am usually working from a source with no dropped frames and locked audio sync.
    Quote Quote  
  19. Member
    Join Date
    Mar 2003
    Location
    Uranus
    Search Comp PM
    You have to save the audio to a wav BEFORE you delete
    any frames. Deleting frames in Vdub deletes a frame worth
    of audio too.
    What we are trying to do here is delete frames WITHOUT deleting any audio.
    Thats why you save the audio first

    You might verify this is really your problem by checking to see if
    the frame right before the D frame is identical to the D frame.

    The automated method consists of an Avisynth script that
    compares adjacent frames and logs the frame number to a text file
    if they are identical
    This text file is then converted into another AVS with millions of
    DeletFrame( whatever ) lines in it
    The conversion is done with a UNIX utility - AWK

    Here is the compare script...
    # Spit out a log of the differences between adjacent frames

    avisource( "Shogun6.avi" )

    v2 = trim( last, 1,0 ) # V2 is source offset by 1

    Compare(last, v2, "", "compare.log", true)

    Here is the AWK script... "If field 2 is 0 then delete frame in filed 1"
    $2 == 0 {print "DeleteFrame( " $1 " )" "\r" }

    Hers is a typical "delete" AVS

    avisource( "shogun6.avi" )
    killaudio()

    DeleteFrame( 230356 )
    DeleteFrame( 230348 )
    DeleteFrame( 230318 )
    DeleteFrame( 230288 )
    DeleteFrame( 230258 )
    ... etc ...

    Note frames are deleted backwards because frame numbers after a deleted frame change
    Quote Quote  
  20. I did what you said, saving the wav file out before deleting bad frames or doing any editing. Towards the end it seemed to push the audio way ahead.

    This is a very frustrating problem as I am sure you feel my pain.

    One thing I did notice, what's causing the dropped frames is where the vcr did the stop and start record. That's where the issue lies.

    I have a 30 minute show, 2 commercial breaks which I stopped and started record on when I taped the show originally. So there is like 15 seconds of commercial junk on each segment.

    If I put 250ms in the audio skew, the first segment before the first commercial is in sync and looks good. However, I can't use that number for the whole show because it doesn't match up the audio after the commercial area and continuing to the end of the show. For the rest I can use -250ms and it will set everything up right. The problem is that I can't use one number for the whole show.

    I had an idea I am going to try, pain in the butt, but I will try it. I will just capture up the the commercial break being sure not to capture where those dropped frames result. Then capture again the rest of the show. So I will have 3 segments that I can edit and then join together with vdub. Then I can use a number to skew the audio if needs be and hopefully that will produce an in sync show, I hope! If it works then I can just frameserve it to TMPGEnc.
    Quote Quote  
  21. Member
    Join Date
    May 2002
    Location
    louisville,ky
    Search Comp PM
    take your original avi load into vd then select video...frame rate and select audio video duration match. then select direct stream copy and resave the new avi then see if its in sync
    Quote Quote  
  22. Member
    Join Date
    Feb 2002
    Location
    Clearwater, FL USA
    Search Comp PM
    Hiflyact worte:
    I need to know what you guys do to edit out commercials of captured video in avi format.
    1) Capture the video with Ulead Videostudio 7.
    2) At the begining of a commercial cut the video with the scissors icon.
    3) At the end of a commercial cut the video with the scissors icon.
    4) Delete the unwanted commercials between the cuts then encode to your format of choice.

    Couldn't be simpler.

    I'm not throwing any flames at anyone nor am I wanting to start a war but I must say some of the convoluted techniques that I read sometimes makes me just want to sandpaper my eyeballs.
    Evil flourishes when good men do nothing.
    Quote Quote  
  23. DRfrankenpimp - I did what you suggested and everything is in sync. The original options with the original file were keep framerate the same: 29.97 or change so audio/video durations match:29.976fps. Since the framerate is not exactly 29.97, what should I do about frameserving it? Should I leave the box that says "do not framrate convert" in TMPGEnc checked? Will TMPGEnc convert it to 29.97 for the format that I want to put it in?

    Thank You
    Quote Quote  
  24. Member
    Join Date
    Mar 2003
    Location
    Uranus
    Search Comp PM
    Mr Spicuzza
    You obviously have absolutely no clue about what we
    are talking about here. Do you really think we are
    so stupid as to be unable to operate a simple video editor ?
    Or do you think VS7 can magically capture from problem
    VHS tapes using any random capture card without error.
    In any case we already have the captures and want to fix them.

    What we have here is two different forms of
    Audio / Video desynchronization. I have figured out how
    to deal with my problem, now we need to fix hiflyacts' problem.
    Quote Quote  
  25. Member
    Join Date
    May 2002
    Location
    louisville,ky
    Search Comp PM
    you want to sync audio before any edits i never have sync problems when i do it that way however when i convert my avi to vcd or dvd i do not frame serve i just load into TMPGEnc and encode but when i load this avi in with an altered frame rate say 29.968 instead of 29.975 it encodes with audio in sync.it must compensate some where for the altered frame rate.try it with out the "do not frame rate conversion" i never check it.i have a method of editing out comercials with virtual dub and resaving the avi as one new movie and encoding to vcd.it allways works perfect for me once you get the hang of syncing it easy from there
    Quote Quote  
  26. Member dcsos's Avatar
    Join Date
    Jan 2003
    Location
    Y No Werk (anagram)
    Search Comp PM
    I agree with Spicuzza

    If you have your AVI in synce from capture, what would cause you to submit it to one of these FREEWARE programs that require sub setting to keep it in SYNC.
    While I wouldn't agree to choose ULEAD,
    I can cut out commercials from HUFFY or other AVI MJEG captures easily by editing in any one of the following aplications without loss of sync

    Premiere, Vegas Video, Procoder, Speed Racer
    or tier 2
    Video Wave, Dazzle Main Actor, Pinnacle or the Ulead Product

    this is why I would need more persuasion from you guys to use VDUB or TMPG for these tasks
    Quote Quote  
  27. Member
    Join Date
    Mar 2003
    Location
    Uranus
    Search Comp PM
    You guys just don't get it. The AVI is NOT in sync.
    Apparently some people can't comprehend that.
    It is a very common problem and there are lots of causes.
    Check out the frequency of posts about it.
    Quote Quote  
  28. Member
    Join Date
    Feb 2002
    Location
    Clearwater, FL USA
    Search Comp PM
    Hiflyact wrote:
    When I capture, everything is in sync.
    Foo wrote:
    You guys just don't get it. The AVI is NOT in sync.
    Foo, I don't know where you are getting that statement. The original poster clearly stated, "When I capture, everything is in sync."

    It is abundantly clear that his problem isn't with HIS captures but with the editing out of the commercials. Obviously the programs that he is using for that task are what is causing his sync problem.

    I totally agree with your statement, "You obviously have absolutely no clue about what we are talking about here." You are correct since I don't have sync issues. Anyway, I'll stand by my earlier comments, "I'm not throwing any flames at anyone nor am I wanting to start a war but I must say some of the convoluted techniques that I read sometimes makes me just want to sandpaper my eyeballs."

    Excuse me now I have to go to Home Depot to get some 100 grit sandpaper for my eyeballs.
    It always feels so good when I stop!!!!
    Evil flourishes when good men do nothing.
    Quote Quote  
  29. Alright guys, let's not fight about this. It's a frustrating enough problem dealing with sync issues.

    Here's what I tried today. I re-captured the show. I did it in 3 segments. I stopped the cap before the part where the vcr did it's stop/start record, so I would avoid those dropped frames. I ended up with 3 perfect segments with no dropped frames. I then noted the video stream latency number for each segment when it recorded. I didn't put these values in for the audio skew correction for each segment, but I wanted to try it without skewing it. So I then brought each segment into vdub, editing out the snips of commercials and then saved them to a new file. Then I brought the first file into vdub, and then appended the 2nd and then the third and saved it as one file. Seems to be just about perfect even has the exact 29.97fps rate. I will also try it with entering the video stream latency numbers in the audio skew for each segment and then putting it together as one file as see if that improves it anymore. I'll keep you all posted, thanks.
    Quote Quote  
  30. As a follow up post, here is what I did. Did a whole new capture of a show off TV in iuVCR. I noted the video stream latency number 165ms). I used the master stream set to audio and I chose sync using stream offset. I brought it into vdub and viewed and noticed the audio was a little off, so I put in the -165ms in the audio skew correction. I edited the show and made a sample video of it. It's just about perfect to me. The thing with iuVCr is with each capture, the video stream latency will change. For me, it's usually between 100ms and 165ms. Maybe using this number the way I do to skew the audio into correct sync isn't what it was designed for, but none the less, it worked. I will continue to try this method and post my results.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!