5

Is there any way to swap out the audio track on a rendered H.264 MPEG-4 without having to re-render the entire video project? Can this be done with Premiere, MPEG Streamclip, ffmpeg, or some other tool that I'm not familiar with ?

I have a long video project that took many hours to render, and I would like to swap out the audio (minor mixing changes) without having to re-render the entire video project. The new audio is exactly the same length.

Is this feasible? I'm primarily a Premiere user, but I'm happy to hear solutions for other tools.

2 Answers 2

3

ffmpeg is a good choice for this task. You can do this with this command:

ffmpeg -i input.mp4 -i input_audio.aac -map 0:0 -map 1 -vcodec copy -acodec copy output.mp4
2

Yes, ffmpeg can do what you need, which is to demux the MP4 into audio and video components, then remux using the new audio. Actually, you can extract just the video since you don't need the existing audio. I'm not an expert in ffmpeg, but the demux command line would be something like ffmpeg -i myfile.mp4 -vcodec copy myvideo.h264.

3
  • See amimciptimdim command for remuxing the .h264 into a new mp4. Instead of input.mp4 you provide the path to your myvideo.h264.
    – timonsku
    Oct 11, 2014 at 13:58
  • Yes, actually it looks as if you can do it in one step: combine the video from the original MP4 and a new AAC/MP3 into a new MP4.
    – Jim Mack
    Oct 11, 2014 at 16:59
  • You could endup with 2 audio stream though depending on how the original audio is mapped in the container and how ffmpeg handles this situation, it either creates a second audio stream or replaces the first when using -map 1.
    – timonsku
    Oct 11, 2014 at 18:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.