Monday, April 11, 2011

Fraps, Vegas, x264vfw codec and Audio/Video Sync Issues FIXED

Trying out various solutions to find a fix for a audio video sync issue when using the x264vfw codec on fraps footage. I Used Sony Vegas Movie Studio to compress/encode the video but it would also have the audio start and then the video would lag behind 1-3 seconds and be out of sync with the audio.

Here's the description of the problem:

Video and audio are IN sync in fraps raw footage (everything's fine).

Encoding in Virtualdub a/v is in sync. (all good so far)

Encoding in anything else video and audio are out of sync after encoding. Audio plays about 1-2.5 secs before video starts. (bad playback locally using Media Player Classic Home Cinema).

Problem is the setting "Zero Latency" from the x264vfw codec settings. That needs to be checked to fix the problem. (Unchecked the problem occurs during local playback on media player classic).

To note: even if the local playback is out of sync, when uploaded to youtube the video and audio will be back in sync from youtube's processing.

Remember to CHECK Zero Latency option in x264vfw codec settings to avoid this out of sync issue when encoding using Sony Vegas or any other compressor besides VirtualDub (which didn't have this problem).

It took a long time for me to find that fix because most of the stuff about out of sync audio out there is about a slow drift off problem (which I didn't have) instead of this immediate a/v sync problem. So maybe this will help if you're recording with fraps and encoding with x264vfw.

13 comments:

  1. I stumbled across your post. I use Corel Video Studio v12 and this audio leading problem has been dogging my x264 encoding effort.

    I followed your instructions, and in addition, I encode the audio data using MP3 constant bit rate (CBR) instead of variable/arbitrary bitrate (VBR/ABR).

    As soon as I put these two settings in combination, the video and audio sync was working flawlessly again. Now I can throw away my Xvid codec! :)

    Thank you very much for your help.

    ReplyDelete
  2. @penguino, I'm glad it helped. It was a frustrating few hours tracking this obscure setting down.

    ReplyDelete
  3. Sweet! Thanks dude! :D

    ReplyDelete
  4. Thanks a lot! Worked perfectly.

    ReplyDelete
  5. Where can i find that setting?

    ReplyDelete
    Replies
    1. Shortcuts are created in your start menu pointing to x264vfw configuration depending on where you installed it. If you installed here you can just copy and paste into a run dialog.

      32 bit:
      C:\Windows\SysWOW64\rundll32.exe x264vfw.dll,Configure
      64 bit:
      C:\Windows\System32\rundll32.exe x264vfw64.dll,Configure

      Delete
    2. Ricky, thanks for researching all of this. Worked perfectly! Why that is even an unchecked option is beside me.....

      Delete
  6. Thanks for posting this. Worked like a charm!

    ReplyDelete
  7. BIG Thanks, it still works with Movie Studio 13.0... after 3 years

    ReplyDelete
  8. This article saved me too. I wouldn't have figured it out. Thanks!

    ReplyDelete
  9. 7 years later, this blog post is still solving issues. Thanks!

    ReplyDelete
    Replies
    1. Glad to know it is still working! HA! I had to use my old video encoding settings since I haven't used it much last month and sure enough they still worked! Thanks!

      Delete