User Tools

Site Tools


ffmpeg:conversions:convert_h264_to_av1:libaom:a_minimum_and_maximum_bitrate_for_streaming

ffmpeg - Conversions - Convert H264 to AV1 - libaom - A minimum and maximum bitrate, for streaming

libaom-av1 allows a minimum and maximum bitrate can be specified, instead of a quality target.

  • This method is useful for bulk encoding videos in a generally consistent fashion.

NOTE: When muxing into MP4, you may want to add -movflags +faststart to the output parameters if the intended use for the resulting file is streaming.


time ffmpeg -i a.mp4 -c:v libaom-av1 -minrate 500k -b:v 2000k -maxrate 2500k -movflags +faststart -f mp4 out.mp4

returns:

...
real	104m48.048s
user	592m19.009s
sys	0m34.579s

NOTE:

  • Input test size: 75.5M
  • Output test size: 4.9M

NOTE: The bitrate limit by the -b:v where the bitrate MUST be non-zero.

  • movflags & faststart: An MP4 video is composed of various data chunks named atoms which can appear in any order, and an important one is moov atom that stores the detailed video metadata.
    • When the video is streamed online, the browser will request the video and try to find the moov atom.
    • Without it, the browser will waste time making extra requests again and again, even download the entire video.
    • With MP4 Fast Start, by optimizing MP4, moving the moov atom to the beginning of a video, so that browser will easily locate the moov atom to load and play the video faster, it can progressively stream while it's buffering.
    • It does not have to wait for it to finish downloading.
ffmpeg/conversions/convert_h264_to_av1/libaom/a_minimum_and_maximum_bitrate_for_streaming.txt · Last modified: 2023/06/15 08:07 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki