Mystery5.webm
[Hide] (3.5MB, 1200x1600, 02:03) >>237624
>Is the recomended command still
>ffmpeg -i audioname.mp3 -r 1 -loop 1 -i imagename.jpg -c:v libvpx -crf 20 -b:v 0 -g 120 -sn -c:a libopus -b:a 128k -shortest -map_metadata -1 output.webm
Some observations:
>-c:v libvpx
Seems to encode with vp8, as opposed to the newer vp9, but since it's a still image we're encoding it shouldn't make a difference. right?
To use vp9 instead:
<-c:v libvpx-vp9
>-g 120
Sets maximum keyframe interval as 120 seconds, the longer the keyframe interval, the smaller the resulting file will be, but when seeking the file in mpv, one press of an arrow key seeks through the whole file if it's shorter than two minutes.
To set keyframes every 10 seconds:
<-g 10
>-b:a 128k
Sets the opus bitrate to 128k, the default bitrate used for opus is 96k if it isn't specified. 128kbps mp3 files were a thing back in the day but opus doesn't need that much to sound great.
Specify 96k or leave this option out and opus will default to 96k anyway:
>-b:a 96k
With the above changes, the command you posted would become:
>ffmpeg -i audioname.mp3 -r 1 -loop 1 -i imagename.jpg -c:v libvpx-vp9 -crf 20 -b:v 0 -g 10 -sn -c:a libopus -shortest -map_metadata -1 output.webm
Running the above is slow for me though, encoding speed is about 1,4x... If it aint broke, don't fix it applies here, I guess.
That said, this one liner from stackexchange has worked well for me in the past, it's output seems seekable even without adding anything about keyframes:
ffmpeg -loop 1 -i image.png -i audio.mp3 -map 0 -map 1:a -c:v libvpx-vp9 -vf format=yuv420p -c:a libopus -shortest output.webm
(taken from https://superuser.com/questions/1531462/webm-with-a-still-image-and-an-audio )