Daily Archives: December 1, 2026

Add audio from one video file to another

Verify the original videos

Run this command for both original files:

ffprobe -v error \
    -show_entries stream=index,codec_type,codec_name,width,height,r_frame_rate,avg_frame_rate,duration:format=duration \
    -of default=noprint_wrappers=1 \
    "video1.mkv"

Convert the Danish audio speed

The exact conversion factor from 25 FPS to 23.976 FPS (24000/1001) is:

24000 / (1001 × 25) = 0.959040959

Extract and slow down the Danish audio:

ffmpeg -i "video1.mkv" \
    -map 0:a:0 \
    -af "atempo=0.959040959" \
    -c:a flac \
    "danish_audio.mka"

Combine the HD video and Danish audio

ffmpeg -i "video2.mkv" \
    -i "danish_audio.mka" \
    -map 0:v:0 \
    -map 1:a:0 \
    -c:v copy \
    -c:a copy \
    -metadata:s:a:0 language=dan \
    -metadata:s:a:0 title="Danish" \
    "movie_danish.mkv"

Adjust the audio synchronization

If the Danish audio needs to start 2.5 seconds later:

ffmpeg -i "video2.mkv" \
    -itsoffset 2.500 -i "danish_audio.mka" \
    -map 0:v:0 \
    -map 1:a:0 \
    -c copy \
    -metadata:s:a:0 language=dan \
    -metadata:s:a:0 title="Danish" \
    "movie_danish.mkv"

Calculate the exact speed using matching scenes

If the standard PAL conversion factor doesn’t work, you can calculate the correct factor manually using two identical scenes.

For example:

SceneVideo 1 (Danish)Video 2 (HD)
Scene A00:01:0000:01:10
Scene B01:01:0001:03:43.75
Elapsed time3600 seconds3753.75 seconds

Calculate:

Audio speed = elapsed time Video 1 / elapsed time Video 2

Audio speed = 3600 / 3753.75

Audio speed = 0.959040959

The advantage of this method is that any difference in the opening scenes is eliminated from the calculation.