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

7,697

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
Share:
7,697

Related videos on Youtube

ArmlessJohn
Author by

ArmlessJohn

Updated on September 18, 2022

Comments

  • ArmlessJohn
    ArmlessJohn almost 2 years

    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
    ArmlessJohn almost 13 years
    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?
  • Mr Alpha
    Mr Alpha almost 13 years
    Works for me when I add -strict experimental immediately after aac.
  • ArmlessJohn
    ArmlessJohn almost 13 years
    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!
  • erik
    erik over 10 years
    Newer versions tell to add -strict -2 and it works.
  • Hashim Aziz
    Hashim Aziz over 5 years
    Is -strict experimental still required as of 2019?