![how to use ffmpeg to make webms how to use ffmpeg to make webms](https://www.ubuntupit.com/wp-content/uploads/2020/12/install-ffmpeg-via-PPA.jpeg)
Don’t forget to update -cluster_time_limit. The -g parameters takes a number of frames as its value, so if you have a framerate of 30 and want a GOP period of 5 seconds, you can set -g to 150 (which is 5 × 30).
![how to use ffmpeg to make webms how to use ffmpeg to make webms](https://www.ubuntupit.com/wp-content/uploads/2020/12/install-ffmpeg-on-ubuntu-Linux.jpg)
It is advised to use a 5 to 10 seconds GOP period. However, a value too high will have little benefits for the bandwidth while causing very high latency. However periodic key frames are necessary to bootstrap the video decoder when a client connects to the stream after the beginning.Ī higher value of the -g parameter will save bandwidth and increase latency. Its value should be a compromise between latency and bandwidth, because key frames occupy more space whilst being of lower quality because they don’t use the previous images as reference. The value of the -g parameter sets the maximum period betwoon two key frames.
![how to use ffmpeg to make webms how to use ffmpeg to make webms](https://cdn.ilovefreesoftware.com/wp-content/uploads/2020/01/simple_video_editor-01.png)
In this configuration, 5100 milliseconds of throughput at the maximum bandwidth shouldn’t make more than 1MB so 2M is okay. c:v libvpx -b:v 1.5M -crf 30 -g 150 -deadline good -threads 4 value of -cluster_size_limit must be set to a very high value that will never be reached. f webm -cluster_size_limit 2M -cluster_time_limit 5100 -content_type video/webm \ If your framerate is 30 and -g is 150, then -cluster_time_limit should be greater than 5000 (which is (150 ÷ 30) × 1000 milliseconds). As explained in next section, -cluster_time_limit should always have a value (in milliseconds) greater than the value of -g divided by the framerate times 1000. This configuration is a Linux example and must be adapted for your hardware and operating system. The resulting stream can be read from a simple HTML5 video tag in Firefox and Chrome. It supports being a source for several streaming servers including Icecast.