{"id":1096,"date":"2026-12-01T22:14:15","date_gmt":"2026-12-01T20:14:15","guid":{"rendered":"https:\/\/jakobsens.net\/?p=1096"},"modified":"2026-12-01T22:14:15","modified_gmt":"2026-12-01T20:14:15","slug":"add-audio-from-one-video-file-to-another","status":"publish","type":"post","link":"https:\/\/jakobsens.net\/?p=1096","title":{"rendered":"Add audio from one video file to another"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Verify the original videos<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run this command for both original files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ffprobe -v error \\\n    -show_entries stream=index,codec_type,codec_name,width,height,r_frame_rate,avg_frame_rate,duration:format=duration \\\n    -of default=noprint_wrappers=1 \\\n    \"video1.mkv\"<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Convert the Danish audio speed<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The exact conversion factor from 25 FPS to 23.976 FPS (24000\/1001) is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>24000 \/ (1001 \u00d7 25) = 0.959040959<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Extract and slow down the Danish audio:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ffmpeg -i \"video1.mkv\" \\\n    -map 0:a:0 \\\n    -af \"atempo=0.959040959\" \\\n    -c:a flac \\\n    \"danish_audio.mka\"<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Combine the HD video and Danish audio<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>ffmpeg -i \"video2.mkv\" \\\n    -i \"danish_audio.mka\" \\\n    -map 0:v:0 \\\n    -map 1:a:0 \\\n    -c:v copy \\\n    -c:a copy \\\n    -metadata:s:a:0 language=dan \\\n    -metadata:s:a:0 title=\"Danish\" \\\n    \"movie_danish.mkv\"<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Adjust the audio synchronization<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If the Danish audio needs to start 2.5 seconds later:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ffmpeg -i \"video2.mkv\" \\\n    -itsoffset 2.500 -i \"danish_audio.mka\" \\\n    -map 0:v:0 \\\n    -map 1:a:0 \\\n    -c copy \\\n    -metadata:s:a:0 language=dan \\\n    -metadata:s:a:0 title=\"Danish\" \\\n    \"movie_danish.mkv\"<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Calculate the exact speed using matching scenes<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If the standard PAL conversion factor doesn&#8217;t work, you can calculate the correct factor manually using two identical scenes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Scene<\/th><th>Video 1 (Danish)<\/th><th>Video 2 (HD)<\/th><\/tr><\/thead><tbody><tr><td>Scene A<\/td><td>00:01:00<\/td><td>00:01:10<\/td><\/tr><tr><td>Scene B<\/td><td>01:01:00<\/td><td>01:03:43.75<\/td><\/tr><tr><td>Elapsed time<\/td><td>3600 seconds<\/td><td>3753.75 seconds<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Calculate:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Audio speed = elapsed time Video 1 \/ elapsed time Video 2\n\nAudio speed = 3600 \/ 3753.75\n\nAudio speed = 0.959040959<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The advantage of this method is that any difference in the opening scenes is eliminated from the calculation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Verify the original videos Run this command for both original files: Convert the Danish audio speed The exact conversion factor from 25 FPS to 23.976 FPS (24000\/1001) is: Extract and slow down the Danish audio: Combine the HD video and Danish audio Adjust the audio synchronization If the Danish audio needs to start 2.5 seconds [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1096","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/jakobsens.net\/index.php?rest_route=\/wp\/v2\/posts\/1096","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jakobsens.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jakobsens.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jakobsens.net\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/jakobsens.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1096"}],"version-history":[{"count":2,"href":"https:\/\/jakobsens.net\/index.php?rest_route=\/wp\/v2\/posts\/1096\/revisions"}],"predecessor-version":[{"id":1098,"href":"https:\/\/jakobsens.net\/index.php?rest_route=\/wp\/v2\/posts\/1096\/revisions\/1098"}],"wp:attachment":[{"href":"https:\/\/jakobsens.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jakobsens.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jakobsens.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}