Menu

#176 Delay between sound and video in capture mode

open
nobody
bug
2018-09-23
2018-09-21
Jos
No

Hi ! And thank you for your excellent job ! I thank VirtualDub was dead but it is now ressurected.
My request is a long-time known bug that - as far as I know - has never been solved since VirtualDub exists.
When you want to capture video from an analog source (-> File > Capture AVI), let's take for example a video captured with an analog capture USB stick, AND then you choose a video compression (Video > Compression), you always get a huge delay between the sound and the video. This doesn't happen when you choose "uncompressed RGB/YcBCr", but the file you get is way too big ! In fact, the software does not take into consideration the time needed to activate the video compression codec, and just superpose the sound on the "always late" video. And this delay is about 2 or 3 seconds. So you have a synchro issue.

Now you could tell that we can go to > Capture > Timing to fix this. But it just does not work. And you can choose to select or unselect any option you want, this won't change anything. I have spent hours to find the answer to this in every forum I could find, and the same question came back with no answer.
My last resort is to fix the delay with an AviSynth script (DelayAudio).

So you would be the savior of many people, me included, if you find a way to solve this !!
Many thanks again
Cheers

Discussion

  • Anton Shekhovtsov

    Thanks!
    Which compression codec do you mean? I'm aware of problem with delayed frames, for example x264 in typical setup can buffer many frames and this scenario is completely ignored in capture mode. I already tried to approach this problem and it does not look easy to fix.
    As far as I understand, the resulting video stream is also incomplete and may become pure mess with inserted frames (the defect is not just the delay).
    With x264 you may use "zero latency" option to eliminate delay.
    Not sure if you meant there is realtime delay on codec warmup, it can make things worse.

     
  • Anonymous

    Anonymous - 2018-09-22

    Thank you for your answer. I have tried all the 19 available codecs. They all have delay, except the first (uncompressed Rgb/YCbCr), and the huffyuv 2.1.1 (only a few miliseconds), all the others have at least 1sec delay, and the worse are x264 and x265 codecs with more than 2secs delay.
    BUT you were right, the "zero latency" option has elimanted delay for both x264 8bit and x264vfw codecs. I tried to enable this potion for FFMPEG/x265 codec, but haven't found it.
    But it works very well !! thank you

     
    • Anton Shekhovtsov

      Just uploaded new version, there FFMPEG/x265 has new option tune:zerolatency. Should work.
      "All codecs" does not make sense. Most often capture is used with lossless codecs: magicyuv, utvideo, lagarith... I never saw extensive tests but I believe these don't have any problems.

       
  • Jos

    Jos - 2018-09-23

    Excellent ! I just tried it. It works very well with FFMPEG x265. No latency at all. Thans a lot, you save me a lot of time.

    "All codecs" does not make sense.

    You are right.
    I am using VirtualDub2 to capture old VHS tapes with the following custom format : 720x576 with YUY2, which is the "standard" format for this kind of capture device. So I only see the list of 19 available codecs for the YUYV format.

    I prefer to encode them directly with x264 or x265 codecs, so I can give the files directly to my friends when the film does not need any restoration.

    I sometimes use lossless codecs for the most precious tapes that I plan to restore, but I get an error message with Logarith lossless :
    "Video compressor error : the source image is not accpetable (error code -2)"
    I changed the custom format for : 640x480 RGB 24 then 640x480 UYVY then 720x576 , and I still have the same error message with Logarith.
    So I use FFMPEG FFV1 lossless codec (about 260 MB for 1 min video), which works well
    or Utvideo YUV422 BT.709 VCM (about 280 MB for 1 min video).

    For an unknown reason , I also have hard time to "initialize" my capture card. If I first run VirtualDub2, I get a black screen with no sound despite the fact that VirtualDub sees my card (AverMedia EZcapture)
    I must first run the "Cyberlink Media Suite" provided with the USB key, start a capture, then close it. After all this the card finally works on VirtualDub. Strange !

     
    • Anton Shekhovtsov

      I get an error message with Logarith lossless :
      "Video compressor error : the source image is not accpetable (error code -2)"

      This is weird, show screenshots of compression dialog and lagarith settings.

      I also have hard time to "initialize" my capture card

      I have no idea. It may be something with settings (delete registry key to reset: HKEY_CURRENT_USER\Software\VirtualDub.org\VirtualDub\Capture\avermedia-whatever)

       

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB