lisamelton / other_video_transcoding

Other tools to transcode videos.
MIT License
555 stars 26 forks source link

Can't increase maxrate or bufsize (nvenc)? #114

Closed catdroid75 closed 3 years ago

catdroid75 commented 3 years ago

My input: --hevc --nvenc-recommended --rc-bufsize 20000 --rc-maxrate 15000 --target 5000 --eac3 --add-audio commentary --add-sub auto --crop auto

With any 1080p source results in a output ffmpeg command line of:

ffmpeg -loglevel error -stats -i "R:\\WIP\\That_One_Show\\Season 1\\That_One_Show - S01E01 - That_One_Show Bluray-1080p.mkv" -map 0:0 -c:v hevc_nvenc -pix_fmt:v p010le -b:v 5000k -maxrate:v 12000k -bufsize:v 12000k -spatial-aq:v 1 -rc-lookahead:v 32 -b_ref_mode:v middle -color_primaries:v bt709 -color_trc:v bt709 -colorspace:v bt709 -metadata:s:v "title=" -disposition:v default -map 0:1 -c:a:0 eac3 -metadata:s:a:0 "title=" -disposition:a:0 default -sn -metadata:g "title=" -default_mode passthrough "That_One_Show - S01E01 - That_One_Show Bluray-1080p.mkv"

(I've also tied component parts of --nvenc-recommended, as well as vanilla --nvenc and got the same results)

Notice the bit: -b:v 5000k -maxrate:v 12000k -bufsize:v 12000k Is this as intended? Is there no longer anyway to override the default maxrate and bufsize?

lisamelton commented 3 years ago

@catdroid75 I'm sorry if this seems wrong but this is actually all intentional. And it was changed in version 0.9.0 of other-transcode. In the release notes for that version it says (emphasis mine):

This also means that there are now hard upper limits for maximum rate and buffer size values. Why did I do that? Well, one reason is to make sure the output video conforms to the H.264 and HEVC level requirements for specific resolutions. The other reason is that these limits actually produce better quality output.

And the upper limit for for Level 4 HEVC Main 10 at 1080p is 12000 Kbps. It's not useful to exceed that bitrate.

Does that explain things?

catdroid75 commented 3 years ago

This is roughly what I expected to be the case. Given the phrasing in the changelog, "To raise those values, increase the target video bitrate instead", I took it to mean that increasing the target would continue to increase the maxrate and bufsize. So I was surprised when I didn't see that happen.

Thanks (as always) for the quick response, @donmelton!