How to remux/combine two MP4 files losslessly: One has video I want and the other has matching audio I want

1

I’d like to know if there's a way to remux/combine two MP4 video files.

They both have the exact same frame count. One is 1080p with no sound, the other is 720p with sound. I’d like to permanently combine the two. So the result will be a 1080p MP4 video that has sound. And I’d like to do it losslessly, both for video and audio, sort of a 1:1 transfer.

Preferably using FFmpeg. Any help is hugely appreciated.

user1117595

Posted 2019-12-02T02:59:06.230

Reputation:

Question was closed 2019-12-02T10:09:19.900

So one video has the video you want (1080p) and the other has audio you want (720p) and you want to combine the video from the 1080p with the audio from the 720p? – JakeGould – 2019-12-02T03:02:50.163

Yes sir. They are downloaded from YouTube. And as you know when you download 1080p YouTube videos they are without sound. Now I want to combine the sound of the 720p video with the better quality of 1080p video. Preferably losslessly. – None – 2019-12-02T03:05:08.310

While this question does not have an answer, the command the original poster used is along the lines of what you want to do: Basically mapping video from one source with audio from another. I know it can be done, but I can’t seem top find another answer that actually addresses your issue which is odd because this seems to be a common task. Hopefully that helps. If not, one of the FFmpeg gurus here should be able to post something to help you out.

– JakeGould – 2019-12-02T03:25:47.720

Thank you Jake. I'm going to take a look at the link you posted. I appreciate it. Also hopefully an FFmpeg guru helps me here as well. – None – 2019-12-02T03:30:04.217

Answers

1

Basic syntax is

ffmpeg -i 1080p.mp4 -i 720p.mp4 -map 0:v -map 1:a -c copy new.mp4

Gyan

Posted 2019-12-02T02:59:06.230

Reputation: 21 016

1Wow, thank you ever so much. This worked perfectly. Thanks a million. – None – 2019-12-02T07:53:10.343