Verbose error reporting on setting custom field values #16

Merged
kryztoval merged 2 commits from v0.4-custom-field-reporting into v0.4 2019-11-11 19:48:13 +01:00
kryztoval commented 2019-11-08 22:29:45 +01:00 (Migrated from github.com)

Description

source/encoder.cpp: Added a call to convert error number into meaninnful text, showed this error for every failed custom field passed, also shows every successfully set custom field passed.

15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc] Initializing...
15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc]   Video Input: 1920x1080 nv12 BT.601 625 Partial
15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc]   Video Output: 1920x1080 nv12 BT.601 625 Partial
15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc]   Framerate: 120/1 (120.000000 FPS)
15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc]   Custom Settings: -gpu=1 -trouble=true
15:22:08.000: [obs-ffmpeg-encoder] Option 'gpu' set to '1'.
15:22:08.000: [obs-ffmpeg-encoder] Option 'trouble' could not be set to 'true'. (Option not found)
15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc]   Preset: default
15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc]   Rate Control: cbr_hq
15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc]     Two Pass: Default
15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc]     Lookahead: 0 Frames
15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc]   Buffer Size: 12000
15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc]   Bitrate Target: 6000
15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc]   Spatial AQ Enabled: Strength 8
15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc]   Temporal AQ Enabled
15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc]   B-Frames: 2
15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc]     Reference Mode: disabled
15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc]   H.264 Profile: high

Motivation and Context

Trying to find out what settings were set and which ones were not set is a long trial and error proccess, this should help remove the guess work out of using the custom field parameters.

How Has This Been Tested?

I have used those changes in a local OBS setup

Types of changes

New feature

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
### Description source/encoder.cpp: Added a call to convert error number into meaninnful text, showed this error for every failed custom field passed, also shows every successfully set custom field passed. ``` 15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc] Initializing... 15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc] Video Input: 1920x1080 nv12 BT.601 625 Partial 15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc] Video Output: 1920x1080 nv12 BT.601 625 Partial 15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc] Framerate: 120/1 (120.000000 FPS) 15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc] Custom Settings: -gpu=1 -trouble=true 15:22:08.000: [obs-ffmpeg-encoder] Option 'gpu' set to '1'. 15:22:08.000: [obs-ffmpeg-encoder] Option 'trouble' could not be set to 'true'. (Option not found) 15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc] Preset: default 15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc] Rate Control: cbr_hq 15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc] Two Pass: Default 15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc] Lookahead: 0 Frames 15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc] Buffer Size: 12000 15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc] Bitrate Target: 6000 15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc] Spatial AQ Enabled: Strength 8 15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc] Temporal AQ Enabled 15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc] B-Frames: 2 15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc] Reference Mode: disabled 15:22:08.000: [obs-ffmpeg-encoder] [h264_nvenc] H.264 Profile: high ``` ### Motivation and Context Trying to find out what settings were set and which ones were not set is a long trial and error proccess, this should help remove the guess work out of using the custom field parameters. ### How Has This Been Tested? I have used those changes in a local OBS setup ### Types of changes New feature ### Checklist: - [x] My code has been run through [clang-format](https://github.com/obsproject/obs-studio/blob/master/.clang-format). - [x] I have read the [**contributing** document](https://github.com/obsproject/obs-studio/blob/master/CONTRIBUTING.rst). - [x] My code is not on the master branch. - [x] The code has been tested. - [x] All commit messages are properly formatted and commits squashed where appropriate.
Xaymar (Migrated from github.com) requested changes 2019-11-10 08:16:47 +01:00
@@ -1003,8 +1003,9 @@ bool obsffmpeg::encoder::update(obs_data_t* settings)
if ((ret = av_opt_set(_context, key.c_str(), value.c_str(),
Xaymar (Migrated from github.com) commented 2019-11-10 08:16:44 +01:00

No need to log setting options as a warning, we only need to know when things haven't been set. Remove this part.

No need to log setting options as a warning, we only need to know when things haven't been set. Remove this part.
kryztoval (Migrated from github.com) reviewed 2019-11-10 08:35:47 +01:00
@@ -1003,8 +1003,9 @@ bool obsffmpeg::encoder::update(obs_data_t* settings)
if ((ret = av_opt_set(_context, key.c_str(), value.c_str(),
kryztoval (Migrated from github.com) commented 2019-11-10 08:35:47 +01:00

I kinda like when it shows what was actually applied from the list that was passed, because it may get stick together. What if I leave it commented out (the whole else) so if needed for debugging it can be enabled. No?

I kinda like when it shows what was actually applied from the list that was passed, because it may get stick together. What if I leave it commented out (the whole else) so if needed for debugging it can be enabled. No?
Xaymar (Migrated from github.com) reviewed 2019-11-10 11:34:52 +01:00
@@ -1003,8 +1003,9 @@ bool obsffmpeg::encoder::update(obs_data_t* settings)
if ((ret = av_opt_set(_context, key.c_str(), value.c_str(),
Xaymar (Migrated from github.com) commented 2019-11-10 11:34:52 +01:00

No, if you were debugging you would already have knowledge about it anyway (FFmpeg logs to the debug output if enabled). For an end user, only the failed options need to be known.

No, if you were debugging you would already have knowledge about it anyway (FFmpeg logs to the debug output if enabled). For an end user, only the failed options need to be known.
Xaymar (Migrated from github.com) approved these changes 2019-11-11 19:47:09 +01:00
Sign in to join this conversation.