Commit Graph

24 Commits

Author SHA1 Message Date
Michael Fabian 'Xaymar' Dirks 4e41c5cf24 code: Revert #836
The compiler will choose the optimal way automatically, and forcing std::move here actually results in two objects existing side by side, before being "moved" into one.
2023-04-05 18:58:38 +02:00
Michael Fabian 'Xaymar' Dirks 24a19c2ed3 ffmpeg/tools: Revert #836
It is not valid to pass std::string_view to snprintf's %s.
2023-04-05 18:58:38 +02:00
lainon 6e1566386e project: Apply more C++ paradigms to the code
- Use auto in places where code clarity is improved or identical.
- Replace trivial constructors and destructors with default.
- Use true random for random generation.
- Use std::string_view where it is valid to do so.
- Apply const where it is valid to do so.
- Use references where it is valid to do so.
- Manually optimize memory usage with std::move and std::copy.
- Opt for memory efficient containers where the size is known ahead of time.

Signed-off-by: lainon <GermanAizek@yandex.ru>
2023-04-05 18:58:32 +02:00
Michael Fabian 'Xaymar' Dirks 378f2b3f0e ffmpeg/tools: Improve helper functions for AVOption lists 2023-04-05 18:58:17 +02:00
Michael Fabian 'Xaymar' Dirks 7f6047f43f ffmpeg/tools: Helpers for easily populating OBS property lists 2023-04-05 18:58:17 +02:00
Michael Fabian 'Xaymar' Dirks e954e86308 encoder/ffmpeg: libOBS samples Chroma at Top, not Center
This bug predates the merge into StreamFX and was present in the original release as a separate plugin. libOBS has never sampled Chroma at Center as far as I can look back into its history.

Fixes #676
2023-04-05 18:51:38 +02:00
Michael Fabian 'Xaymar' Dirks 6a6929105a ffmpeg: Fix print_av_option_string2 printing wrong names 2023-04-05 18:51:25 +02:00
Michael Fabian 'Xaymar' Dirks 4ead07c23a ffmpeg: Apply coding guidelines 2023-04-05 18:50:57 +02:00
Michael Fabian 'Xaymar' Dirks 3533a86b96 ffmpeg/tools: Adjust to match ffmpeg-mux color settings
The 'obs-ffmpeg-mux.c' file specifies different color parameters than StreamFX does. This causes re-muxing to go haywire, and editors that trust these tags suddenly spew out bad colors for BT.601 and sRGB.

Reverts #478
2023-03-28 13:11:21 +02:00
Michael Fabian 'Xaymar' Dirks 303c14de4e ffmpeg/tools: Fix incorrect transfer characteristics
Both Rec. 601 and sRGB looked extremely wrong before, resulting in weird or warped colors. Since it is very difficult to find up to date and accurate information on standards, we should simply go for what has the most widespread support.
2023-03-28 13:11:12 +02:00
Michael Fabian 'Xaymar' Dirks 9938422d5c ffmpeg/tools: Set correct information when encoding
Improves the previous logic and makes it compatible with the new additions in 26.x, such as sRGB. This was previously broken as the focus was on existing features which could be tested without requiring a compiler to be installed.

Incorrect understanding of how sRGB works with RGB and YCC/YUV formats also caused sRGB to be treated as RGB when I444 was selected. This should also now be fixed, hopefully permanently.

Fixes #331
2023-03-28 13:11:00 +02:00
Michael Fabian 'Xaymar' Dirks 66b1715d78 ffmpeg/tools: Fix compatibility with Ubuntu 18.04 2023-03-28 12:52:22 +02:00
Michael Fabian 'Xaymar' Dirks f3b3af2030 ffmpeg/tools: Ensure we aren't comparing against a nullptr 2023-03-28 12:52:21 +02:00
Michael Fabian 'Xaymar' Dirks dbb71cf801 project: Code cleanup and reapply formatting
Changes applied:

* Moved utility files to /util/.
* Removed unused #includes.
* Removed unused ::ffmpeg::tools function.
* Removed unused variables.
* Fixed missing parentheses in the version macro.
* Fixed missing override on virtual function overrides and removed unnecessary virtual keyword from them.
* Disabled additional warning for ATL headers on MSVC only.
* Replaced direct printf parameters with their macro equivalent.
* Replaced C-style casts with C++-style casts.
* Applied clang-format again after an earlier change to the CMake file broke the integration for it.
2023-03-28 12:52:20 +02:00
Michael Fabian 'Xaymar' Dirks f7da7283fb ffmpeg/tools: Add string value mapping to print_av_option 2023-03-28 12:52:19 +02:00
Michael Fabian 'Xaymar' Dirks 68a49498e6 common: Rename LOG_ to DLOG_ to avoid macro confusion 2023-03-28 12:52:17 +02:00
Michael Fabian 'Xaymar' Dirks b60f68fcb8 ffmpeg/tools: Fix incorrect colors for sRGB 2023-03-28 12:40:46 +02:00
Michael Fabian 'Xaymar' Dirks 071760b867 ffmpeg-encoder/nvenc: Invert "no-scenecut" option for "Adaptive I-Frames"
Our "Adaptive I-Frames" is the inverse of the expected parameter to "no-scenecut" in FFmpegs NVENC.

Related #191
2023-03-28 12:40:41 +02: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 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 b306cebd6b project: More warnings fixed 2020-01-14 01:39:13 +01:00
Michael Fabian 'Xaymar' Dirks 0a16ce07dc project: Merged FFmpeg Encoders Step 2 2020-01-13 22:40:15 +01:00
Michael Fabian 'Xaymar' Dirks 3eea289679 project: Merged FFmpeg Encoders Step 1 2020-01-13 01:52:30 +01:00