ffmpeg stream options for mp3, cover art of mp4
If you just want to embed a cover you might consider keeping the result as mp3, for example:

ffmpeg -i original.mp3 -i cover.png -map 0:0 -map 1:0 -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" -id3v2_version 3 -write_id3v1 1 result.mp3


If you are creating mp4's, e.g. for YouTube, then I suggest to split the process to two steps - first create the video movie with no audio track, duration somewhat longer than that of the audio. Then mux the video and audio together with the -shortest option which will truncate the video to the exact duration of audio. In terms of time these two steps will take a tidbit longer than a single pass but your whole workflow will be much simpler and more manageable.