I used this to combine a JPG and MP3 into a video:
ffmpeg -loop 1 -i 1.jpg -i song.mp3 -strict -2 -c:v libx264 -tune stillimage -c:a aac -b:a 192k -pix_fmt yuv420p -shortest out.mp4
I'm trying to change the .jpg to a .gif, but the gif should loop to the MP3 length
I was able to do it with
ffmpeg -i song.mp3 -ignore_loop 0 -i 2.gif -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -shortest -strict -2 -c:v libx264 -threads 4 -c:a aac -b:a 192k -pix_fmt yuv420p -shortest out.mp4
this worked for me
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With