I have a 20 seconds mp3 file and a gif, how can I loop the gif for the duration of the mp3 file generating a webm with ffmpeg?
>>377827
first you make the webm from the gif
then you merge the mp3 and webm
>>377831
yeah that's what I did but still I can't loop the webm for the whole length of the mp3 audio. using the -shortest option cut the audio using the webm length but I need the exact opposite
>>377827
summarizing from this helpful mailing list post http://www.ffmpeg-archive.org/Merging-animated-gif-and-mp3-td4670012.html
make gif.gif and mp3.mp3 and then run
ffmpeg -i gif.gif -auto-alt-ref 0 -c:va libvpx gif.webm && perl -e 'print "file gif.webm\n" x 10000' > gif.txt && ffmpeg -f concat -i gif.txt -i mp3.mp3 -c:v copy -shortest out.webm
basically, convert to webm with no audio, make a text file that has that same filename repeated some stupid number of times, then use ffmpeg concat option to read the file as a single video stream and use the shortest option to clip it to the audio length
>>377827
why don't make the gif longer in PS and then do whatever else you did
>>377895
nice trick but I have the feeling 1000 will be more than enough if we consider the average length of a webm on 4chan. also I'll try forcing the dummy text file in temp like this %localappdata%\temp\audioloopwebm.txt because I don't want to fill my user folder with unnecessary crap. I'll try editing and let you know if it worked in the end
>>377900
because I have the feeling this won't be a one time issue and I'm looking for a way to automatize the process with ffmpeg