convert animated gif to video on linux server while preserving frame rate

后端 未结 2 1160
小鲜肉
小鲜肉 2021-01-03 07:47

how do I convert an animated gif to a video (e.g. h264@mp4) programmatically on a linux server?

I need this to process user generated content which should be output

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-03 08:37

    Yet Another Avconv Bug (YAAB)

    ffmpeg has better GIF demuxing support (and improved GIF encoding). I recommend ditching avconv and getting ffmpeg (the real one from FFmpeg; not the old charlatan from Libav). A static build is easy, or you can of course compile.

    Example

    ffmpeg -i in.gif -c:v libx264 -pix_fmt yuv420p -movflags +faststart out.mp4
    

    See the FFmpeg Wiki: H.264 Encoding Guide for more examples.

提交回复
热议问题