I have an mp4 video file created from images and would like to add mp3 sound to it. I am not familiar with video editing at all, but read somewhwere that aac sound is preferred, so I got sound in aac form as well.
The preferred form of the result is also mp4 or flv. My Operating System is Ubuntu (Saucy Salamander).
I have Googled a lot for avconv
and mencoder
trying to transform the found examples to my case without any success.
Will you be kind enough any of you, experts, to drop me a command line example how can I do it?
Best Answer
It depends a bit how your streams are mapped within the mp4 file. Something like this should work:
Usually the videostream is mapped as first stream in the container.
If it isn't mapped as first stream, change the mapping:
To find out how the streams in your video file actually were mapped in the first place you can use
mediainfo
which is in the standard Ubuntu repositories nowadays.If we break down the commandline here it works like this:
Make sure that the audiofile and the videofile have the same duration. Not every player is accepting tracks with huge duration differences.
Please be aware that
avconv
andffmpeg
are almost the same thing. In fact, this command using avconv also works like the same command using ffmpeg:avconv program belongs to the Libav project, a fork from the FFmpeg project. You also can safely ignore the following error message:
An alternative for muxing files in MP4 format is
MP4Box
from thegpac
package.