Commit Graph

53 Commits (master)

Author SHA1 Message Date
tytan652 17ba8359e4 deps,libobs,plugins: Fix discarded-qualifiers warnings with FFmpeg 5 2022-07-22 08:50:36 -04:00
OvchinnikovDmitrii 4e140d2ffe obs-ffmpeg: Add texture-based hardware AMD encoder
Adds support for texture-based AMD encoding, with both H264, HEVC, and
HDR support. Falls back to FFmpeg when texture-based encoding cannot be
used for whatever reason.

(Jim note: This is based upon obsproject/obs-studio#4538 by AMD/Luxoft
with fewer files, FFmpeg fallback for software encoding, and HDR
support. I also went to lengths to ensure that FFmpeg command line
parameters also works with it)

Co-authored-by: Jim <obs.jim@gmail.com>
2022-07-21 15:29:25 -07:00
MagicBear f54f8ee714 obs-ffmpeg: Add NVIDIA Tesla NVENC support 2022-07-09 15:49:26 -07:00
jpark37 01a806cb53 obs-ffmpeg: Add HEVC support to NVENC 2022-04-28 08:59:53 -07:00
Florian Zwoch 8886091793 obs-ffmpeg: add NVENC blacklist check for Linux
Similar to the Windows counter part. Check the PCI bus for
installed cards. When found at least one VGA compatible adapter
from NVIDIA that is not in the blacklist we pass the check.
2022-03-08 12:16:07 -08:00
derrod 8367c8adfa obs-ffmpeg: Add MX450 to blacklist 2022-01-25 16:46:55 +01:00
pkv c398ac9739 obs-ffmpeg: Fix NVENC old codec naming removed in FFmpeg
Per FFmpeg commit 337f777f378c [1], FFmpeg removed nvenc_h264_encoder
and nvenc_hevc_encoder after deprecation in FFmpeg commit 888a5c794778
[2]. The names to be used are ff_h264_nvenc_encoder and
ff_hevc_nvenc_encoder. So we must allow alternative search of codec as
h264_nvenc or nvenc_h264 in obs-ffmpeg.c.

[1]: 337f777f37
[2]: 888a5c7947
2021-11-23 12:10:56 -05:00
jp9000 442886c0aa obs-ffmpeg: Add AOM AV1 and SVT-AV1 encoders
Adds the ability to encode with software AV1 encoders within FFmpeg,
specifically AOM AV1 and SVT-AV1.
2021-10-25 12:24:16 -07:00
Joel Bethke 2b8ea4b5f3 obs-ffmpeg: Add MX350 to blacklist 2020-10-29 21:04:06 -07:00
Maya Venkatraman 49d351b537 obs-ffmpeg: Add HLS output
Add and register an obs_output_info struct called
ffmpeg_hls_muxer. It uses ffmpeg's HLS muxer to stream output.

Add threading and buffer to reduce skipped frames.
Also add frame drop logic when there are too many packets in the
buffer for congestion control.
2020-10-13 13:54:42 -07:00
pkv 91418e901c obs-ffmpeg: Use obs-ffmpeg-mux for mpegts network output
This replaces the ffmpeg-encoded-output which had serious issues
(missing headers, muxing issues with non compliant mpegts streams) with
an output grafted from obs-ffmpeg-mux.
2020-05-19 16:15:41 -07:00
Richard Stanway 75d1f74838 obs-ffmpeg: Expose old NVENC on Windows 7
New NVENC isn't available on Windows 7 and the old encoder was marked as
internal, giving users no option to use NVENC at all.
2020-03-27 00:17:49 +01:00
Aaron Boxer b55b1e9bfd obs-ffmpeg: Add new ffmpeg-encoded-output 2019-11-27 14:40:52 -05:00
Richard Stanway da31881059 obs-ffmpeg: Use vendor and device ID for NVENC blacklist 2019-10-16 12:19:09 +02: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 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 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 9480cc4fd2
Merge pull request #1675 from admshao/clear-linux-compiling-warnings
Clear linux compiling warnings
2019-04-14 04:21:21 -07:00
jp9000 6550c0dfaa obs-ffmpeg: Remove "A" variants from NVENC blacklist 2019-04-05 07:36:13 -07:00
Shaolin 54f4e2589a plugins: Clear all compiler warnings 2019-03-29 06:29:09 -03: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
jasonlee 6039cbb938 obs-ffmpeg: Use correct calling convention on CreateDXGIFactory1
Closes #1740
2019-03-13 20:11:43 -05: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
jp9000 a87afeb69b obs-ffmpeg: Add more blacklisted NVENC adapters 2019-02-25 08:05:38 -08:00
jp9000 4c3f992b44 obs-ffmpeg: Add more blacklisted non-NVENC adapters 2019-02-14 23:12:55 -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
jp9000 0be02564cb obs-ffmpeg: Implement NVENC video card blacklist
This implements a blacklist of devices that ship with NVENC libraries,
but do not support NVENC, which would cause the plugin to mistakenly
think that NVENC was available when it was not.  If these devices are
the only NVIDIA devices on the system, consider NVENC unavailable.

This is much more efficient than spawning an encoder on startup to see
if NVENC is available, which would incur a ~500 millisecond hit on
startup.  Additionally, also much less crash-prone.
2019-02-07 17:00:46 -08:00
Thomas Crider a64ae11bce obs-ffmpeg: Add linux VAAPI h.264 encoding support
Closes obsproject/obs-studio#1482
Closes obsproject/obs-studio#1256
2018-09-24 23:12:24 -07:00
Kurt Kartaltepe d86c8121ed Plugins: Add descriptions to modules 2018-09-11 18:28:58 -07:00
jp9000 6774bbdb83 obs-ffmpeg: Remove NVENC detection code for now
The reason this code is being reverted/removed is because this code is a
risk to startup stability.  This check will be added again in the
future, however this code needs to be executed from a secondary piped
process instead of directly in the process to reduce risk of
driver/hardware issues impacting program startup.  The same needs to be
accomplished for the AMF plugin as well.
2018-01-20 05:31:58 -08:00
jp9000 f5c3af1bda obs-ffmpeg: Fix signed mismatch warning 2018-01-19 16:19:10 -08:00
Lucian Poston ff45b7b119 obs-ffmpeg: Call av_register_all before nvenc check
Closes jp9000/obs-studio#1157
2018-01-18 01:36:46 -08:00
jp9000 653d3ceb33 obs-ffmpeg: Don't try to detect NVENC on mac 2018-01-18 01:36:46 -08:00
Michel 054d607c2d obs-ffmpeg: Improve NVENC detection
This improves detection by performing an actual check on encoder
capability directly with the NVENC/CUDA libraries.
2018-01-18 01:35:45 -08:00
jp9000 17560bf86a Revert "obs-ffmpeg: Improve NVENC detection"
This reverts commit 94b5982216.

Reverting this commit because it had some negative side effects, such as
adding 500 milliseconds to the startup time.  NVENC detection should
really be done through its proper API, and not via creating an encoder
on startup.
2018-01-12 05:35:01 -08:00
Michel 94b5982216 obs-ffmpeg: Improve NVENC detection
Certain NVIDIA GPUs don't support NVENC, but ship with the NVENC
library, causing OBS to mistakenly think that NVENC is available when it
actually isn't.

Closes jp9000/obs-studio#1087
2017-12-02 08:08:52 -08:00
jp9000 fa611dcd76 obs-ffmpeg: Add Opus audio encoder 2017-08-01 02:14:58 -07:00
jp9000 f2e85b8352 obs-ffmpeg: Add replay buffer output
This output allows buffering the encoded data, and then muxing the
current buffer to a file on the spot via a hotkey the user sets.
2016-12-08 03:36:17 -08:00
jp9000 8e1943065c obs-ffmpeg: Add FFmpeg NVENC encoder 2016-04-19 09:20:26 -07:00
jp9000 7f0f3d25c9 obs-ffmpeg: Remove overly verbose FFmpeg logging
For the time being, FFmpeg logging is disabled due to the fact that it
can just output way too much data.
2016-01-26 11:49:27 -08:00
Richard Stanway 55dd8f8726 obs-ffmpeg: Fix a race condition in create_or_fetch_log_context
Another thread could be manipulating the active_log_contexts array while the current thread is trying to read it, resulting in an uninitialized memory crash as the da_push_back call was not protected by the mutex.
2015-10-12 23:21:45 +02:00
kc5nra 34b95eff8a obs-ffmpeg: Sychronize logging on log context
Different logging can occur from different contexts.
This adds isolation for each context passed to the
AV log.
2015-08-14 07:53:52 -07:00
John Bradley 6e69b0f4f0 obs-ffmpeg: Move log callback up to plugin scope 2015-08-14 07:53:51 -07:00
jp9000 9048743ebe obs-ffmpeg: Add ffmpeg muxer
In addition to the flv file format, this allows the ability to save to
container formats such as mp4, ts, mkv, and any other containers that
support the current codecs being used.

It pipes the encoded data to the ffmpeg-mux process, which then safely
muxes the file from the encoded data.  If the main program unexpectedly
terminates, the ffmpeg-mux piped program will safely close the file and
write trailer data, preventing file corruption.
2015-06-21 22:34:49 -07:00
John Bradley 2fc6c4d725 obs-ffmpeg: Add FFMpeg input source 2015-03-09 21:22:32 -05:00
jp9000 892fdea83e Remove macro to free locale
This functionality can now be handled automatically because locale can
now be freed seaparately from obs_module_unload with
obs_module_free_locale, which is called automatically when the module is
being freed.
2014-07-27 17:29:10 -07:00
jp9000 f0ac19abba Remove version parameter from obs_module_load
Replaced by obs_get_version() API
2014-07-27 17:29:10 -07:00
jp9000 482791c5b6 Add locale for modules 2014-07-11 17:29:00 -07:00
jp9000 92522d1886 Implement RTMP module (still needs drop code)
- Implement the RTMP output module.  This time around, we just use a
   simple FLV muxer, then just write to the stream with RTMP_Write.
   Easy and effective.

 - Fix the FLV muxer, the muxer now outputs proper FLV packets.

 - Output API:
   * When using encoders, automatically interleave encoded packets
     before sending it to the output.

   * Pair encoders and have them automatically wait for the other to
     start to ensure sync.

   * Change 'obs_output_signal_start_fail' to 'obs_output_signal_stop'
     because it was a bit confusing, and doing this makes a lot more
     sense for outputs that need to stop suddenly (disconnections/etc).

 - Encoder API:
   * Remove some unnecessary encoder functions from the actual API and
     make them internal.  Most of the encoder functions are handled
     automatically by outputs anyway, so there's no real need to expose
     them and end up inadvertently confusing plugin writers.

   * Have audio encoders wait for the video encoder to get a frame, then
     start at the exact data point that the first video frame starts to
     ensure the most accrate sync of video/audio possible.

   * Add a required 'frame_size' callback for audio encoders that
     returns the expected number of frames desired to encode with.  This
     way, the libobs encoder API can handle the circular buffering
     internally automatically for the encoder modules, so encoder
     writers don't have to do it themselves.

 - Fix a few bugs in the serializer interface.  It was passing the wrong
   variable for the data in a few cases.

 - If a source has video, make obs_source_update defer the actual update
   callback until the tick function is called to prevent threading
   issues.
2014-04-07 22:00:10 -07:00
jp9000 966b943d5b Remove majority of warnings
There were a *lot* of warnings, managed to remove most of them.

Also, put warning flags before C_FLAGS and CXX_FLAGS, rather than after,
as -Wall -Wextra was overwriting flags that came before it.
2014-02-14 15:13:36 -07:00