1/16/2023 0 Comments Ffmpeg crfIf we specify a smaller -bufsize, ffmpeg will more frequently check for the output bit rate and constrain it to the specified average bit rate from the command line. This would cause the current bit rate to frequently jump a lot over and below the specified average bit rate and would cause an unsteady output bit rate. If we didn't specify -bufsize, these intervals could be significantly longer than we would want. The key option here is -bufsize which tells the encoder how often to calculate the average bit rate and check to see if it conforms to the average bit rate specified on the command line ( -b:v 2M).īased on the -bufsize option, ffmpeg will calculate and correct the average bit rate produced. The typical example would be something like this:įfmpeg -i input -c:v libx264 -b:v 2M -maxrate 2M -bufsize 1M output.mp4 The technique will constrain the bit rate in order not to exceed a certain threshold value which would take more time to transmit and would cause the decoding buffer to underflow waiting for the new data to arrive. We will instruct the libx264 encoder to simulate a stream transmission with a virtual buffer (just like the real buffer at the decoding side). In this case, you want to have a live stream with more/less constant bit rate (using the option -b:v), to be able to control the bandwidth used. In most cases (such as storing a file for archival), letting the encoder choose the proper bitrate is the constant quality or CRF-based encoding.Įxample: Creating a live stream with limited bit rate Note: Constraining the bitrate might result in low quality output if the video is hard to encode.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |