Different h264 encoders in FFmpeg

15,670

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.

Share:
15,670
CoXier
Author by

CoXier

An engineer focused on Android and Python.

Updated on July 22, 2022

Comments

  • CoXier
    CoXier almost 2 years

    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?

  • gabry
    gabry about 5 years
    amf is windows only, nvenc (win/linux), and vaapi linux only, can you add these ietails to your response to make it more exhaustive?