Commit Graph

546 Commits

Author SHA1 Message Date
Michael Fabian 'Xaymar' Dirks 89b99402c0 util-threadpool: Add missing includes 2020-04-01 14:32:54 +02:00
Michael Fabian 'Xaymar' Dirks 30aaea8449 filter-nv-face-tracking: Possibly fix for rare 0x0 bug 2020-04-01 01:41:18 +02:00
Michael Fabian 'Xaymar' Dirks cf6e867ba5 source-shader: Fix size and parameters 2020-04-01 00:09:21 +02:00
Michael Fabian 'Xaymar' Dirks 3dcf4e5dd6 filter-shader: Fix detected sizes 2020-03-31 22:42:18 +02:00
Michael Fabian 'Xaymar' Dirks ac8844b305 gfx-shader: Add defaults 2020-03-31 22:34:22 +02:00
Michael Fabian 'Xaymar' Dirks d5dffbbe03 filter-shader: Fix some crashes 2020-03-31 22:26:50 +02:00
Michael Fabian 'Xaymar' Dirks bb2f43a629 filter-shader: Fix incorrect shader mode 2020-03-31 22:22:55 +02:00
Michael Fabian 'Xaymar' Dirks 43f1dcf205 filter-nv-face-tracking: Nvidia exclusive Face Tracking filter
Ever wished you had a professional camera operator to highlight and follow the action, ensuring the audience never misses a beat? Thanks to NVIDIA, you can now do this at home for free! The new NVIDIA AR SDK unlocks augmented reality features, including motion tracking for faces.

This allows me to provide you with an automated zoom and cropping solution for your video camera to transform your streams into a slick, polished broadcast, where you’ll always be the star of the show. Don’t forget - everything is customizable so the possibilities are endless. You can even recreate that Futurama squinting meme if you wanted to (with some scripting)!

The filter requires compatible Nvidia RTX hardware and the Nvidia AR SDK Runtime to be installed ahead of time. This filter is considered "stable" and shouldn't change much from version to version.
2020-03-31 21:46:47 +02:00
Michael Fabian 'Xaymar' Dirks 88213e81f6 nvidia-cuda: GPL compatible CUDA library interface
Due to the 'nvcuda' library being part of the driver, it falls in a clause of the GPL which allows us to load and interface with system drivers. Since we can't rely on Nvidias headers here (incompatible license), most of this was pulled from FFmpeg and other things were found out via testing.
2020-03-31 21:46:47 +02:00
Michael Fabian 'Xaymar' Dirks 2e48723e83 util-profiler: Possible fix for issue #119
Microsoft automatically includes cmath by default, while GCC and Clang don't seem to do this.
2020-03-31 21:46:03 +02:00
Michael Fabian 'Xaymar' Dirks 1285e7efd3 util-event: Fix duplicated name 2020-03-31 15:47:15 +02:00
Michael Fabian 'Xaymar' Dirks 79406b0b08 gfx-shader: Additional stable time values
'Time.x' gets inaccurate if OBS Studio is running for more than two hours, therefore we have to do something to fix it. By allowing the shader code to control when things loop using 'Time.y' (0..1) and 'Time.z' (the number of times 'Time.y' wrapped back to 0), a much more stable animation can be achieved.
2020-03-28 22:17:33 +01:00
Michael Fabian 'Xaymar' Dirks 43b5d309eb transition: Add initial version of Shader filter
These allow you to apply any kind of filtering to a any source, using just standard HLSL. Just like transitions, one extra parameter is set called 'InputA'.

Fixes #95
2020-03-28 18:54:56 +01:00
Michael Fabian 'Xaymar' Dirks ead355beea transition-shader: Add initial version of Shader transitions
With this, the first proper shader effect is now possible. By using the four new automated shader parameters 'InputA', 'InputB', 'TransitionTime' and 'TransitionSize' you can write your own transition in HLSL.

Fixes #96
2020-03-28 18:38:45 +01:00
Michael Fabian 'Xaymar' Dirks 2e250ad826 obs-source-factory: Fix support for transitions
Transitions always require audio and video rendering.
2020-03-28 18:37:20 +01:00
Michael Fabian 'Xaymar' Dirks 6ae9904e13 gfx-shader: Support for filters and transitions
Due to render logic required for transitions, some of the render logic is split into an additional function called 'prepare_render'. Additionally the storage for some temporary objects has been removed as it these objects usually do not outlive their rendering time anyway.

Related: #96 #95 #94 #5
2020-03-28 18:37:00 +01:00
Michael Fabian 'Xaymar' Dirks e66acbeb98 filter-transform: Fix function location 2020-03-28 16:24:26 +01:00
Michael Fabian 'Xaymar' Dirks 18b3cd30bf filter-transform: Migration code for earlier stable versions
This fixes #116 which was caused by a refactor in commit efb6b0b9be. This bug was left undiscovered until users started upgrading from the last stable version to the current pre-release.
2020-03-28 16:18:17 +01:00
Michael Fabian 'Xaymar' Dirks 4f7c1cb35e ffmpeg-encoder: Various warning fixes and cleanup
Also don't include it from plugin.cpp if it's not enabled.
2020-03-27 20:10:29 +01:00
Michael Fabian 'Xaymar' Dirks ff3c2e8c66 filter-dynamic-mask: Initialize all members 2020-03-27 20:10:17 +01:00
Michael Fabian 'Xaymar' Dirks 87e6767033 gs-mipmapper: Fix some warnings 2020-03-27 20:10:17 +01:00
Michael Fabian 'Xaymar' Dirks 1942782b56 util-threadpool: Fix order of initialization 2020-03-27 20:10:09 +01:00
Michael Fabian 'Xaymar' Dirks 10fee7f048 util-profiler: Easy to use profiling helper 2020-03-27 20:10:09 +01:00
Michael Fabian 'Xaymar' Dirks 03bee0aaf2 source-mirror: Fix freeze introduced in OBS Studio v25.x
For an unknown reason, OBS Studio v25.x now causes a freeze to happen at this location. This should hopefully work around that issue by ensuring that we are in a location that does not cause an unusual lock order.
2020-03-21 09:13:31 +01:00
Michael Fabian 'Xaymar' Dirks b54e9431c0 ffmpeg-encoder: Fall back to software encoding for scaling 2020-03-21 08:59:53 +01:00
Michael Fabian 'Xaymar' Dirks ccb8a205b0 source-mirror: Update first, then acquire source
Fixes a bug where a 2nd update is necessary for proper audio mirroring.
2020-03-21 08:59:35 +01:00
Michael Fabian 'Xaymar' Dirks d6c903a3bd source-mirror: Fix out-of-order playback of audio
On highly parallel systems (> 4 Threads) audio had a chance of being played back out of order, causing it to jitter. This queue should help eliminate the issue entirely.

Fixes #111
2020-03-20 23:59:42 +01:00
Michael Fabian 'Xaymar' Dirks ba1780afa6 utility: Add lerp and 1D Kalman filter 2020-03-20 23:24:25 +01:00
Michael Fabian 'Xaymar' Dirks 6f2b50b0ad cmake: Redesign for future features 2020-03-20 23:09:46 +01:00
Michael Fabian 'Xaymar' Dirks 0b3ce10aff filter-transform: Fix discoloration issue
Previously a wrong blend state caused a slight discoloration on transparent sources, which was caused by assuming them to always be fully solid without transparency. By instead relying on OBS to do the rendering we do not have to deal with blend states as much and instead can simply enjoy the result.

Fixes #104
2020-03-07 03:43:30 +01:00
Michael Fabian 'Xaymar' Dirks f2913685ed ffmpeg-encoder/nvenc: See description
* Remove Minimum Bitrate as it is not supported by the encoder.
* Add several default states (-1 or Default) to options.
* Possibly fix bitrate lock with CQP and CQ mode.
* Fix log output for bitrate and B-Frames.
2020-03-07 01:52:04 +01:00
Michael Fabian 'Xaymar' Dirks 549e7c7437 ffmpeg-encoder: Fix leftover errors from refactor 2020-03-07 01:48:23 +01:00
Michael Fabian 'Xaymar' Dirks e2c83f546e ffmpeg/tools: Allow overriding option context 2020-03-07 01:48:06 +01:00
Michael Fabian 'Xaymar' Dirks 5223d3980f ffmpeg/tools: Also log default values 2020-03-07 00:33:55 +01:00
Michael Fabian 'Xaymar' Dirks 087845de49 source-mirror: Reimplement audio mirroring using thread pool
The new logic drastically simplifies Source Mirror and reduces the attack surface for bugs introduced by humans. Additionally the new layout detection should help with improved audio mirroring which hopefully will not crash libobs as often.

Fixes #61.
2020-03-03 02:17:26 +01:00
Michael Fabian 'Xaymar' Dirks 08024049c2 util-threadpool: Implement global thread pool
This thread pool can take large or small tasks and as such alleviates the burden of having a thread per source. Particularly for large setups, this drastically reduces the number of threads running in the background waiting for work.
2020-03-03 01:52:54 +01:00
Michael Fabian 'Xaymar' Dirks d91042fe2a source-mirror: Fix OBS_SOURCE_CUSTOM_DRAW support & more
Fixes support for OBS_SOURCE_CUSTOM_DRAW sources and refactors the class onto better isolated and wrapped classes to deal with specific tasks. This drastically improves stability without causing code complexity to increase, and makes the code vastly easier to read too.

Related: #99
2020-02-14 07:55:18 +01:00
Michael Fabian 'Xaymar' Dirks 4baa2360c5 obs-source: Disallow copy constructor 2020-02-14 07:52:28 +01:00
Michael Fabian 'Xaymar' Dirks 681a586ae9 util-event: Rest of fb5041a69d 2020-02-14 07:52:15 +01:00
Michael Fabian 'Xaymar' Dirks baf265fd5b obs-signal-handler: Fix possible crash 2020-02-14 07:31:30 +01:00
Michael Fabian 'Xaymar' Dirks 326fa68d9f obs-signal-handler: Helper classes for signals and audio 2020-02-14 07:30:46 +01:00
Michael Fabian 'Xaymar' Dirks 42c9375333 obs-tools: Fix obs::tools::child_source not checking return value 2020-02-14 07:29:31 +01:00
Michael Fabian 'Xaymar' Dirks fb5041a69d util-event: Ensure thread safety 2020-02-14 07:28:57 +01:00
Michael Fabian 'Xaymar' Dirks 5d38ca8a74 ffmpeg-encoder/nvenc: Various additional default states 2020-02-13 11:19:30 +01:00
Michael Fabian 'Xaymar' Dirks 40369bf72d obs-tools: Add child_source helper class 2020-02-13 10:34:26 +01:00
Michael Fabian 'Xaymar' Dirks 53d4ad31e6 source-mirror: Remove useless group 2020-02-13 05:18:28 +01:00
Michael Fabian 'Xaymar' Dirks a47dbaefc8 source-mirror: Remove scaling and caching
Scaling shouldn't be part of the Source and instead should be done as a filter. Not only does supporting it drastically increase code complexity, it also doesn't add anything that is really necessary as you can do everything it did better in an actual transform.

Caching wasn't actually used except for scaling and was mostly broken too, causing flickering.
2020-02-13 05:17:06 +01:00
Michael Fabian 'Xaymar' Dirks c6a1edf46f util-event: Fix and cleanup 2020-02-13 05:09:14 +01:00
Michael Fabian 'Xaymar' Dirks f8ee95d71c obs-*: Cleanup 2020-02-13 05:09:14 +01:00
Michael Fabian 'Xaymar' Dirks 5956a6f7a9 ffmpeg-encoder/nvenc: Add AUD and DPB Size options 2020-01-15 13:43:33 +01:00