Combine images and gif to a single video?

2

My project is to join all image files (currently only JPGs) in a folder to a single video file. All images are the same size (1080p) and each one should be displayed for 3s in the output video. Here's the current snipped of the code:

ffmpeg -hide_banner -loglevel panic -r 1/${1:-3} -f concat -safe 0 -i files.txt -c libx264 -preset ultrafast outputfile.mp4

As far as good, everything works a expected. Now comes my problem:

I also have a bunch of animated GIFs I want to include in the video. These are also all 1080p but vary in "length" (if you may say so about GIFs).

When I run the script with GIFs in the folder they get excluded with the error message:

Error while decoding stream #0:0: Invalid data found when processing input [mjpeg @ 0x7fc4e101b000] mjpeg: unsupported coding type (c6) [mjpeg @ 0x7fc4e101b000] bits 138 is invalid

How do I fix this? It would be nice if the GIFs would be stretched/clinched to only be 3s each but that shouldn't be the matter for now.

Kind regards!

Max M.

Posted 2018-06-09T17:46:52.533

Reputation: 33

You'll have to convert the GIFs to JPEGs. – Gyan – 2018-06-09T18:04:31.840

1Damn.. the reason they are GIFs is that they are animated. – Max M. – 2018-06-09T19:43:26.700

That's fine. Export to a MOV with mjpeg codec. – Gyan – 2018-06-10T04:20:04.223

No answers