How do I replace the audio in an MP4 file without re-encoding?
--------------------------------------------------
Become or hire the top 3% of the developers on Toptal https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Horror Game Menu Looping
--
Chapters
00:00 Question
00:47 Accepted answer (Score 46)
01:13 Answer 2 (Score 14)
01:39 Answer 3 (Score 3)
01:59 Answer 4 (Score 0)
02:24 Thank you
--
Full question
https://superuser.com/questions/602662/h...
Question links:
[add another audio stream to]: https://superuser.com/questions/53782/ho...
[convert the audio format of]: https://superuser.com/questions/331717/h...
[Journeyman Geek suggested in chat]: http://chat.stackexchange.com/transcript...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#windows #audio #mp4 #videoencoding
#avk47
Become or hire the top 3% of the developers on Toptal https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Horror Game Menu Looping
--
Chapters
00:00 Question
00:47 Accepted answer (Score 46)
01:13 Answer 2 (Score 14)
01:39 Answer 3 (Score 3)
01:59 Answer 4 (Score 0)
02:24 Thank you
--
Full question
https://superuser.com/questions/602662/h...
Question links:
[add another audio stream to]: https://superuser.com/questions/53782/ho...
[convert the audio format of]: https://superuser.com/questions/331717/h...
[Journeyman Geek suggested in chat]: http://chat.stackexchange.com/transcript...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#windows #audio #mp4 #videoencoding
#avk47
ACCEPTED ANSWER
Score 48
I ended up scrutinizing the documentation for ffmpeg
and worked out a solution:
ffmpeg.exe -i input_video.mp4 -i replacement_audio.m4a -vcodec copy -acodec copy -map 0:0 -map 1:0 output.mp4
ANSWER 2
Score 14
An addition to the current solution: If the audio file does not match the video container's format, just avoid the -acodec parameter:
ffmpeg.exe -i input_video.mp4 -i replacement_audio.m4a -vcodec copy -map 0:0 -map 1:0 output.mp4
Now, only the audio gets encoded in order to match the container.
ANSWER 3
Score 3
There are several free software for this:
and many others at videohelp.com
ANSWER 4
Score 0
I'm surprised that no one mentioned onlineconverter.com. In addition to many other goodies, their site allows to add or replace audio in a video file.
Trying it out, replacing the audio in a sample video file does not seem to affect the video.