0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00
Commit Graph

66 Commits

Author SHA1 Message Date
jpark37
79059153e8 obs-ffmpeg: Fix old NVENC ignoring Max B-frames 2022-05-07 01:33:05 -07:00
tytan652
ce62240530 obs-ffmpeg: Fix compiler warnings
* obs-ffmpeg: Fix format-overflow warning

* obs-ffmpeg: Fix unused-parameter warnings
2022-05-04 01:37:10 -07:00
jpark37
9677ad1876 obs-ffmpeg: Add I010/P010 as formats for old NVENC
Avoids fallback to NV12, crushing 10-bit into 8-bit.
2022-04-29 12:34:56 -07:00
jpark37
01a806cb53 obs-ffmpeg: Add HEVC support to NVENC 2022-04-28 08:59:53 -07:00
jp9000
c5e328e359 obs-ffmpeg: Refactor FFmpeg video encoders
This reduces code duplication between the different FFmpeg-based video
encoder implementations
2022-04-22 12:51:38 -07:00
jpark37
59dbc3eb81 libobs: Rename Rec. 2020 to Rec. 2100
Rec. 2020 is really an SDR spec, but I think HDR10 made it okay to slap
PQ on it, call it an HDR spec. Rec. 2100 came along after and formally
allowed the use of PQ/HLG, so we should use 2100 instead.
2022-04-10 00:13:52 -07:00
wangshaohui
db8145e8a2 obs-ffmpeg, win-dshow, deps/media-playback: Use recommended API for AVCodecContext 2022-04-07 01:59:30 -07:00
jpark37
4c2aa58dbe obs-ffmpeg: Support Rec. 2020, I010/P010 formats
Also remove unused function, ffmpeg_to_obs_video_format.
2022-04-03 00:03:34 -07:00
Norihiro Kamae
ba68eda590 obs-ffmpeg: Use av_packet_alloc instead of av_init_packet
sizeof(AVPacket) being a part of the public ABI is deprecated. once
av_init_packet() is removed, new packets will only be able to be
allocated with av_packet_alloc().
In ffmpeg-mux, ffmpeg-vaapi, and obs-ffmpeg-nvenc, AVPacket is allocated
at the initialization to avoid frequent allocation of AVPacket.

Includes changes to win-dshow.
2022-03-24 17:19:40 -07:00
Ryan Foster
08547a1696 obs-ffmpeg: Include avcodec header for AVCodecContext
FFmpeg commit e67e02d15672 [1] drops avcodec.h from avformat.h includes.
Therefore we need to include it explicitly.

[1]: e67e02d156
     lavf/avformat.h: drop the avcodec.h include
2021-11-21 11:30:02 -05:00
Clayton Groeneveld
af6c719139 UI, libobs, obs-plugins: Fix compiler warnings
Found warnings when compiling OBS.
2021-11-04 06:25:52 -07:00
Richard Stanway
1444ead812 Revert "obs-ffmpeg, obs-qsv11: Disable dynamic bitrate support"
This reverts commit 1b29bfc884.
2021-08-23 18:26:37 -07:00
Richard Stanway
1b29bfc884 obs-ffmpeg, obs-qsv11: Disable dynamic bitrate support
Unfortunately these encoders tend to crash or freeze after after
multiple bitrate changes. Users with dynamic bitrate enabled
experience a random encoder freeze which manifests as OBS dropping to
0kb/sec and disconnecting and it's not at all obvious that dynamic
bitrate is the cause. Disable it for now until we can figure out if
there is any workaround or bug on our end.
2021-08-20 14:51:16 -07:00
jpark37
ba3eb46bf9 obs-ffmpeg: Add missing return statement 2021-06-07 22:14:38 -07:00
jpark37
a8414a09cc obs-ffmpeg: NVENC usage fixes
Only use lossless encode if the capability is supported.

Set qpPrimeYZeroTransformBypassFlag to 1 for lossless.

Do not set profileGUID for lossless.

For both NVENC implementations, retry with a heavier reset because both
are unable to recover from failure lightly.
2021-06-07 21:43:58 -07:00
jpark37
07084de805 obs-ffmpeg: Support lack of Psycho Visual Tuning
For new NVENC, warn if PVT is requested, but unsupported by the GPU.
Also retry without PVT on failure to try to catch bad cominbations.

For old NVENC, if PVT is enabled when FFmpeg failure occurs, retry
without PVT.
2021-06-06 11:05:04 -07:00
Kurt Kartaltepe
1064cd26f1 obs-ffmpeg: Expose psycho-aq setting
This was changed to default on but is not exposed for ffmpeg nvenc.
Where cards without temporal AQ support will fail to initialize and we
cannot do checks beforehand. This exposes the parameter to allow users
to disable this feature when using the ffmpeg implementation.
2021-04-10 14:49:40 -07:00
jpark37
4404422082 obs-ffmpeg: Replace cast with numeric literal 2021-03-20 12:35:49 -07:00
jpark37
7b983f00e3 obs-ffmpeg: Static analysis warnings
Fix various warnings about variable size.
2021-03-16 20:03:45 -07:00
jpark37
eca916527d obs-ffmpeg: PVT for NVENC fallback
Plumb Psycho Visual Tuning setting into fallback encoder.
2021-03-16 19:05:36 -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
pkv
73ac96ac7c obs-ffmpeg: Allow video headers repetition in IDR and bitstream for jim-nvenc
This commit adds a repeat_headers setting which will allow sps/pps
repetition and AUDs(access unit delimiters) .
Repetition is ensured by h264config->repeatSPSPPS &
h264config->disableSPSPPS;
the two parameters are set by nvenc to true on default.
When video headers repetition is required, we set the second in
jim-nvenc to false so that SPS/PPS are written into bitstream.
The first parameter could be omitted but is exposed since repetition of
video headers might not be required.
When headers repetition is enabled, we also enable AUD to facilitate
decoding.
Typically the video headers repetition will be useful for mpegts and
DVB broadcast decoders.
2020-08-23 11:10:10 +02:00
jpark37
37f01b35f6 obs-ffmpeg: Improve color space handling
Add support for VIDEO_CS_SRGB.

Use SMPTE 170M for 601 instead of undef/BT470BG. This is the
American/Chromium way of handling 601.

Add color metadata to the container file as well via ffmpeg-mux.
2020-07-18 19:44:13 -07:00
Richard Stanway
6fac77b69f obs-ffmpeg: Add error message for non-zero GPU 2020-04-27 01:22:34 +02:00
Richard Stanway
35e218e05b obs-ffmpeg: Add localization for NVENC error messages 2020-04-27 01:22:05 +02:00
Richard Stanway
6b441a180c obs-ffmpeg: Preserve error message from new NVENC
If we fallback to ffmpeg NVENC, the error from new NVENC might still be
present in the encoder structure. Given that this provides a lot more
actionable information to the user, let's use it if possible.
2020-04-26 23:35:28 +02:00
Richard Stanway
15781073dc obs-ffmpeg: Add error text for NVENC AVERROR_EXTERNAL
Since new NVENC still falls back, try to make the error from ffmpeg
NVENC more actionable for users.
2020-04-12 17:35:27 +02:00
Richard Stanway
5e3e9c1f13 obs-ffmpeg: Use new encoder error handling functions 2020-04-12 17:05:19 +02:00
jp9000
113af5344c obs-ffmpeg: Make sure to show FFmpeg NVENC on non-windows 2020-03-18 17:02:56 -07:00
jp9000
11eafbda35 obs-ffmpeg: Mark FFmpeg NVENC as internal
Because we implemented the fallback for rescaling, there's no need to
show FFmpeg NVENC anymore.
2020-02-18 21:37:51 -08: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
ed43de5c75 obs-ffmpeg: Allow FFmpeg NVENC to be reconfigured
Adds the ability to reconfigure FFmpeg's NVENC implementation on the
fly.
2019-08-18 03:14:38 -07:00
jp9000
68a5a40df9 libobs, obs-ffmpeg, win-dshow: Fix FFmpeg 4.0 deprecation
Fixes FFmpeg 4.0 deprecation warnings.
2019-07-29 20:34:13 -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
Gol-D-Ace
f27a00d266 Revert "obs-ffmpeg: Add option to use b-frames as reference"
This reverts commit adf3337d3c.
Currently causing timestamp issues resulting in FPS issues.
2019-03-14 10:05:55 +01:00
derrod
adf3337d3c obs-ffmpeg: Add option to use b-frames as reference
According to nvidia's documentation using b-frames as reference results in
a slight quality improvement with no/negligible performance impact and is
recommended to be enabled by default when using multiple b-frames.
2019-02-20 05:05:12 +01:00
jp9000
e67d04270a obs-ffmpeg: Enable NVENC psycho_aq by default for now 2019-02-13 19:33:39 -08:00
jp9000
0948e8a629 obs-ffmpeg: Mark unused parameter 2019-02-11 17:34:07 -08:00
jp9000
e49bba3292 obs-ffmpeg: Don't expose new settings to old NVENC (yet) 2019-02-11 17:33:17 -08:00
VodBox
81dc78f50f obs-ffmpeg: Use CQP in jim-nvenc properties text 2019-02-10 13:23:05 +13:00
jp9000
8fb36700b2 obs-ffmpeg: Add tooltips for new NVENC settings 2019-02-09 01:12:18 -08:00
jp9000
ecdae0d417 obs-ffmpeg: Disable psycho_aq by default (for now) 2019-02-08 16:16:41 -08:00
jp9000
8b566f3352 obs-ffmpeg: Update NVENC properties and property defaults
Adds VBR rate control mode, adds a lookahead option, adds psycho visual
tuning option, removes level property (now always set to 'auto'),
removes "2pass" option (replaced by new "Max Quality" preset which uses
2pass by default), modifies a few defaults, and updates their locale
text.
2019-02-07 17:00:47 -08:00
jp9000
9c11772682 obs-ffmpeg: Update display name of FFmpeg NVENC encoder 2019-02-07 17:00:47 -08:00
jp9000
530266917d obs-ffmpeg: Use correct function with older FFmpeg vers.
When this was being fixed up, the incorrect function name was used --
however it still compiled because the author was using the newer FFmpeg
version at the time.
2017-12-06 10:10:03 -08:00
jp9000
0d6204c8af Fix a number of MSVC warnings
Fixes a number of warnings with all modules
2017-12-05 13:53:44 -08:00
jp9000
1738adf021 Revert "obs-ffmpeg/nvenc: Remove "default" preset"
This reverts commit d1343dc064.

Apparently people are having issues caused by this specific commit.
Going to temporarily revert for the time being.
2017-05-21 02:54:41 -07:00
BtbN
d1343dc064 obs-ffmpeg/nvenc: Remove "default" preset
The "default" preset is not an actual default, but something Nvidia
decided to just call that way.  It yields the worst quality per bitrate
out of all the presets, for no actual benefits.  The actual FFmpeg
default is the hq one, which yields the best quality, especially when
twopass mode is enabled.

I can't think of a way to keep the "default" preset in a non-confusing
way, and as it gives no known benefits, might as well just remove it
entirely.

(Jim edit: Also made it so that if the settings have it set to
"default", it automatically treats it as "hq")

Closes jp9000/obs-studio#865
2017-03-25 02:08:06 -07:00