338 Commits

Author SHA1 Message Date
derrod
5e183ff9a7 obs-ffmpeg: use avcodec_find_best_pix_fmt_of_list
The built-in format selector failed in certain cases like UtVideo now
using a differently packeg RGB format. FFmpeg has a format selection
functionality built-in that does pick the correct format however
(avcodec_find_best_pix_fmt_of_list), so we can simply use that instead.
2019-10-17 08:07:27 +02:00
derrod
5e6a538931 obs-ffmpeg: Use av_opt_set on context instead of priv_data
Certain ffmpeg parameters such as "bufsize" or "maxrate" have to be
applied to the context rather than to "priv_data". In order to make sure
options are still passed to the encoder setting set AV_OPT_SEARCH_CHILDREN.
2019-10-09 18:54:01 +02:00
jp9000
89586ef441 obs-ffmpeg: Remove unbuffered mode from media source
Unbuffered mode is causing the frames of media sources to potentially
have some slight jitter in playback, so instead of using unbuffered mode
with media sources, just leave buffering on.  There may be a frame or so
of latency, but it shouldn't be noticeable to most users.
2019-10-05 15:40:12 -07: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
jp9000
66967b7a55 obs-ffmpeg: Do not enable hardware decoding by default
If a user has a tremendous amount of media files, this can cause
instability.  Instead, make hardware decoding something the user has to
explicitly enable.

Although hardware decoding was technically enabled by default even
before we fixed it, fixing it was essentially a change to defaults for
users because it was just not even available before version 24.
2019-09-24 03:04:18 -07:00
Gol-D-Ace
03b5be75e4 Update translations from Crowdin 2019-09-17 23:21:00 +02:00
jpark37
4a81df759d obs-ffmpeg: Fix video warnings 2019-08-30 22:13:11 -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
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
jpark37
90c545b52c obs-ffmpeg: Add YUV alpha formats for completeness 2019-08-11 11:26:32 -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
James Park
37f663a789 libobs: obs-ffmpeg: win-dshow: Planar 4:2:2 video
This format has been seen when using FFmpeg MJPEG decompression.
2019-07-25 20:11:37 -07:00
Clayton Groeneveld
3ea354b4e4 UI, obs-plugins: Add spinbox suffixes where necessary 2019-07-18 04:03:38 -05:00
Jim
36c8090492
Merge pull request #1952 from obsproject/pause
Add the ability to pause and unpause recordings
2019-07-11 19:56:41 -07:00
jp9000
617086b040 obs-ffmpeg: Separate logging code
Cleans up obs-ffmpeg.c and separates all the logging code to a different
file, which can be enabled with ENABLE_FFMPEG_LOGGING.
2019-07-09 10:07:24 -07:00
jp9000
942ca6f709 obs-ffmpeg: Add support for pausing 2019-07-07 16:38:22 -07:00
jp9000
3b581a3727 obs-ffmpeg: Remove unnecessary function
This terrible boilerplate code is no longer necessary, as it is now
fixed by the previous commit.
2019-07-07 16:38:21 -07:00
jp9000
8caa4f938c obs-ffmpeg: Check for replay buffer button press
The replay buffer was triggering on both button press and button
release, which is redundant.
2019-07-06 09:27:40 -07:00
jp9000
8c54b7f393 obs-ffmpeg: Move external headers to external dir
Prevents automatic formatting with clang-format
2019-06-23 23:54:26 -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
Jim
fafda14963
Merge pull request #1906 from jpark37/bgr-three
libobs: linux-v412: obs-ffmpeg: Add packed BGR3 video support
2019-06-15 16:40:44 -07:00
Gol-D-Ace
973bc481ce Update translations from Crowdin 2019-06-11 01:42:42 +02:00
James Park
614025742b libobs: linux-v412: obs-ffmpeg: Add packed BGR3 video support
Someone mentioned this format preserves the most quality for a
particular capture card using V4L2.
2019-05-30 06:05:53 -07:00
jp9000
973d31b8c2 libobs: Fix lockup when an encode call fails
(This commit also modifies the UI, obs-ffmpeg, and obs-output modules)

Fixes a long-time regression where the program would lock up if an
encode call fails.  Shuts down all outputs associated with the failing
encoder and displays an error message to the user.

Ideally, it would be best if a more detailed error could be displayed to
the user about the nature of the error, though the primary problem is
the encoder errors are typically not something the user would be able to
understand.  The current message is a bit of a generic error message;
improvement is welcome.

Another suggestion is to try to have the encoder restart seamlessly,
though it would take a significant amount of work to be able to make it
do something like that properly, and it sort of assumes that encoder
failures are sporadic, which may not necessarily be the case with some
hardware encoders on some systems.  It may be better just to use another
encoder in that case.  For now, seamless restart is ruled out.
2019-05-17 01:51:12 -07:00
Jérémy Farnaud
525c473c4c obs-ffmpeg: Fix VAAPI CBR 2019-05-11 17:20:24 -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
Clayton Groeneveld
31b73f8025 UI: Add ability to set properties spinbox suffix 2019-05-02 08:54:14 -07:00
jp9000
0677fe2b21 obs-ffmpeg: Move ffmpeg-mux to executable dir
Instead of having ffmpeg-mux stored in a data directory, install it to
the primary binary directory.  On windows, this fixes ffmpeg-mux
potentially accessing the wrong FFmpeg libraries (some programs install
them to system32, foolishly), and instead ensures that it uses the ones
that come with the program.  On Linux, ensures that a binary is in its
appropriate directory (/usr/bin or /usr/local/bin rather than a subset
of /usr/share or /usr/local/share).
2019-04-26 13:24:34 -07:00
Richard Stanway
ca5a19cf66 obs-ffmpeg: Add logging of last error for passing to UI 2019-04-19 05:45:38 -07:00
Jim
9480cc4fd2
Merge pull request #1675 from admshao/clear-linux-compiling-warnings
Clear linux compiling warnings
2019-04-14 04:21:21 -07:00
Jim
30e90c3030
Merge pull request #1573 from DragoonAethis/master
obs-ffmpeg: Bind network buffer size in the UI
2019-04-14 02:51:14 -07:00
Gol-D-Ace
9fc1069e9b Remove double spaces from localization 2019-04-08 16:02:32 +02:00
jp9000
6550c0dfaa obs-ffmpeg: Remove "A" variants from NVENC blacklist 2019-04-05 07:36:13 -07:00
Gol-D-Ace
e78ac5ebef Update translations from Crowdin 2019-04-04 16:19:51 +02:00
Shaolin
54f4e2589a plugins: Clear all compiler warnings 2019-03-29 06:29:09 -03:00
jp9000
5d83e1aec4 obs-ffmpeg: Show encoder name when logging jim-nvenc 2019-03-28 16:38:14 -07:00
jp9000
c18aab29ee obs-ffmpeg: Fix blacklisted adapter check
The quadro P5000 would incorrectly be considered blacklisted because it
used a string search for the P500, which is an earlier quadro variant
that does not have NVENC support.

To fix this, instead of just doing a string search, additionally check
to make sure that there preceding or trailing numbers on the adapter
name.
2019-03-26 03:00:00 -07:00
Gol-D-Ace
f27a00d266 Revert "obs-ffmpeg: Add option to use b-frames as reference"
This reverts commit adf3337d3cdd1fe91cc5c763ff5ea292b4d6787e.
Currently causing timestamp issues resulting in FPS issues.
2019-03-14 10:05:55 +01:00
Colin Edwards
e001e2d1b9
Merge pull request #1733 from VodBox/media-source-wording
obs-ffmpeg: Change clear on media end wording for media source
2019-03-14 00:17:42 -05:00
jasonlee
6039cbb938 obs-ffmpeg: Use correct calling convention on CreateDXGIFactory1
Closes #1740
2019-03-13 20:11:43 -05: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
VodBox
ce4bda45df obs-ffmpeg: Change clear on media end wording for media source
As per mantis issue 1403, the current wording for ClearOnMediaEnd is
ambiguous. Since it says "Hide source", some may believe it to mean the
scene item in the sources list will have it's visibility set to hidden.
This wording makes it clearer what the checkbox actually does.
2019-03-11 12:16:54 +13:00
Richard Stanway
d8812e0808 obs-ffmpeg: Check avformat context before use 2019-03-05 21:58:09 +01:00
Richard Stanway
460c34aeaf obs-ffmpeg: Fix crash on failed audio codec init (for real) 2019-03-05 21:54:12 +01:00
Richard Stanway
b73bffff48 obs-ffmpeg: Fix crash on failed audio codec init 2019-03-05 21:48:58 +01: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
748067c930 obs-ffmpeg: Fix NVENC blacklisted card check
Apparently, the parameters were the wrong way, making the test always
fail to detect a blacklisted adapter.
2019-02-28 06:34:13 -08:00