How do I convert the format of an audio track inside an MP4 video?

6

1

I have an MP4 File with an AVC video track and an MP3 (not AAC) audio track.

Video: MPEG4 Video (H264) 1920x1080 [Video]
Audio: MPEG Audio 44100Hz stereo 192kbps [Audio]

While some video players are able to play the video with the audio as expected, Adobe Premiere Pro CS5.5 does not recognize it, since it expects MP4 files to have AAC-encoded audio tracks (as per the standard).

Right now I'm using a workaround where I use the MKV Toolnix to extract the audio track from the MP4 file (using an intermediate MKA file) then I just sync the audio file to the MP4 file in Premiere manually (as it shows the MP4 file as silent).

Is there a way to convert the MP3 track to AAC and keep it inside the MP4 file? If that is not possible, is there a command-line tool that can re-encode the MP4 with an AAC track to another file? I'm running Windows here.

ArmlessJohn

Posted 2011-09-04T07:25:29.677

Reputation: 63

Answers

8

ffmpeg should be able to do it. A command line something like this:

ffmpeg -i input.mp4 -vcodec copy -acodec aac -strict experimental -ac 2 -ar 44100 -ab 192k output.mp4

Mr Alpha

Posted 2011-09-04T07:25:29.677

Reputation: 6 391

Is -strict experimental still required as of 2019? – Hashim – 2019-02-17T19:57:01.747

Thank you, this is what I'm looking for. Unfortunately I ran into an error; when I use this command, I get the message "encoder 'aac' is experimental and might produce bad results. Add '-strict experimental' if you want to use it.". Adding "-strict experimental" to the command does nothing. Any suggestions? – ArmlessJohn – 2011-09-04T17:49:40.837

Works for me when I add -strict experimental immediately after aac. – Mr Alpha – 2011-09-04T20:03:39.087

Yes, this was it. I was adding it at the end of the command line. Thank you very much, your suggested solution is working perfectly for me! – ArmlessJohn – 2011-09-04T22:41:23.830

Newer versions tell to add -strict -2 and it works. – erik – 2014-02-17T15:47:55.270