jnrmidwest.blogg.se

H264 encoding ffmpeg
H264 encoding ffmpeg









h264 encoding ffmpeg h264 encoding ffmpeg

This list is dependent to your OS and the enabled encoders during FFmpeg compilation. Some are software-, some are hardware-encoders. In this this you should find your target codec (h264): ĭEV.LS h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_qsv h264_cuvid ) (encoders: libx264 libx264rgb h264_amf h264_mf h264_nvenc h264_qsv ) To check this you can simply execute ffmpeg -codecs Encodingįirst of all you need to know, what encoders have been enabled in your FFmpeg version. But the load depends also on other things like bitrate, resolution and CPU/hardware. And after enabling the hardware accelerated decoding it reduced the CPU load from 20% to 4%. See FFmpeg Wiki: H.264 and FFmpeg Wiki: AAC for more info.If your CPU support for example Intel Quick Sync than you can significantly reduce the CPU load using hardware acceleration (in my test case below it was from 90% using libx264 to 20% using h264_qsv). This allows the video to begin playing faster if it is watched via progressive download playback.

  • -movflags +faststart is an option for MP4 output that move some data to the beginning of the file after encoding is finished.
  • -vf format=yuv420p chooses YUV 4:2:0 chroma-subsampling which is recommended for H.264 compatibility.
  • -b:a 160k encodes the audio with a bitrate of 160k.
  • -c:a aac selects the audio encoder aac, which is the built-in FFmpeg AAC encoder.
  • Use the highest value that gives an acceptable quality.
  • -crf 20 selects a CRF value of 20 which will result in a high quality output.
  • Use the slowest preset that you have patience for.
  • -preset slow selects the slow x264 encoding preset.
  • -c:v libx264 selects the video encoder libx264, which is a H.264 encoder.
  • Add -c:a aac: ffmpeg -i input.avi -c:v libx264 -preset slow -crf 20 -c:a aac -b:a 160k -vf format=yuv420p -movflags +faststart output.mp4











    H264 encoding ffmpeg