I am currently in the process of optimizing my OBS's NVENC_h264 settings, and I noticed that the bitrate seems to be much higher than what ffmpeg produces. But, I have to say I am not sure if I am using the right ffmpeg command line.
I am dealing with 720x576p (25 fps) video by the way, because I am digitizing old VHS tapes.
First of all, here are my OBS encoder settings as per the log:
I tested this on a short 1m30s clip and found that the recordings averages out around 3750 kpbs. This is quite high for cq=25 at this resolution, but this particular clip is quite noisy.
I am trying to reproduce this using ffmpeg as follows:
1. Re-record the clip in NVENC_lossless format
2. Run ffmpeg (v6.1, which should be the same version used by OBS):
But, this file averages out around 2150 kpbs, much lower than the OBS recording!
Note that psycho_aq was on in OBS by the way, and there seems no way to enable this in ffmpeg, but turning it off does not make much of a difference in terms of bitrate.
I am seeing these big differences on multiple files I tested (also less noisy ones), so this is not a coincidence.
The only explanations I can think of are:
1. Encoding "live" (while capturing) yields higher bitrates? This would not make sense to me since lookahead is off, so ffmpeg should have more or less the same input as OBS I guess.
2. There's a discrepancy between OBS's and ffmpeg and 'native' ffmpeg (but could that explain such a big difference?)
3. My ffmpeg command line is wrong, maybe?
Does anyone have a clue?
For completeness, my most recent log: https://obsproject.com/logs/mgsCuOWQK3gl23Iy
I am dealing with 720x576p (25 fps) video by the way, because I am digitizing old VHS tapes.
First of all, here are my OBS encoder settings as per the log:
09:09:31.799: [obs-nvenc: 'advanced_video_recording'] settings:
09:09:31.799: codec: H264
09:09:31.799: rate_control: CQP
09:09:31.799: bitrate: 0
09:09:31.799: cqp: 25
09:09:31.799: keyint: 250
09:09:31.799: preset: p5
09:09:31.799: tuning: hq
09:09:31.799: multipass: qres
09:09:31.799: profile: high
09:09:31.799: width: 720
09:09:31.799: height: 576
09:09:31.799: b-frames: 2
09:09:31.799: lookahead: false
09:09:31.799: psycho_aq: true
I tested this on a short 1m30s clip and found that the recordings averages out around 3750 kpbs. This is quite high for cq=25 at this resolution, but this particular clip is quite noisy.
I am trying to reproduce this using ffmpeg as follows:
1. Re-record the clip in NVENC_lossless format
2. Run ffmpeg (v6.1, which should be the same version used by OBS):
ffmpeg -hwaccel_output_format cuda -i reference.mp4 -acodec copy -vcodec h264_nvenc -rc constqp -qp 25 -tune hq -profile:v high -preset p5 -bf 2 -2pass true -multipass qres -rc-lookahead 0 output.mp4
But, this file averages out around 2150 kpbs, much lower than the OBS recording!
Note that psycho_aq was on in OBS by the way, and there seems no way to enable this in ffmpeg, but turning it off does not make much of a difference in terms of bitrate.
I am seeing these big differences on multiple files I tested (also less noisy ones), so this is not a coincidence.
The only explanations I can think of are:
1. Encoding "live" (while capturing) yields higher bitrates? This would not make sense to me since lookahead is off, so ffmpeg should have more or less the same input as OBS I guess.
2. There's a discrepancy between OBS's and ffmpeg and 'native' ffmpeg (but could that explain such a big difference?)
3. My ffmpeg command line is wrong, maybe?
Does anyone have a clue?
For completeness, my most recent log: https://obsproject.com/logs/mgsCuOWQK3gl23Iy