hi,
how do i make a video with an animated gif and music? i'm on linux. i've tried pitivi but it doesn't support animated gifs.
>>334092
with ffmpeg, to convert a gif to video you can use:
ffmpeg -f gif -i dumb_gif.gif out.webm
to add audio give your audio track as input:
-i audio_track.mp3 -codec copy
but, if you need to re-encode the audio to something compatible to a webm use
-i audio_track.mp3 -c:a libvorbis
>>334100
that's great man, thanks!!
but the gif cycles just once. how does one make it loop through all the music length?
>>334114
ffmpeg -f gif -i dumb_gif.gif -stream_loop -1 --i audio_track.mp3 -c:a libvorbis -shortest out.webm
-stream_loop -1 should loop the gif indefinitely. -shortest stop the encoding when shortest steam end, since the video stream is "infinite" it should stop at the end of the audio stream.
>>334122
unfortunately i get ad "Unrecognized option 'stream_loop'" error.
looking on the internet about that stream_loop error, i found some instructions to create an infinite loop by linking explicitly hundreds of single loops, using a name list stored in a text file.
do you think it is a valid alternative?
>>334210
just tried on my machine and it should be working (but the -shortest option is not necessary apparently).
Are you using an older version? mine's 3.3.2. I'm not sure about it but I think in older versions this option was simply called "-loop"
>>334298
ok, i removed the ffmpeg version i had downloaded from the repositories and compiled the 3.3.2 version. this solved the stream_loop option problem. then it told me that i haven't got any libvorbis codec, and i installed it and recompiled ffmpeg.
now it works fine, except for two things:
- it fails creating .webm files, cause vp8 encoder is apparently disabled. no problem though, cause an .mp4 should work fine as well.
- in making an .mp4 video, if i keep the 'shortest' option, the output video is just 0.6 seconds in length, that is just one cycle of the gif. if i remove that option, the video length is correct, but the gif loops just once and then freezes for the rest of the time.
i really don't know what to do.
if ffmpeg aint working you could always try to grab shotcut
>>334484
>it fails creating .webm files, cause vp8 encoder is apparently disabled. no problem though, cause an .mp4 should work fine as well.
compile option should be --enable-libvpx
>in making an .mp4 video, if i keep the 'shortest' option, the output video is just 0.6 seconds in length, that is just one cycle of the gif. if i remove that option, the video length is correct, but the gif loops just once and then freezes for the rest of the time.
yeah, sorry you are right, I didn't notice the gif would stop looping. The manual (https://ffmpeg.org/ffmpeg-formats.html#gif-1) says that the gif demuxer has an option which default to 1 (causing the gif to not loop), so finally it should be:
ffmpeg -ignore_loop 0 -i 1497890724216.gif -i audio.raw -c:a libvorbis -shortest out.webm
with this I get the gif correctly looping on the audio.
>>334493
>as an option which default to 1
the option is "-ignore_loop 1"