The higher the buffer size, the higher the allowed bitrate variation. You'll have to adjust the rate and buffer sizes to the context obviously. Use -b:v 3500K -maxrate 3500K -bufsize 1000K, for example. Set up a constrained / variable bit rate process for streaming. Unless you absolutely need to achieve a constant rate output, do not use this option. Warning: This might result in low quality for videos that are hard to encode, and it will waste bits. Setting -b:v, -minrate, and -maxrate to the same levels will achieve that, for example for libx264: ffmpeg -i input.mp4 -c:v libx264 -x264-params "nal-hrd=cbr" -b:v 1M -minrate 1M -maxrate 1M -bufsize 2M output.ts Typically, you cannot achieve a "perfect" constant bitrate, since the encoder will not waste bits. To set up a CBR process, you have to check what the encoder offers. To summarize, you have several options for limiting bitrate: You typically only use this mode for streaming, since the technique will constrain the bit rate in order to not exceed a certain value which would cause the decoder buffer to over- or underflow. The -minrate/ -maxrate/ -bufsize options control that buffer size. This only makes sense for variable bit rate encoding, where instead of using a constant bit rate or constant quality model, the encoder simulates a transmission with a virtual buffer at the decoder. set ratecontrol buffer size (in bits) (from INT_MIN to INT_MAX) Set maximum bitrate tolerance (in bits/s). However, as the documentation indicates, this is only used in conjunction with bufsize: Set minimum bitrate tolerance (in bits/s). minrate specifies a minimum tolerance to be used: set bitrate (in bits/s) (from 0 to INT_MAX) b:v (or -vb, the same) specifies the target average bit rate for the encoder to use: Also, have a look at this article I wrote, which shows the differences between rate control modes in encoders like x264 and x265. Please read the documentation for FFmpeg, and run ffmpeg -h full for the list of options.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |