Prompt
Why is the output audio out of sync after transcoding?
Latest observation
Sep 30, 2026
OpenAI APIWeb search: off
Audio can end up out of sync after transcoding for a few common reasons:
-
Different timestamps / timebases
- The source file may have irregular or non-standard timestamps.
- During transcoding, the encoder/container may rewrite timestamps slightly differently, causing drift.
-
Variable frame rate video
- If the input video is VFR and the output is forced to CFR (or vice versa), audio/video timing can shift.
-
Audio resampling or codec delay
- Some audio codecs add encoder delay or padding.
- If that delay isn’t handled correctly, audio can start too early or too late.
-
Dropped or duplicated frames
- If video frames are dropped, duplicated, or reordered during conversion, the video duration changes relative to audio.
-
Container mismatch
- Sometimes the audio stream is fine, but the output container has incorrect metadata or timestamps, making playback appear out of sync.
-
Bad source media
- The original file may already have sync issues, and transcoding just makes them more obvious.
Typical fixes
- Preserve timestamps carefully during transcoding.
- Use proper audio delay compensation if needed.
- If working with VFR input, try to keep it VFR or convert both streams consistently.
- Remux instead of re-encoding if possible.
- Use tools like
ffmpegoptions such as:-vsync-af aresample=async=1-fflags +genpts-avoid_negative_ts make_zero
If you want, I can help diagnose it with your exact ffmpeg command and media info.
Brands