Commit Graph

24 Commits (97491ee91afcf2060d92aa03f6cabd9edd6f08a2)

Author SHA1 Message Date
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 aa97534057 obs-ffmpeg: Log why new NVENC might not be used 2020-04-26 23:32:51 +02:00
Richard Stanway 5e3e9c1f13 obs-ffmpeg: Use new encoder error handling functions 2020-04-12 17:05:19 +02:00
jp9000 55d80e82e1 obs-ffmpeg: Fall back to FFmpeg nvenc if recale active 2020-02-18 21:00:30 -08:00
jp9000 eabebd1774 obs-ffmpeg: Fix deadlock with nvenc lookahead
Lookahead requires examining frame data over a large number of frames,
so when pkv added the change to fully reset the encoder when the bitrate
changes, nvenc will invalidate all buffers and basically starts over
from a completely clean slate.

It's possible to make lookahead work when changing the bitrate, but due
to how lookahead seems to works internally in nvenc, it will cause
continually increasing latency every time the bitrate is updated, which
is unideal.

Additionally, when lookahead is enabled, deadlocks can occur when
changing the bitrate in a thread other than the graphics thread.
Currently we allow it to be reset outside of the graphics thread.  From
limited investigating, it would appear this deadlock occurs because
nvenc is locking and releasing old textures.

So instead of dealing with all these potential issues, disable the
ability to adjust bitrate when the user has lookahead enabled on nvenc.
It's not really worth implementing dynamic bitrate support when
lookahead is enabled if the latency is just going to continually
increase for every bitrate adjustment anyway.
2019-10-04 04:39:15 -07:00
pkv adedd967d5 obs-ffmpeg: Use NV_FAILED() instead of FAILED()
The FAILED() macro is for HRESULT values; NV_FAILED() is what should be
used for NVENCSTATUS.
2019-08-24 18:24:28 -07:00
pkv 1a11e15a30 obs-ffmpeg: Force I-Frame when reconfiguring jim-nvenc
This forces an I-Frame when reconfiguring encoding parameters so that
the changes apply immediately.
2019-08-24 18:19: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 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
jp9000 3f3ec4f933 obs-ffmpeg: Fix jim-nvenc initial DTS for fractional FPS
The initial DTS for non-fractional framerates was being incorrectly
calculated.  It assumed that the time base was in frames when it was
not.

Closes obsproject/obs-studio#1857
2019-05-02 12:45:17 -07:00
jp9000 5d83e1aec4 obs-ffmpeg: Show encoder name when logging jim-nvenc 2019-03-28 16:38: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
Colin Edwards 01b6672de5
Merge pull request #1671 from derrod/nvenc-bframeasreferenceoption
obs-ffmpeg: Add option to use b-frames as reference
2019-03-13 19:10:59 -05:00
jp9000 a2201d5898 obs-ffmpeg: Always output SEI 2019-03-03 07:07:34 -08:00
jp9000 b8c78a340d obs-ffmpeg: Fix SEI data output
SEI was using the wrong variable for its size.
2019-03-03 07:07:34 -08:00
jp9000 dccf686150 obs-ffmpeg: Fix bitrate being set on NVENC CQP/lossless 2019-02-26 07:43:38 -08:00
jp9000 ef270c8ba0 obs-ffmpeg: Free NVENC textures after sending EOS
Prevents a crash when using the new lookahead feature, presumably
because those textures are in use when the EOS is sent.
2019-02-21 03:12:12 -08: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
derrod 18c59c3e54 obs-ffmpeg: Fix constant QP mode in new NVENC 2019-02-17 02:43:31 +01:00
jp9000 a249d26eaa obs-ffmpeg: Do not allow new NVENC on gpu idx > 0
Because the new NVENC implementation requires texture sharing, if the
user chooses to use a secondary GPU, fall back to the old implementation
instead.
2019-02-07 22:47:50 -08:00
jp9000 ed0c7bcd6a obs-ffmpeg: Add texture-based NVENC encoder implementation
Adds a texture-based NVENC implementation which passes OBS NV12 output
textures directly to NVENC without downloading them off of the GPU,
increasing NVENC performance by a significant margin.

If NV12 textures are unavailable or the new encoder fails to initialize
for whatever reason, it will fall back to the FFmpeg NVENC
implementation safely.
2019-02-07 17:00:47 -08:00