I'm trying to convert an image file combined with an .mp3 file into an .mp4 suitable for displaying in Firefox on a webpage (using mediaelement.js). I've found various guides that suggest using -pix_fmt yuv420p, but I get an error message of "Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height". Here is the exact command I'm using:
ffmpeg -loop 1 -framerate 2 -i byu-utah.png -i nfl.mp3 -c:v libx264 -preset medium -tune stillimage -crf 18 -c:a copy -shortest -pix_fmt yuv420p byu-utah.mp4
Files can be downloaded here: