Fix Audio Sync When Converting VOBs with FFmpeg
Converting VOB files with FFmpeg often results in audio and video drift due to non-continuous presentation timestamps (PTS), dropped frames, and multiplexing quirks inherent to DVD media. To eliminate this desynchronization, FFmpeg provides specific timestamp regeneration flags and synchronization filters that force the audio and video streams to stay aligned throughout the conversion process.
The Recommended Command
To convert a VOB file while maintaining perfect synchronization, use the following command structure:
ffmpeg -fflags +genpts -i input.vob -vf "fps=source_fps" -af "aresample=async=1000:min_hard_comp=0.100000:first_pts=0" -c:v libx264 -crf 18 -c:a aac -b:a 192k output.mp4Essential Command-Line Arguments Explained
-fflags +genpts: This must be placed before the input file (-i). VOB files frequently contain broken, duplicated, or missing timestamps. This flag forces FFmpeg to regenerate missing presentation timestamps based on packet headers, preventing the video stream from interpreting time jumps as frozen frames.-af "aresample=async=1000:first_pts=0": This audio filter is the primary tool for correcting drift.async=1000stretches or squeezes the audio dynamically by up to 1,000 samples per second to match timestamp shifts. If the discrepancy exceeds this threshold, it inserts silence or trims audio samples to realign the track.first_pts=0ensures that the audio starts at the exact same zero-timestamp as the video, eliminating initial delay offsets often embedded in DVD audio tracks.
-fps_mode cfr(or-vsync cfr): Forces constant frame rate output. If the input VOB has timestamp gaps, this argument duplicates or drops video frames to match the declared frame rate rather than letting the video play faster or slower than the audio track.
Handling Multiple VOB Files Correctly
A major cause of audio desync occurs when concatenating consecutive
VOB files (e.g., VTS_01_1.VOB, VTS_01_2.VOB).
Joining them individually without handling timestamp continuity causes
the audio to drift at each file boundary.
To prevent boundary desync, concatenate the raw byte streams before processing rather than using the standard FFmpeg concat demuxer:
cat VTS_01_1.VOB VTS_01_2.VOB VTS_01_3.VOB | ffmpeg -fflags +genpts -i - -af "aresample=async=1000:first_pts=0" -c:v libx264 -c:a aac output.mp4On Windows, use the equivalent binary append syntax:
copy /b VTS_01_1.VOB + VTS_01_2.VOB + VTS_01_3.VOB combined.vob
ffmpeg -fflags +genpts -i combined.vob -af "aresample=async=1000:first_pts=0" -c:v libx264 -c:a aac output.mp4Combining -fflags +genpts on the input with the
aresample audio filter guarantees that both video and audio
streams share an identical timeline, regardless of defects in the
original DVD source.