Commit Graph

195 Commits

Author SHA1 Message Date
Michael Fabian 'Xaymar' Dirks 0d574b81ff ui/nvenc: Export bitrate for OBS Studio to use
This should improve Replay Buffer and Low Latency Networking code, which may result in drastically better streaming with less dropped frames. I don't know why OBS Studio does it this way instead of just calculating the true kbit/sec bitrate by itself, but I guess this is just another case of "it works so it stayed in".
2019-11-17 12:21:02 +01:00
Michael Fabian 'Xaymar' Dirks 3a75b9f963 cmake: Version 0.4.0 0.4.0 2019-11-16 23:46:52 +01:00
Michael Fabian 'Xaymar' Dirks 815152d024 encoder: Actually fix parsing this time 2019-11-16 23:46:20 +01:00
Michael Fabian 'Xaymar' Dirks e4474c29c4 ui/nvenc: Improve and fix some options and logging
Some of the options shown to the user were never actually being applied, which resulted in encoding that looked worse than it could have. With this these options are now applied and users may experience a sudden increase or decrease in quality if they had these options changed.

In addition to that, some options now use a triple state field, which allows them to also have a default/middle state instead of being On or Off.

Furthermore, log output is now read from the actual AVCodecContext, which contains the actual values used in the encoding, instead of relying on the OBS settings to be the actual values.
2019-11-16 21:44:03 +01:00
Michael Fabian 'Xaymar' Dirks 2a75d5fabd ffmpeg/tools: Add functions for easy logging 2019-11-16 21:19:30 +01:00
Michael Fabian 'Xaymar' Dirks a0bfac9319 encoder: Fix crash because of missing string parameter 2019-11-16 21:19:17 +01:00
Michael Fabian 'Xaymar' Dirks 65dddb5aa8 utility: Add functions to check the state of tristates 2019-11-16 21:18:58 +01:00
Michael Fabian 'Xaymar' Dirks 59e33a132b ui/nvenc: Remove "Encoder" from name
It's already known that this is an encoder.
2019-11-16 13:04:10 +01:00
Michael Fabian 'Xaymar' Dirks be7b2737b4 encoder, ui/handler: Massive Refactor
This refactor is primarily to make the entire interface more unified and capable of more than before.
2019-11-15 17:29:24 +01:00
Michael Fabian 'Xaymar' Dirks 8f20a45ee8 hwapi/d3d11: Remove unused variables 2019-11-15 17:20:37 +01:00
Michael Fabian 'Xaymar' Dirks 300531ad8a ffmpeg/tools: Extra name functions 2019-11-15 13:31:27 +01:00
Michael Fabian 'Xaymar' Dirks c775ae93b7 utility: Add helper for tristate property 2019-11-15 01:12:32 +01:00
Michael Fabian 'Xaymar' Dirks 18c50b3cbb ui/handler: Refactoring 2019-11-13 11:44:40 +01:00
Michael Fabian 'Xaymar' Dirks 04a22a13dc encoder: Fix incorrect command line parsing code 2019-11-12 13:36:02 +01:00
Michael Fabian 'Xaymar' Dirks d8eb38037b encoder: Improve custom options parsing drastically
Splits the parsing into two steps, one for quotes and escaping, the other for actual option parsing. This drastically lowers the chances of messing up, and makes the entire thing much safer than a really complex monolithic loop.
2019-11-12 01:05:29 +01:00
Michael Fabian 'Xaymar' Dirks 81164d0f43 encoder: Cleanup and refactor for stability 2019-11-11 23:24:19 +01:00
Michael Fabian 'Xaymar' Dirks 05d8e74088 encoder: Use ffmpeg::tools::get_error_description 2019-11-11 21:15:56 +01:00
Michael Fabian 'Xaymar' Dirks d233b52e1f ffmpeg/tools: Rewrite ffmpeg::tools::get_error_description 2019-11-11 21:15:38 +01:00
UserNaem e89ef57bda locale: Additional and improved descriptions for options 2019-11-11 20:58:43 +01:00
Cristobal E 2759153b0e encoder: Show proper warning messages for custom options 2019-11-11 20:57:55 +01:00
Cristobal E 629afe3661 encoder: Add field for GPU selection 2019-11-11 20:57:53 +01:00
Michael Fabian 'Xaymar' Dirks 21629f1e13 cmake: Update libOBS to 24.0.3 2019-11-07 22:18:32 +01:00
Michael Fabian 'Xaymar' Dirks 80d104bdeb encoder: Use new graphics lock and create_from_obs method 2019-11-07 22:09:58 +01:00
Michael Fabian 'Xaymar' Dirks ffb348b6c8 hwapi/d3d11: Implement create_from_obs
Allows zero-copy with zero-overhead hardware encoders in OBS Studio.
2019-11-07 22:09:34 +01:00
Michael Fabian 'Xaymar' Dirks b67f51df76 hwapi/base: Create from OBS context 2019-11-07 22:08:46 +01:00
Michael Fabian 'Xaymar' Dirks 24d92e4b92 utility: Managed OBS Graphics Context 2019-11-07 22:08:21 +01:00
Michael Fabian 'Xaymar' Dirks 412c9fc18b locale: Fix description for Custom Settings 2019-11-04 18:40:06 +01:00
Michael Fabian 'Xaymar' Dirks 2184e5bc71 project: Reapply formatting 2019-11-04 18:32:47 +01:00
Michael Fabian 'Xaymar' Dirks ad761834ee encoder: Improve parsing of custom settings
Implements a parsing mechanism similar to that of an FFmpeg on the command line. Instead of separating options by ';' (key=value;key=value) the custom settings now take things as '-key=value -key=value -key="value with space"'.

A partial escaping of characters is also supported, however it does not modify the actual string. Proper support for escaping may land in a future update.

Fixes #5
Related #12
2019-11-04 18:32:36 +01:00
Michael Fabian 'Xaymar' Dirks a0b667c26f encoder: Rename all encoders to fix name collisions
This is a breaking change that will make all previous configuration no longer work.
2019-11-04 15:02:13 +01:00
Michael Fabian 'Xaymar' Dirks 18024aaf12 project: Version 0.3.1
* Replaced AppVeyor with GitHub Actions.
* Fixed rescaling on the output tab not working.
0.3.1
2019-10-31 08:13:42 +01:00
Michael Fabian 'Xaymar' Dirks b2b5cd8fad encoder: Fix width and height to use rescaled resolution
The function video_output_get_info does not contain rescaling information from the output tab, so by replacing it with obs_encoder_get_width/height we can actually use the scaled resolution.
2019-10-31 06:34:58 +01:00
Michael Fabian 'Xaymar' Dirks b6e881b90f ci: Remove AppVeyor scripts 2019-10-31 05:53:34 +01:00
Michael Fabian 'Xaymar' Dirks bd60958b2f ci: Also build InnoSetup installer on Github Actions 2019-10-31 05:53:34 +01:00
Michael Fabian 'Xaymar' Dirks f9ad87a56d ci: Add packaging and artifacts to Github Actions
Github Actions is going to replace AppVeyor in the long term for all release archives, simply because it integrates better with GitHub.
2019-10-31 05:53:34 +01:00
Michael Fabian 'Xaymar' Dirks b07365cdc4 project: Version 0.3.0
* Updated the libOBS dependency to 24.0.0. You will need to use OBS Studio 24.0.0 or newer in order to run the plugin.
* Implemented full hardware encoding for all GPU capable encoders (NVENC H264, NVENC H265). This should be perform identical to the OBS included full hardware encoders.
* Reduced the latency for some encoders to be as low as 1 frame, if settings allow. For NVENC, latency is tied to (B-Frames + 1) and Lookahead Frames, whichever is bigger.
* Further improved performance by throwing even less memory away every frame. Almost all memory is now re-used if possible and only released when the encoding is stopped by any means.
* Apple ProRes encoded files should now be remuxable when stored in Matroska (MKV) and survive at least one remuxing. This bug was already fixed in current master FFmpeg, and thanks for discovering this bug go to FRANKIEonPC.
* All color metadata is now set for encoders that support this, such as NVENC. Video players and editors that support this kind of metadata should see an improvement in color quality, especially with 10-bit or higher output.
* Framerate is now set to be fixed, further improving compatibility with players. It was previously left to be guessed by the video player through the timing information.
* Settings are now output to the log file for easier debugging. Please remember to send a log file with any issue you have with the plugin.
0.3.0
2019-10-19 02:52:23 +02:00
Michael Fabian 'Xaymar' Dirks f21cbe9aba ui/nvenc_shared: Fix lag calculation for rc-lookahead 2019-10-19 02:40:50 +02:00
Michael Fabian 'Xaymar' Dirks 403b43e77b cmake: Also include template files in project generation 2019-10-17 08:17:06 +02:00
Michael Fabian 'Xaymar' Dirks 58d8713369 enocder: Use ffmpeg for pixel format again
Reverts an earlier change as this apparently works now.
2019-10-17 08:16:42 +02:00
Michael Fabian 'Xaymar' Dirks 2f8acc58cf encoder: Separate get_defaults and get_properties for SW/HW encoders 0.3.0pre6 2019-10-04 19:27:45 +02:00
Michael Fabian 'Xaymar' Dirks e4e76dae8f ui/nvenc: Override lag in frames to use Max. B-Frames 2019-10-03 20:10:03 +02:00
Michael Fabian 'Xaymar' Dirks 4cac28a8a3 ui/handler, encoder: Allow overriding lag in frames
The lag in frames is not dictated by the number of threads being used by some encoders. At least for hardware encoders, the expected frame lag in real time encoding is 1 + the number of bframes
2019-10-03 20:09:34 +02:00
Michael Fabian 'Xaymar' Dirks d0dc4be985 encoder: Replace ffmpeg::avframe_queue with integrated implementation 2019-10-03 19:21:54 +02:00
Michael Fabian 'Xaymar' Dirks 4836f9dda6 hwapi/d3d11: Implement new HWAPI code 2019-10-03 19:19:20 +02:00
Michael Fabian 'Xaymar' Dirks 650b397ced hwapi/base: Improve frame allocation method
This allows us to cache existing frames, reducing the CPU and GPU memory load that appears due to constantly recreating frames.
2019-10-03 19:18:44 +02:00
Michael Fabian 'Xaymar' Dirks d3f7b15633 hwapi/base: Add missing #include <memory> 2019-09-29 19:33:51 +02:00
Michael Fabian 'Xaymar' Dirks 545dcd6d50 encoder: Add support for true hardware encoding
This is the last step towards truly efficient encoding on AMD, Nvidia and Intel GPUs. With this we have no software overhead and can directly encode the content that OBS gives us, without going through any intermediate CPU layer. This is effectively what @jp9000 did for the OBS-integrated nvenc, but thanks to FFmpeg it works on all encoders that support D3D11VA acceleration.

With the change, the encoding should now work flawlessly even in very constrained situations (unless OBS itself is being starved of resources). Especially people streaming and recording Ubisoft games will likely see a drastic increase in encoding capability, and thanks to the new options will also be able to get a much higher quality stream and recording with the same hardware.
0.3.0pre5
2019-09-29 19:29:00 +02:00
Michael Fabian 'Xaymar' Dirks 0461b20e1b ui/handler: Allow Codec handlers to select the proper device 2019-09-29 19:16:26 +02:00
Michael Fabian 'Xaymar' Dirks b3a6dbb1b4 hwapi: Add API handlers to deal with some heavy lifting code
Makes our life easier when actually dealing with hardware encoding.
2019-09-29 19:15:45 +02:00
Michael Fabian 'Xaymar' Dirks fe71944199 ui/prores_aw_handler: Workaround for FFmpeg bug with ProRes in Matroska
In current FFmpeg, whenever Matroska with ProRes is demuxed it creates an atom that is just 8 bytes short of the true size necessary.

We can work around this by padding the actual packet by 8 0x00 bytes, which should result in older FFmpeg versions working fine.

An FFmpeg patch is available: http://ffmpeg.org/pipermail/ffmpeg-devel/2019-September/250724.html
0.3.0pre4
2019-09-29 07:27:22 +02:00