I am trying to convert an mp3 to mp4 with images. Below are two
ffmpeg commands I tried.
Length of mp3: 23 sec
- Here, the length of the video is same as the mp3, but video's sound does not work when trying to play on an iPhone:
ffmpeg -loop 1 -i vidimage.jpg -i my.mp3 -shortest -acodec copy -vcodec libx264 -pix_fmt yuv420p my-video.mp4
- Here, the mp4 plays with audio on an iPhone, but it is only 25 seconds long:
ffmpeg -loop 1 -i vidimage.jpg -i my.mp3 -shortest -acodec aac my-video.mp4
Between the two commands, how can I get an MP4 with the same length as the source audio and plays properly on an iPhone?