Background
I need to convert AVI files to H264 (MP4). I am successfully doing so with the following:
-i mymovie.avi -c:v libx264 -crf 19 -preset slow -c:a libfaac -pix_fmt yuv420p -f mp4 -b:a 192k -y -an output.mp4
I am calling the command via a C# .Net Winforms applications, although I suspect this will have little impact on the answer.
The Question
How do I add an audio track? I need to add one, as I need to be able to upload the videos to Instagram, which it seems rejects files without an audio track (to my annoyance). In reality I do not need an audio track that is very long. My thoughts were a couple of seconds of "silence" in MP3 format.
I think I will need AAC audio as the output.
For the record I also realise the -an
command will provide no audio and I have taken this away in my later attempts.
Attempts so far
I have gathered I will need to use the -shortest
command as the audio will be shorter than the video. In reality I will be adding a blank MP3 (or similar) just so while encoding I get an audio stream embedded in the video.
I also have tried using the -map
command but without success.