>>37666
>>51378
It's different if you have a .png or a .gif. Here are mine.
>png and mp3 (to preserve alpha transparency replace yuv420p with yuva420p)
ffmpeg -loop 1 -i input.png -i input.mp3 -map 0 -map 1:a -c:v libvpx-vp9 -vf format=yuv420p -c:a libopus -shortest -fflags +shortest -max_interleave_delta 100M output.webm
>gif and mp3
ffmpeg -ignore_loop 0 -i input.gif -i input.mp3 -map 0 -map 1:a -c:v libvpx-vp9 -vf format=yuv420p -c:a libopus -shortest -fflags +shortest -max_interleave_delta 100M output.webm
>webm where video and audio are the same length
ffmpeg -i input.webm -i input.mp3 -map 0:V:0 -map 1:a:0 -c:v copy -c:a libopus -b:a 160k -f webm output.webm
>webm where video is looped for the duration of the audio (two separate commands)
ffmpeg -stream_loop -1 -i input.webm -i input.mp3 -c copy -shortest -fflags +shortest -max_interleave_delta 100M output.mp4
ffmpeg -i output.mp4 -map 0:v:0 -map 1:a:0 -c:v copy -c:a libopus -b:a 160k -f webm output.webm