15

In ffmpeg 4.0, there are several h264 encoders. If you use ./configure --list-encoders | grep "h264", you can see them.

  • h264_amf
  • h264_nvenc
  • h264_omx
  • h264_qsv
  • h264_v4l2m2m
  • h264_vaapi
  • h264_videotoolbox

I do not know what's the difference between. And I want convert local gif to mp4 using ffmpeg, so which encoder works for me?

3
  • 1
    None Those all depend on specific hardware or platform. You need libx264
    – Gyan
    Commented Jun 5, 2018 at 7:53
  • Thanks a lot. It's better if you can explain these encoder.
    – CoXier
    Commented Jun 5, 2018 at 8:22
  • videotoolbox is Apple devices, nvenc is Nvidia, you can google the rest.
    – szatmary
    Commented Jun 5, 2018 at 14:53

1 Answer 1

41

Each encoder use a different API to access video hardware :

  • h264_amf to access AMD gpu, (windows only)
  • h264_nvenc use nvidia gpu cards (work with windows and linux)
  • h264_omx raspberry pi encoder
  • h264_qsv use Intel Quick Sync Video (hardware embedded in modern Intel CPU)
  • h264_v4l2m2m use V4L2 Linux kernel api to access hardware codecs
  • h264_vaapi use VAAPI which is another abstraction API to access video acceleration hardware (Linux only)
  • h264_videotoolbox use videotoolbox an API to access hardware on macOS

With proper hardware, each encoder will succeed to encode your decoded gif to mp4.

You can custom this command to convert gif to mp4 :

$ ffmpeg -i local-gif.gif -c:v libx264 output.mp4

libx264 is the default encoder which does not use any specific hardware this can be changed to the desired encoder.

1
  • 3
    amf is windows only, nvenc (win/linux), and vaapi linux only, can you add these ietails to your response to make it more exhaustive?
    – gabry
    Commented May 23, 2019 at 12:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.