shaka-project / shaka-streamer

A simple config-file based approach to preparing streaming media, based on FFmpeg and Shaka Packager.
https://shaka-project.github.io/shaka-streamer/
Apache License 2.0
199 stars 62 forks source link

Support capped CRF #51

Open JSONPARS opened 4 years ago

JSONPARS commented 4 years ago

Hi,

capped CRF or constrained quality is a good way to set a quality target for encoding with an upper limit for the bitrate. FFMPEG itself and all supported codecs natively support some kind of constrained quality. I think it would be great if this was also available in a config file of Shaka streamers.

joeyparrish commented 4 years ago

Sounds reasonable. So you would want a setting that translates to "-crf" in ffmpeg commands?

JSONPARS commented 4 years ago

Exactly! And also the maximum bitrate and the size of the buffer. Then you would have all parameters needed for capped CRF.

joeyparrish commented 4 years ago

We already have a way to control bitrate. Does the buffer size need to be independent of the bitrate? Does CRF need to vary per resolution?

JSONPARS commented 4 years ago

Yes and yes. The size of the buffer controls how large the bitrate jumps may be and thus how efficient the quality oriented encoding is. One CRF per resolution would be important to encode smaller resolutions with higher quality.