Commit Graph

535 Commits

Author SHA1 Message Date
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
Michael Fabian 'Xaymar' Dirks 98c7a2e379 ffmpeg-encoder/nvenc: Fix typo 2020-01-15 05:53:54 +01:00
Michael Fabian 'Xaymar' Dirks 34b2859dac ffmpeg-encoder/nvenc: Add minimum bitrate, fix target quality and more
Adds support for specifying Minimum Bitrate directly in the UI instead of requiring custom settings to do so. Additionally Adaptive I/B-Frames are now only shown if Look-Ahead is a value greater than 0 frames.

Quality Minimum can also now be left at a default value of -1, the Quality group is no longer toggleable and Quality Target moved into the group. Settings options on the context is now searching children too (if there are any).

Finally, some C++17 formatting was done.

Fixes #101
2020-01-15 05:50:31 +01:00
Michael Fabian 'Xaymar' Dirks 5d5a104819 ffmpeg-encoder: Improve UI, fix acceleration encode, etc 2020-01-15 03:59:03 +01:00
Michael Fabian 'Xaymar' Dirks 96ac0bd11b ffmpeg-encoder: Fix weird bug with std::map crashing in constructor 2020-01-14 10:36:04 +01:00
Michael Fabian 'Xaymar' Dirks 109b1c9b0f ffmpeg-encoder: Fix incorrect call 2020-01-14 10:03:42 +01:00
Michael Fabian 'Xaymar' Dirks a72eba6ded ci: Remove Node.JS requirement 2020-01-14 09:31:41 +01:00
Michael Fabian 'Xaymar' Dirks 8df90dfda8 ffmpeg-encoder: Fix handler detection 2020-01-14 02:15:05 +01:00
Michael Fabian 'Xaymar' Dirks 14d05ccdac plugin: Enable FFmpeg Encoders 2020-01-14 01:55:31 +01:00
Michael Fabian 'Xaymar' Dirks b306cebd6b project: More warnings fixed 2020-01-14 01:39:13 +01:00
Michael Fabian 'Xaymar' Dirks ebc50dcefe utility: Merge util-math and util-memory 2020-01-14 01:11:08 +01:00
Michael Fabian 'Xaymar' Dirks 1987bfb853 ffmpeg-encoder: Fix some warnings 2020-01-14 01:04:49 +01:00