NaughtySquid
NaughtySquid

Reputation: 2097

ffmpeg won't convert GIF to WEBM

I'm trying convert a GIF to a WEBM for uploads to my site, to get smaller files (GIFs are so big...) and get all the advantages of videos, like pausing. But ffmpeg gives this error:

Input #0, gif, from '1.gif':   Duration: N/A, bitrate: N/A
    Stream #0:0: Video: gif, bgra, 960x540, 16.67 fps, 16.67 tbr, 100 tbn, 100 tbc Stream mapping:   Stream #0:0 -> #0:0 (gif (native) ->
vp8 (libvpx)) Press [q] to stop, [?] for help [libvpx @
0x5560ca413960] v1.6.1 [libvpx @ 0x5560ca413960] Transparency encoding
with auto_alt_ref does not work Error initializing output stream 0:0
-- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

Here's my ffmpeg line:

ffmpeg -r 16 -i 1.gif -c:v libvpx -crf 12 -b:v 500k test.webm

Upvotes: 6

Views: 8003

Answers (1)

Matt McManis
Matt McManis

Reputation: 4675

ffmpeg -y -i 1.gif -r 16 -c:v libvpx -quality good -cpu-used 0 -b:v 500K -crf 12 -pix_fmt yuv420p -movflags faststart test.webm

Upvotes: 13

Related Questions