2
2
I want to convert an animated gif and a midi (music) file into a mp4 video. Is it possible? I saw a lot of topics on documentation, foruns and stackexchange sites, but I didn't find.
It works with 1 JPEG and 1 WAV. I need some like it with animated gif and midi files.
fmpeg -f image2 -loop 1 -i image.jpg -i audio.wav \
-c:v libx264 -tune stillimage -c:a aac -strict experimental -b:a 192k -shortest out.mp4
I am using imagemagick to split gifs in jpegs...
convert -coalesce -background white '/home/jonathan/Desktop/img.gif' JPEG:some%05d.jpg
Scripts are welcome!
Thank you!
UPDATE
Almost done:
$ sudo apt-get install imagemagick libmagickcore-dev libavcodec-extra-53 timidity lame
// extract images
$ convert -coalesce -background white 'img.gif' JPEG:some%05d.jpg
// convert midi into mp3
$ timidity song.mid -Ow -o - | lame - -b 64 song.mp3
// makes mp4 file
$ ffmpeg -r 8 -f image2 -loop 1 -i some%05d.jpg -i song.mp3 -tune stillimage -strict experimental -b:a 192k -shortest out.mp4
It works, but some colors are wrong. Still searching to fix it.
UPDATE 2
Wrong colors problem happens only in Movie Player (I m using Mint). In Banshee and others players is OK!!