Video encoder settings

FranckB

Member
Hello
where can we find the possible parameters and the syntax to use?
In particular, I want to be able to adjust the number of B-frames here : (??)
20221030_111613_ima003.png

thank you
 

PaiSand

Active Member
Try ffmpeg site. Make sure the encoder you're using have been packed with all things you want to set in there.
 

FranckB

Member
Thanks, I just looked on the ffmpeg site.
I found the syntax but I don't know if it works in OBS... I manage to save with the following parameters:
-bf 2 (for b-frames)
-g 240 -bf 2 (for interval and b-frame)

I don't know if the parameters are taken into account or not!
 

FranckB

Member
I think "-bf 2" works because a 20s capture without this parameter gives a 25% bigger video...

if someone knows about additional parameters for the H264 (h264_amf (libx264)) I'm interested.

If not, what is the b-frame value used by default in the FFmpeg advanced output settings? dynamic?

Why is the b-frame parameter not available in FFmpeg output, although it is available in standard output?
 

koala

Active Member
Where OBS isn't offering any explicit option, it's using the ffmpeg internal default. In my opinion, you're wasting your time. All those encoders and their settings are years old, are present in ffmpeg for years, and people had years of time to tune the all the parameters. The current defaults are the result from years of experience. They would not be the default, if they were not the best settings. So use the defaults. So don't use ffmpeg custom output but instead advanced output mode and use the amd encoder given there. It's the same encoder as in ffmpeg custom output with the only difference that those parameters are exposed that one might need to adjust, if necessary.

If you want to learn how parameter changes work out for a real video, don't use OBS for testing. Instead, create (with OBS) a lossless recording of some example, then use ffmpeg.exe directly to use the lossless example as source and try and vary parameters and recode the example to some compressed video. This way you have exactly the same video to compare for all your tests. You will learn that video will generally look worse if you change parameters from the default (except of course for bitrate, preset and quality parameters, which are of course exposed by OBS in advanced output mode).

There is no hidden setting that will magically double the quality. If such setting exists, it would be made default.
 

sandrix

Member
I agree with the previous answer. Sir, you should not use ffmpeg in obs, those are pro settings. You must clearly understand what each parameter is responsible for and understand video encoding. Believe me, advanced settings are enough.

However, if you want to understand, then the parameters should be specified through the = sign
For example: preset=quality profile=high rc=cbr g=120 enforce_hrd=1 vbaq=1 bframes=2

You will need special professional programs for video data analysis. I am using Elecard StreamEye.
and some of them do not work in OBS

UPD: The best has already been added to AMD HW H.264 default settings
Regular users don't need all this.

As for b-frames, they only work for h.264 on AMD video cards with RDNA 2.0 architecture. This is RX6000-7000 series.

RX 6600 XT
2022-10-31_163351.jpg
 
Last edited:

FranckB

Member
thank you for this wise reflection.
True, maybe I should go back to the non-advanced settings. I had come to this because several versions back, the default settings were not satisfactory; having done research, tests, the advanced parameters give me greater satisfaction

Today with version 28.0.3, the standard parameters are too resource intensive with the AMD HW H.264 encoder (warning OBS message)
The AMD HW H.265 (HEVC) encoder is less resource intensive (no OBS message) but I see GOPs...hence the b-frame to set and the keyframe interval. (H.265 is not present in advanced setting)

In advanced, the h264-amf (libx264) encoder is less resource intensive, but does not provide access to the b-frame parameter. Maybe this parameter is very well managed by the encoder itself. (or else it's useless to me!)

i9/32GB Ram/Fast SSD/TH3/AMD VEGA 20 4GBHBM2
encoding remains a resource-intensive activity that requires many tests.

These questions are consecutive to my curiosity, to a desire to understand and to want to master what I do; and don't blindly use OBS. The process matters just as much as the result.

So yes I will go back to the standard and I will redo the tests.
If you have recommendations on the standard parameters (choice of encoder, Keyframes, b-frame) I'm interested.

Thank you for your help and your answers. I will study this for my own knowledge.
 

sandrix

Member
If you are experiencing encoder overload when using H.264, then you should set the variable preanalysis=0
This will disable 2-pass encoding and reduce the load on the encoder by 10%. This is a minor sacrifice in quality, but justified in terms of performance.

B-frames are disabled by default, they must be specified. But, your video card does not support them. Architecture: GCN 5

AMD HW H.265 (HEVC) is significantly more resource efficient and provides higher quality, especially in dynamic video fragments. Use it if you are recording video. AMD HW H.265 does not support b-frames.
 

FranckB

Member
Thank you for your reply !
I don't stream. Only video screen capture (software for training/courses) What speed do you recommend for a capture in 2060p (200%)@30fps?
 

sandrix

Member
Maybe you meant to say 2160p (4K). It all depends on what quality you want to get and the final file size. For desktop recording, I would prefer to use the lossless recording method, but it is not offered, so you can specify CQP 1.

If you want a more predictable file size, then you should use CBR, from 12500 kbps. Ideally, this is 25000 kbps, which corresponds to 0.1 BPP for 4K 30 fps.
 
Last edited:

FranckB

Member
Thank you all for your insightful responses.
However, by switching to advanced (FFmpeg) and using h264_amf, the resources used are low for a very good capture quality; standard settings use too many resources (quality is also good); except to find a standard setting that suits me I stay advanced without entering any parameter for the encoder.
What seems curious to me is not having the H265_amf in advanced, except to activate the unsupported encoders...
As for 60fps, I think it's not useful (much like 4K) for my case. Choices to be made between 1080p@60fps or 2160p@30fps... the truth may be 1080p@30fps!
and Nvidia cards may be better...
To be continued.
 

FranckB

Member
After multiple tests, I have the choice between two settings that suit me:
1. "Simple" Mode, AMD HEVC, Indistinguishable Quality, Large File Size

2. "Advanced" mode "Standard" type, AMD HW H.265 (HEVC) encoder, while adjusting the key frame rate and interval.

And I'll stick with 30fps at 4K 200% - lower resolutions don't give nice captures.
4K@60fps overloads the PC, and I don't think 60fps is useful.

One question: Should I use the AMD H264 or HEVC hardware encoder?

I will give you feedback on the use of mode 1. (with OBS version 28.1)
Because behind, there is also the post production... and therefore the work on the captures which can penalize the fluidity of the timeline depending on the encoding...
 

FranckB

Member
Feedback from today.
OBS to record is set to simple settings with AMD HEVC. (4K 200% @30fps) 12 files, 2.19 GB, 1H44min, MKV container
It's very good! few resources, good file size.
And the post prod is working fine so far.

Thanks again for your advice.
OBS 28.1.1
 
Top