I am trying to convert an mkv with video and audio into an m4v with the same audio, but with the video replaced with a still jpg for the duration. I'm following the examples from https://trac.ffmpeg.org/wiki/Slideshow and not having any success. Every time I attempt any of these, it doesn't insert the jpg, and instead uses the original video from the mkv. I am testing the files in VLC. Any ideas what could be going wrong? I'm inclined to think the documentation itself may be outdated or wrong.
Attempts following the linked examples:
-i input.mkv -loop 1 -i image.jpg -c:a ac3 -b:a 640K -c:v libx264 -shortest output.m4v
-i input.mkv -framerate 1 -i image.jpg -c:a ac3 -b:a 640K -c:v libx264 -r 30 -pix_fmt yuv420p output.m4v
-i input.mkv -framerate 1 -i image.jpg -c:a ac3 -b:a 640K -c:v libx264 -r 30 -vf format=yuv420p output.m4v
The one thing I got semi-working (based on code from another source) was -i input.mkv -i image.jpg -filter_complex "[1][0]scale2ref[i][v];[v][i]overlay" -c:a ac3 -b:a 640K -c:v libx264 output.m4v
but this stretches the image out (which I don't want, I want the resultant video to have the same aspect ratio as the image without black padding on the sides).
I'm kicking myself because I eventually got something along the lines of the first examples working a few days ago, but somehow didn't save my work and am back to square one. Any help is appreciated, thanks in advance.