0

If there is a h.264 video, and I use -crf 17 I sometimes I get a lower bitrate, but the weird thing is - most of the time get a higher ones.

I am trying to get this setting because I think some videos of mine are having a higher then needed bitrate and I have not figured a way (if it is possible at all) to determine what is the most appropriate way to do this and maybe playing with CRF will not help me at all, but I wondered what actually happens when you don't encode with libx264 for example, but actually use CRF values on a x264 file?

2
  • The bitrate depends on t he complexity of the video. For two videos with the same resolution and framerate, using the same CRF will give a higher bitrate for the video with more complexity.
    – Gyan
    Commented Mar 23, 2019 at 4:55
  • But what actually happens when I give crf -17 and the new video is larger than the older one?
    – A. Newb
    Commented Mar 23, 2019 at 12:43

1 Answer 1

1

When decoding a file, the decoder attempts to recreate the source material with the information provided in the file. But it can not be a 100 percent accurate representation, so the decoder creates new pixels that are estimates of what was included in the source

When you encode for the second time with CRF 17, the encoder does not know these new pixels were generated by the decoder and were not necessarily faithful to the original material. But the encoder still does its job, and attempts to encode these new values accurately.

So it spends bits encoding pixels that were thrown away and recreated by the first encode, making the file larger.

2
  • The semantics of your answer seem weird. It suggests that the encoder stores a perfect representation of the source, but the decoder attempts and fails to restore a duplicate of that representation. Instead, the information-limiting happens at the encoding stage, based on encoder design and rate-control constraints. Decoders for modern codecs are expected to produce bitexact output (rounding errors may be still possible due to architecture limitations as well as skipping deblocking..etc).
    – Gyan
    Commented Mar 26, 2019 at 7:09
  • I understand your logic, but in this context I am referring to the encoder output as the decoder. I simplified because I assumed the poster is not aware of the nuances and was attempting to be helpful more that accurate. The decoder output is bit exact across implementations. But my post is basically correct when round tripping between spacial and temporal domains, and after quantization and loop filters, new visual information is implied that was not part of the reference.
    – SlimSCSI
    Commented Mar 26, 2019 at 7:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.