Commit Graph

84 Commits (0a218e06b7601c0e561db518b1b5878557cd1ebc)

Author SHA1 Message Date
jpark37 8e2e1e212c obs-x264: Convey lack of Rec. 2100 support 2022-05-28 08:36:18 -07:00
jpark37 4e35e3402b obs-x264: Restore video encoder name to log 2022-05-06 20:41:15 -07:00
jpark37 2f3c25b544 obs-x264: Disallow HDR attempts gracefully
Replace crash with standard recording failure dialog, and log message.
2022-05-06 14:41:39 -07:00
jp9000 6534bf5834 obs-x264: Move options parser to its own lib 2021-10-25 12:24:16 -07:00
jpark37 abf6a97ca9 obs-x264: Set CRF value conditionally
Matches value seen when encoding with FFmpeg.
2021-03-30 03:17:38 -07:00
jpark37 dd552df15c obs-x264: Set sample aspect ratio to 1:1
Matches values seen when encoding with FFmpeg.
2021-03-30 03:17:38 -07:00
jpark37 a52562a98e obs-x264: Set timebase
Matches values seen when encoding with FFmpeg.
2021-03-30 03:17:38 -07:00
Jim b32abbe33f
Merge pull request #3083 from pkviet/srtfix4
UI: Enable sps/pps (video headers) repetition (for srt/mpegts)
2020-10-30 23:25:24 -07:00
jpark37 b6afaceeae Update VIDEO_CS_DEFAULT to mean 709 instead of 601
Consistent with modified default UI setting.
2020-09-06 20:51:28 -07:00
Shaolin 420823bfaa plugins: Clear compile warnings on Linux 2020-08-26 01:34:03 -03:00
pkv 915379a99d obs-x264: Allow repeat_headers and annexb parameters to be set
The repeat_headers parameter is currently hard-coded to false and can
not be changed.
For mpegts container and allow better compatibility with broadcast
mpegts decoders, it is mandatory to repeat the sps/pps headers
regularly.
This commit enables this parameter to be set either by the user or the
service (ex: udp or srt w/ mpegts container).
The b_annexb enables compatibility with Annex B bitstream which is
better for streaming formats than avcc.
2020-08-23 11:10:09 +02:00
Jim f6ce8f2a32
Merge pull request #2942 from strager/x264-options
obs-x264: Log when options are ignored
2020-08-17 05:24:00 -07:00
jpark37 de4743e16b obs-x264: Improve color space handling
Add support for VIDEO_CS_SRGB.

Use SMPTE 170M for 601 instead of undef. This is the American/Chromium
way of handling 601.
2020-07-18 19:44:13 -07:00
Matthew Glazar 601aa3ffb1 obs-x264: Log ignored options
When an x264 option doesn't include a "=", it is silently ignored. This
is frustrating for users. Log when part of the options string is
ignored.

Aside from logging, this commit should not change behavior.
2020-05-17 15:08:39 -07:00
Matthew Glazar 6190ba250d obs-x264: Log only options given to libx264
The "custom settings" log message is misleading. It simply echoes the
user-given string, but does not reflect the options given to libx264 or
handled by obs-x264 itself. Change the log message to omit skipped
options.
2020-05-17 15:08:38 -07:00
Matthew Glazar 40b4e32c41 obs-x264: Refactor tokenizing of options
We do a bad job of handling errors in user-supplied x264 options. I want
to improve our error handling. To make my job easier, move the code for
parsing the x264 options string into its own function. Also, add some
tests for the functionality.

Aside from a minor tweak to a log message for the opencl option, this
commit should not change behavior.
2020-05-17 15:08:34 -07:00
Clayton Groeneveld 4e3a0180ba libobs, obs-x264: Fix compiler warnings 2020-01-21 15:18:09 -06:00
jp9000 6863140381 obs-x264: Do not display log messages every update
Prevents log spam when dynamic bitrate is used
2019-08-22 16:21:59 -07:00
jp9000 806ab5a022 libobs: Mark encoders that support dynamic bitrate
(This commit also modifies mac-vth264, obs-ffmpeg, obs-qsv11, and
obs-x264)
2019-08-18 03:14:38 -07:00
jp9000 15ade1e2c4 obs-x264: Do not show reconfigure details in log
Prevents the x264 plugin from spamming the log when dynamic bitrate is
active.
2019-08-18 03:14:38 -07:00
jp9000 f53df7da64 clang-format: Apply formatting
Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed.  Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
2019-06-23 23:49:10 -07:00
Clayton Groeneveld 31b73f8025 UI: Add ability to set properties spinbox suffix 2019-05-02 08:54:14 -07:00
Clayton Groeneveld 1160ee767a UI: Increment bitrates by 50 2019-04-30 06:54:02 -05:00
jp9000 3caf5d04d3 Revert "obs-x264: Specify x264 color space for BT.601"
This reverts commit 958167c4f7.

This caused certain transcoders (specifically Twitch's transcoders) to
misinterpret the data and transcode the video incorrectly.
2018-06-24 15:42:53 -07:00
Bjorn 958167c4f7 obs-x264: Specify x264 color space for BT.601
Back in an older commit, the default YUV colorspace was changed to 601
in order to ensure correct playback in video players that ignore the
contents of the H264 header.
x264's "undef" is unfortunately not what players that don't ignore the
header expect for BT.601, resulting in incorrect colors when played
back. Setting it to "bt470bg", similar to what is specified in ffmpeg
outputs, remedies this issue.
2018-06-08 14:40:13 +02:00
jp9000 7ec07cf82d obs-x264: Remove VFR mode as an advanced option
VFR encoding mode was originally added experimentally, but in truth,
it's nothing but a detriment because it can cause wild bitrate
fluctuations.  It's still a constant framerate even when VFR mode is on
anyway.
2017-08-05 21:22:51 -07:00
jp9000 e230f77311 obs-qsv11, obs-x264: Allow bframe count overriding
Allows the ability to override bframes (useful for specific protocols)
2017-07-14 12:39:20 -07:00
jp9000 bf9048a1a4 obs-x264: Allow opencl through much longer alias
Due to the fact that people follow terrible guides that ignorantly
recommend opencl, the "opencl" custom x264 option was blocked.  However,
because some people still apparently want to use it, it's being renamed
to "opencl_is_experimental_and_potentially_unstable" so that anyone who
uses this option realizes that they should probably think twice about
using the option rather than just follow some terrible guide that tells
them to use it.
2017-01-16 13:22:04 -08:00
derrod dad1e3a01b obs-x264: ignore opencl param
Silently ignores opencl parameter for x264 to protect users
following bad youtube guides.
2017-01-12 07:27:23 +01:00
John Bradley 26ec2dee44 obs-x264: Fix default value type of rate_control 2016-07-22 13:30:20 -05:00
SuslikV 2d2ca06f6d obs-x264: Don't show buffer size if buffer size off
Whether buffer size is visible is determined by the value of the "Use
buffer size" property (the "use_bufsize" setting).

(Commit edited and formatted by Jim: separated this code from the
previous commit, and gave it a proper commit message)

Closes jp9000/obs-studio#567
2016-07-18 07:18:38 -07:00
SuslikV 2fb1d18056 obs-x264: Fix settings string typo
This is why macros should be used for settings strings.

(Commit edited and formatted by Jim: separated this code from the
following commit, and gave it a proper commit message)

Closes jp9000/obs-studio#567
2016-07-18 07:14:29 -07:00
jp9000 f16a1b1aef obs-x264: Default to CBR if no other RC specified
This had the possibility of leaving the rc variable uninitialized.
2016-05-26 08:13:22 -07:00
jp9000 7f1cabd81b obs-x264: Add rate control, deprecate "use cbr" setting
Instead of having a "cbr" setting that turns CBR on and off, adds a
"rate_control" parameter that sets the rate control method, which can be
one of the following: CBR, ABR, VBR, CRF.

If the "cbr" setting is used, it will throw a deprecation warning to the
log.
2016-05-11 13:12:31 -07:00
jp9000 ddcf2436c1 obs-x264: Adjust log message
Use the actual parameter from the x264 params for CRF, and also make
sure to specify that CRF is meant to be 0 if CBR is enabled.
2015-09-19 09:42:24 -07:00
jp9000 606a0fc695 obs-x264: Log CRF value 2015-09-19 08:20:18 -07:00
jp9000 6285a47726 (API Change) libobs: Pass type data to get_name callbacks
API changed from:
obs_source_info::get_name(void)
obs_output_info::get_name(void)
obs_encoder_info::get_name(void)
obs_service_info::get_name(void)

API changed to:
obs_source_info::get_name(void *type_data)
obs_output_info::get_name(void *type_data)
obs_encoder_info::get_name(void *type_data)
obs_service_info::get_name(void *type_data)

This allows the type data to be used when getting the name of the
object (useful for plugin wrappers primarily).

NOTE: Though a parameter was added, this is backward-compatible with
older plugins due to calling convention.  The new parameter will simply
be ignored by older plugins, and the stack (if used) will be cleaned up
by the caller.
2015-09-16 09:21:12 -07:00
jp9000 c8d5058f1d obs-x264: Add option to use variable framerate
This just changes the x264 encoder settings; it doesn't actually change
the framerate of OBS.  OBS will always output at a constant framerate
regardless of whether this option is on or off; this just changes how
the encoder encodes the data.
2015-07-16 15:45:33 -07:00
jp9000 a9c769897d obs-x264: Add separator to logging 2015-07-06 17:03:41 -07:00
jp9000 62b2d60580 obs-x264: Call video info func to get format
Call the video information function to determine the video format that
needs to be used to prevent having to use the same code in the update
function.
2015-04-17 20:17:45 -07:00
jp9000 f7f79cc689 obs-x264: Add support for YUV 4:4:4 encoding 2015-04-17 20:17:44 -07:00
jp9000 4d002f588b (API Change) Remove encoder callback boilerplate
API Changed (in struct obs_encoder_info):
----------------------------------------
bool (*get_audio_info)(void *data, struct audio_convert_info *info);
bool (*get_video_info)(void *data, struct video_scale_info *info);

To:
----------------------------------------
void (*get_audio_info)(void *data, struct audio_convert_info *info);
void (*get_video_info)(void *data, struct video_scale_info *info);

The encoder video/audio information callbacks no longer need to manually
query the libobs video/audio information, that information is now passed
via the parameter, which the callbacks can modify.

The refactor that reduces boilerplate in the encoder video/audio
information callbacks also removes the need for their return values, so
change the return types to void.
2015-04-17 20:17:43 -07:00
jp9000 2149817af7 obs-x264: Set lower buffer size limit to 0
0 is a common value used for recording.
2015-02-10 19:32:35 -08:00
jp9000 8db480416d obs-x264: Add "(None)" option for preset/tune 2015-02-04 16:52:01 -08:00
jp9000 398ae3e288 obs-x264: Use more common defaults
I feel like it's important to use simple defaults just in the case that
users might be confused about the encoder settings.
2015-02-04 16:52:01 -08:00
jp9000 0aec530e23 obs-x264: Set bitrate/bufsize max to 10 mil.
The max bitrate for the property was 100000 before, which felt a bit
low.  Might as well have a super high upper limit of 10 million.
2015-02-04 16:51:57 -08:00
jp9000 6682f79d4a obs-x264: Add more properties
Add CBR, CRF to properties so that it can be changed by the user.  If
CBR is on, CRF will be disabled.  Also added a 'Use Custom Buffer Size'
option to make it so that the buffer size will automatically be set to
the bitrate if its value is false.  This is primarily a convenience
feature for users.
2015-02-04 16:51:57 -08:00
jp9000 3259a6831b obs-x264: Fix color space/range not being set
I originally had it set the color space and color range in the video
info callback, but I forgot that it's a function that's called after the
encoder is initialized.  You can change the color space and color range,
but you have to reconfigure the encoder, and there's no real reason to
do that.
2015-01-03 02:37:19 -08:00
jp9000 35d7a9ff1f obs-x264: Set x264 to use the cur. set cs/range
This causes x264 to use the currently set color space and color range
of the video media.  This helps prevent issues with decoding where the
colors wouldn't look right due to the fact that these settings were
never specified to x264, and prevents darkness and brightness from
looking washed out due to a potentially incorrect color range.
2014-12-11 20:06:54 -08:00
Palana 94a93abb2b (API Change) Pass data to get_properties when possible 2014-10-01 15:39:57 +02:00