whyjae.blogg.se

Ffmpeg copy audio and replace
Ffmpeg copy audio and replace











ffmpeg copy audio and replace

I left it as "mp4" container in this example but you can use raw aac e.g. copy audio from 10:00 minutes start time, for 1 minute, 5 seconds duration (until 11 minute, 5 second, playing time)Ĭode:ffmpeg -i input.mkv -vn -acodec copy -ss 00:10:00 -t 00:01:05 output.mp4

ffmpeg copy audio and replace

Use -ss for start time (in hh:mm: ss.ms notation), and -t for durationĮ.g. To extract audio from an input video file using ffmpeg, use: ffmpeg -i input-video-file output-audio-file. If you leave it in the mkv, this will keep the timecodes. Some mkv's have variable frame rate, and that can cause some programs to give you the running time discrepancies. ffmpeg -i v.mp4 -i a.wav -MAGIC video-new.mp4 This is very similar to How to replace an audio stream in a video file with multiple audio streams but that question handles multiple audio tracks, which complicates it very much, making it unclear which part of the solution is enough for a simple audio swap. Don't demux from the original mkv container. You can cut (copy) it accurately with ffmpeg. So I was thinking of copying the audio from the logo of File-A.mkv and copy it instead of the audio of the File-B.mkv's logo. (the rest of the audio is fine, but the logo part not) Both MKV files have a logo, but these logos are different (the sound too). I tried to just demux one audio track to mux it with the other MKV file with a slight delay to have it synchronized, however, the result isn't very satisfying. What I want is take the audio from File-B.mkv and add it to File-A.mkv. I have two MKV files (let's say File-A.mkv and File-B.mkv) which are the same thing but in different languages.













Ffmpeg copy audio and replace