Answer the question
In order to leave comments, you need to log in
Why does converting two similar files from mp4 to webm give very different results?
There are 2 similar mp4 files. The same video size, almost the same duration, fps, number of frames, codec. File size too: one 30 (bitrate 1.9M), the other 35 (bitrate 1.3M).
I convert them to webm (vp9). With some parameters - one is compressed, the other is repeatedly increased from 30 mb to 160. (The bitrate of the output file becomes from 1.3M to 9M, although I set b: v 1M). For others, it's the other way around. Why can this happen? How to get similar compression result for both?
On the screen, you can see what different results for 1 and 2 with the same conversion parameters:
Answer the question
In order to leave comments, you need to log in
First, if your encoder is capable of CRF, CQP and other adaptive bitrates/encoder strategies, you should use them. You can read about encoder strategies (Encoder Strategy \ Rate Control \ and other names of the same) here .
You cannot know what bitrate each individual frame of the video needs, so your attempts to manually specify the bitrate are practically doomed to failure:
1) If the bitrate you specify is lower than what is actually needed, you will get image quality degradation and compression artifacts.
2) If the bitrate you specified is higher than what is actually needed, then the video quality will remain unchanged, but the file will "weigh" more than it could.
Moreover, you specify the bitrate for the entire video, while the variable bitrate may be higher at the beginning of the file (for example, where there is a lot of movement and more bitrate is required), and at the end of the file there may be long static plans - there the bitrate is needed much less .
So since you are using VP9 (WEBM) you should use CRF (Constant Quality):
To trigger this mode, you must use a combination of -crf and -b:v 0. Note that -b:v MUST be 0. Setting it to anything higher or omitting it entirely will instead invoke the Constrained Quality mode.
ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -b:v 0 output.webm
The CRF value can be from 0–63. Lower values mean better quality. Recommended values range from 15–35, with 31 being recommended for 1080p HD video.
ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -b:v 2000k output.webm
The quality is determined by the -crf, and the bitrate limit by the -b:v where the bitrate MUST be non- zero.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question