Different h264 encoders in FFmpeg
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.