[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

I have a 20 seconds mp3 file and a gif, how can I loop the gif

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 6
Thread images: 2

File: 1489037341728.jpg (439KB, 2048x1536px) Image search: [Google]
1489037341728.jpg
439KB, 2048x1536px
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
>>
File: out.webm (3MB, 128x128px) Image search: [Google]
out.webm
3MB, 128x128px
>>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
Thread posts: 6
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.