LS3solutions / openstream-server

GNU General Public License v3.0
201 stars 26 forks source link

Remove vbv-maxrate configuration #5

Closed psyke83 closed 1 year ago

psyke83 commented 3 years ago

Using vbv-maxrate will only cause the requested client bitrate to be constrained.

GNUDimarik commented 3 years ago

@m4rkoup please let me know if you think that change is relevant. @LS3solutions please confirm this.

psyke83 commented 3 years ago

In case it helps, you can see the problem via ffmpeg command-line and the software hevc encoder's information output:

./ffmpeg.exe -i test.mp4 -c:v libx265 -frames:v 500 -preset ultrafast -tune zerolatency -x265-params $params -an -f null -

ABR mode, params="bitrate=50000:vbv-bufsize=1000:vbv-maxrate=10000": x265 [info]: Rate Control / qCompress : ABR-10000 kbps / 0.60 x265 [info]: VBV/HRD buffer / max-rate / init : 1000 / 10000 / 0.900

CRF mode, params="bitrate=50000:vbv-bufsize=1000:vbv-maxrate=10000:crf=1": x265 [info]: Rate Control / qCompress : CRF-1.0 / 0.60 x265 [info]: VBV/HRD buffer / max-rate / init : 1000 / 10000 / 0.900

In ABR-VBV mode, the bitrate cannot go higher than vbv-maxrate. In CRF-VBV mode (which is the mode being used for encoding on the lastest master branch), the encoder only looks at vbv-maxrate (which is set to the same value as the bitrate requested from the client here). Making vbv-maxrate configurable causes the requested bitrate from the client connection to be limited to whatever you have set for vbv-maxrate in the host GUI, which doesn't seem to make much sense.

m4rkoup commented 3 years ago

@GNUDimarik will check. Thanks, @psyke83.

But the changes can't be approved as they are, because this is the old simple UI.