Audio usually goes out of sync after merging for one of four reasons: a clip was recorded at a variable frame rate, a clip has no audio track so the sound after it slides earlier, the clips have different audio formats, or small timing differences in each clip add up. The symptom tells you which: sound that drifts gradually within a clip points to frame rate, while a sudden jump at one join points to that clip's sound.
Work out which kind of out of sync it is
| What you notice | Likely cause |
|---|---|
| In sync at the start of a clip, then gradually later or earlier | Variable frame rate (cause 1) |
| Fine until one join, then wrong by the same amount to the end | A clip with no sound before that point (cause 2) |
| From one clip on, sound at the wrong speed, garbled or missing | Different audio formats joined by copying (cause 3) |
| Each join a little worse than the last | Small offsets adding up (cause 4) |
| The same delay from start to finish | A fixed offset (see "Shifting all the sound") |
First, check it's really the file
Play the merged video in a different player, and on speakers rather than Bluetooth headphones. Bluetooth can add a delay of its own, and some players cope badly with slightly odd timestamps. VLC, which is free, is a good second opinion. If the video is in sync there, the file is fine and the problem is the playback.
Cause 1: variable frame rate
Phones, and many screen recorders, record at a variable frame rate (VFR). Instead of exactly 30 frames every second, they record frames as fast as conditions allow and stamp each one with its time. Players handle this well. Some editors and joining tools don't: they assume every frame lasts exactly 1/30 of a second, so the pictures slowly slide away from the sound, and the gap grows the longer the clip runs.
How to check: open the clip in MediaInfo (free for Windows, Mac and Linux). If it says Frame rate mode: Variable, this is a likely cause. Variable frame rate explained goes into more detail.
How to fix it: convert the clip to a constant frame rate before you merge it.
- HandBrake: open the clip, go to the Video tab, set Framerate (FPS) to the rate you want (or Same as source), choose Constant Framerate, and start the encode.
- FFmpeg:
ffmpeg -i phone-clip.mp4 -fps_mode cfr -r 30 -c:v libx264 -crf 18 -c:a copy phone-clip-cfr.mp4
-fps_mode cfr -r 30 makes exactly 30 frames per second, repeating or dropping frames where needed, while keeping each one at the time it was recorded. The sound is copied untouched, so it lines up again. -fps_mode arrived in FFmpeg 5.1; on older versions, use -vsync cfr instead.
Cause 2: a clip has no sound
Screen recordings without a microphone, timelapses, some drone and action-camera modes, and photos have no audio track at all. Joining tools that just copy each clip's sound one after another have nothing to put in that gap. For example, join a 3-second clip, a 2-second clip with no sound and a third clip with FFmpeg's concat demuxer and -c copy, and the third clip's sound plays straight after the first clip's: 2 seconds early, exactly the length of the silent clip. Every clip after a silent one is out by that much.
How to fix it: give each silent clip a silent audio track first, in the same format as your other clips:
ffmpeg -i silent-clip.mp4 -f lavfi -i anullsrc=r=48000:cl=stereo -c:v copy -c:a aac -shortest silent-clip-with-sound.mp4
anullsrc generates silence, -shortest stops it when the video ends, and the video is copied unchanged. Set r= (sample rate) and cl= (mono or stereo) to match your other clips. Then join as before. If you're using FFmpeg's concat filter instead, merging videos with FFmpeg shows how to add the silence inside the same command.
Cause 3: different audio formats
When clips are joined by copying rather than re-encoding, the finished file describes its sound once, using the first clip's settings. If a later clip's sound is different, such as 44.1 kHz mono after 48 kHz stereo, a player reads it with the wrong settings. The result can be sound that plays at the wrong speed or pitch, garbles, drops out, or ends early so that everything after it is out of step.
How to check: compare each clip's audio with MediaInfo (Format, Sampling rate, Channel(s)) or with ffprobe:
ffprobe -v error -select_streams a:0 -show_entries stream=codec_name,sample_rate,channels -of csv=p=0 clip.mp4
How to fix it: convert the odd clip's sound to match the rest, copying the video so it isn't re-encoded:
ffmpeg -i odd-clip.mp4 -c:v copy -c:a aac -ar 48000 -ac 2 -b:a 192k odd-clip-fixed.mp4
Or use a tool that re-encodes everything as it merges. FFmpeg's concat filter, for example, converts all the sound to a common format by itself.
Cause 4: small offsets that add up
A clip's sound rarely ends at exactly the same moment as its picture. AAC sound, for instance, comes in blocks of 1,024 samples, about 21 milliseconds each at 48 kHz, so a clip's sound might run a few milliseconds longer or shorter than its video. Some cameras also start recording sound a fraction after the picture.
That's harmless within one clip. It becomes a problem when a tool joins all the pictures into one track and all the sound into another, separately. Each clip's tiny difference then carries over to the next, and over dozens of clips, a few tens of milliseconds each adds up to an offset you can see.
How to fix it: use a method that joins each clip's picture and sound together and re-aligns them at the start of every clip. FFmpeg's concat filter does this when each segment has its video and audio side by side, as in [0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1, rather than joining all the video and all the audio in two separate steps. It also pads a clip's sound with silence when it's shorter than the video.
Shifting all the sound
If the delay is the same all the way through, shift the whole soundtrack. First find the amount: VLC's Track Synchronization window (in the Tools menu on Windows) lets you adjust the audio delay while you watch until it looks right.
Then, if the sound comes too late, delay the picture to match:
ffmpeg -itsoffset 0.3 -i merged.mp4 -i merged.mp4 -map 0:v -map 1:a -c copy fixed.mp4
If the sound comes too early, delay the sound instead:
ffmpeg -i merged.mp4 -itsoffset 0.3 -i merged.mp4 -map 0:v -map 1:a -c copy fixed.mp4
-itsoffset shifts the input that follows it by the given number of seconds. The command reads the same file twice, takes the picture from one copy and the sound from the other, and copies both without re-encoding.
How ClipMerge handles sound
ClipMerge keeps each clip's own sound and starts it with that clip. Photos and clips without sound get silence for their full length, so a silent clip can't shift the sound of the clips after it. Sound recorded at different sample rates is converted to one. It re-encodes everything as it merges, so the copy-join problems in causes 2 and 3 don't arise. If a clip's sound can't be decoded in your browser, for example some camcorder Dolby Digital tracks, it's converted on your device first; why a video has no sound explains that format problem.
Prevent it next time
- Check every clip before you merge. Look for Variable frame rate, missing audio and mismatched sample rates in MediaInfo.
- Fix clips one at a time, then join. It's much easier to find the bad clip on its own than in a 20-minute merged video.
- Watch the joins. Skip to a few seconds before each join in the merged file and check a clap, a word or a footstep lines up. If frame rates differ too, merging videos with different frame rates explains what conversion does to the picture.