SYNTAX for x264/NVENC "Video Enconder Settings" field (Custom Output FFMPEG)

cadudesun

New Member
Hi, I'd appreciate your help.

For recording WAV audio I was led to use Output>Recording>Type "(Custom Output FFMPEG)"

While I could set the audio, the field "Video Enconder Settings" is empty because I don't know how to deal with FFmpeg syntax for x264 (libx264) and NVENC (h264_nvenc libx264).

Does anyone know how to "translate" to the FFmpeg syntax the following settings from OBS standard interface (attached snapshots)?

Thank you very much
Cadu

-----------------------
a.1) x264 (CRF)
CRF: 15
Keyframe Interval: 0
CPU Usage Preset: veryfast
Profile: High
Tune: Not set (My usage is for screencast/instructional videos, would any option in "tune" be worth setting?)

a.2) x264 (CBR)
CBR: 5500 kbps
Keyframe Interval: 0
CPU Usage Preset: veryfast
Profile: High
Tune: Not set

b.1) NVENC (CQP)
CRF: 12
Keyframe Interval: 0
Preset: Quality
Profile: High
Look-ahead: OFF
Psycho Visual Tuning: OFF
GPU: 0
Max B-frames: 2

b.2) NVENC (CBR)
CBR: 5500 kbps
Keyframe Interval: 0
Preset: Quality
Profile: High
Look-ahead: OFF
Psycho Visual Tuning: OFF
GPU: 0
Max B-frames: 2

1620255679734.png
 

rockbottom

Active Member
Here's the settings I'm currently using for NVENC HEVC with 24/48 PCM audio. Some of the commands will not work with H264 but this should help point you in the right direction, just make adjustments as needed. If a command is not accepted by the encoder it will show up in the OBS log. Also, my system is stable so I'm using the QuickTime container without fail. If you have any concerns about potentially losing a recording due to system crash/power loss, ect., use the mkv container.

preset=hq profile=main tier=high rc=constqp rc-lookahead=32 init_qpI=15 init_qpP=18 init_qpB=20 bf=2 b_ref_mode=middle

Custom FFmpeg Recording.JPG
 

koala

Active Member
To understand the custom ffmpeg output options, you need to understand some ffmpeg concepts. Ffmpeg has:
  • options for the container/for muxing (mkv/mp4/etc.-specific options not related to audio and video)
  • options for video encoder (on command line the options after -c:v)
  • options for audio encoder (on command line the options after -c:a)
In OBS, you have 3 different input fields for the 3 option types:
  • In "Muxer Settings (if any)" you enter the muxer/container-specific settings
  • In "Video Encoder Settings (if any)" you enter video-encoder specific options, i. e. the ones you enter after -c:v on the ffmpeg command line
  • In "Audio Encoder Settings (if any)" you enter audio-encoder specific options, i. e. the ones you enter after -c:a on the ffmpeg command line
Additionally, some of the options are given elsewhere, for example the bitrate for bitrate-oriented rate controls. There is an extra input field for this, you don't use the ffmpeg command line option for the bitrate, as well for the audio bitrate. You see these options as input fields in the OBS configuration dialog.

So, if you want to design your custom ffmpeg output option set, first divide your ffmpeg options into the 3 categories above. Then enter the values in the correct option field. Options not related to to audio, video or muxing cannot be used, for example debugging output.

Another remark: OBS doesn't seem to be able to output video only or audio only. You always have to output to a container format capable of holding both audio and video, and you always have to give an audio encoder as well as a video encoder that fits into the given container (not all containers are able to hold data from every encoder! Only the mkv container is able to contain almost everything).

You want other people research and give you the options for OBS for free, so you don't need to do this yourself, but I doubt you will be successful without consulting the ffmpeg manual yourself:
Audio and video: https://ffmpeg.org/ffmpeg-codecs.html
Muxer: https://ffmpeg.org/ffmpeg-formats.html
 

cadudesun

New Member
Thank you all for the replies and directions!
I will engage on learning ffmpeg.
Meanwhile, in the short-term, if there are people who know how to write those syntaxes, I'd be glad to pay for your service.
Please, send me a private message.
Cheers,
Cadu
 

mzso

New Member
In OBS, you have 3 different input fields for the 3 option types:
  • In "Muxer Settings (if any)" you enter the muxer/container-specific settings
  • In "Video Encoder Settings (if any)" you enter video-encoder specific options, i. e. the ones you enter after -c:v on the ffmpeg command line
  • In "Audio Encoder Settings (if any)" you enter audio-encoder specific options, i. e. the ones you enter after -c:a on the ffmpeg command line
I would like to record full range RGB with utvideo. But these don't provide access to it, right?
To get non borked outputs with ffmpeg I need to specify -color_range pc.
And also a bunch of other thing like
-pix_fmt yuv444p -vf scale=out_color_matrix=bt709:out_range=pc -color_range pc -colorspace bt709 -color_primaries bt709
if I use a yuv format. (FFmpeg insists on producing borked video unless you overspecify stuff...)

So by the looks of it these definitely don't belong tot the video/audio section, and probably not in the muxer section as well (I never used muxing options of ffmpeg as far as I remember.)

So can I set OBS to record full range video without subsampling (preferably rgb because its faster), which I can then re-encode into a format of my choosing for storage.
 

koala

Active Member
For full range rgb utvideo, set color format rgb and color range full in settings->advanced->video. Then choose simple output mode in settings->output->output mode with recording quality "lossless quality, tremendously large file size". This will result in utvideo video with such properties according to MediaInfo, which is probably exactly what you want:

1640642975345.png


Keep in mind this is an insanely high bitrate, so the only device capable of writing a sustained bitrate this high is a SSD. No spinning disk.
 

mzso

New Member
For full range rgb utvideo, set color format rgb and color range full in settings->advanced->video. Then choose simple output mode in settings->output->output mode with recording quality "lossless quality, tremendously large file size". This will result in utvideo video with such properties according to MediaInfo, which is probably exactly what you want:



Keep in mind this is an insanely high bitrate, so the only device capable of writing a sustained bitrate this high is a SSD. No spinning disk.
Thanks. I will, try it.
Does it only work in simple mode?
 

koala

Active Member
You can reproduce every setting from simple mode in advanced mode or ffmpeg output mode. The settings for h.264-encoded video can be extracted from the OBS logfile after you recorded something in simple mode. Only the utvideo settings used for lossless are not visible. You have to work out these settings for ffmpeg output mode yourself by looking at existing videos with MediaInfo or ffprobe and consulting the ffmpeg manual how to create the corresponding video properties.
To get yuv444, use i444 color format.
 

mzso

New Member
Thanks!
To get yuv444, use i444 color format.
You mean like "-pix_fmt i444", but where do I add this?
It's not a video codec specific option within ffmpeg and certainly not a muxer option.
(By the way, with libx264 and vp9 I had to use "-pix_fmt yuv444p" to get 4:4:4 otherwise it wouldn't work.)
 

mzso

New Member
I mean settings->advanced->Color Format->i444. This will get you yuv format with chroma subsampling 4:4:4 in the resulting video.
I played around a bit with utvideo. Only RGB works properly. At least one thing is wrong. The video is specified to be limited range (shows up in madVR as "limited range: says upstream") even though it is actually full range. And I see no way to effect how OBS does this. (it would be "-color_range pc" in ffmpeg.)

Not sure sure about colormatrix and such. MadVR shows it as bt.709, but judging by the range setting it's not certain that it is the matrix actually used.
 
You want other people research and give you the options for OBS for free, so you don't need to do this yourself, but I doubt you will be successful without consulting the ffmpeg manual yourself:
Audio and video: https://ffmpeg.org/ffmpeg-codecs.html
Muxer: https://ffmpeg.org/ffmpeg-formats.html
What the F*k dude, you couldn't help a new user with a simple questions on particular Syntax, something Simple I'm sure would have suffice other than "Google it"....Sheez Man!!
 

PaiSand

Active Member
What the F*k dude, you couldn't help a new user with a simple questions on particular Syntax, something Simple I'm sure would have suffice other than "Google it"....Sheez Man!!
Calm down, don't be disrespectfull. You're answering to an 1 year old answer post. People always ask for a solutions they're not willing to look for. This is a fact, not an opinion. Pointing someone into the right direction to find a solution it's a good thing.
Or you can pay someone to do all this for you.
 

koala

Active Member
What the F*k dude, you couldn't help a new user with a simple questions on particular Syntax, something Simple I'm sure would have suffice other than "Google it"....Sheez Man!!
Please keep in mind this is a forum with all volunteer helpers. I linked the manual, but I will not read it for you, because that's your task if you need the answer. It's not that I know the exact answer and just refuse to give the wanted options to make you angry, it's that I don't know myself exactly what option values to use.

To work these out, I would have to consult the manual myself, and after one or two hours of work I would have them. It's a matter of research, trial and error, not a matter of "something simple" and "just look it up".
But since this is no paid job, just my hobby free time, and I don't have personal use of these options for my own purpose, I will not do this. There were other interesting questions in the past here in the forum, where I was actually curious for the answer, so I started working on them for a whole evening. But the questions here in this thread were not that interesting beyond what I already posted.
 

Fisherkid_07

New Member
What the F*k dude, you couldn't help a new user with a simple questions on particular Syntax, something Simple I'm sure would have suffice other than "Google it"....Sheez Man!!
I totally get what you mean bro, like when I'm trying to find a simple answer to something and reddit or whatever decides to like either tell me in wrong for trying to do the thing or just doesn't provide an answer can be super annoying. But like these guys here were trying to help (successfully i think) in a way that not only gets them to the answer they were looking for but kind of helps them learn how a lot of this stuff works so they'll have a better overall understanding which is good for if they need help with similar stuff in the future. I do get that sometimes its annoying asf cuz you just want an answer to your question and like, they could definitely do that but like you can't hate on them for providing a bunch of info and an example and like absolutely helping out. Also I will say that I'm glad they answered the question like that instead of just figuring out the translation to obs format and posting it because now, I found this looking for an answer to a kind of similar question and now I've got a ton of stuff to help me out and answer my question! Which is dope cuz for the most part the rest of google is *tarded (idk if i can say that) asf and not this helpful.
 
Top