Commit Graph

862 Commits

Author SHA1 Message Date
Matt Gajownik ffef7504ac Update translations from Crowdin 2025-06-09 14:55:50 -04:00
Huts, Roman 48feb2c593 obs-ffmpeg: Add B-frame CQP support for AMD AV1 encoder 2025-06-05 14:37:20 -04:00
Ryan Foster 720f37046f Revert "obs-ffmpeg: New default AMD encoding settings"
This reverts commit 5a1f622ac1.
2025-05-05 18:52:29 -04:00
Ryan Foster a96de1e5dc Revert "obs-ffmpeg: Add Pre-Analysis checkbox for AMD encoder"
This reverts commit c518f69c84.
2025-05-05 18:52:29 -04:00
Huts, Roman c518f69c84 obs-ffmpeg: Add Pre-Analysis checkbox for AMD encoder 2025-05-05 17:43:00 -04:00
Huts, Roman 5a1f622ac1 obs-ffmpeg: New default AMD encoding settings
# Conflicts:
#	plugins/obs-ffmpeg/texture-amf.cpp
2025-05-05 17:43:00 -04:00
Alex Luccisano d31271834f obs-ffmpeg: Query and log the AMF codec level
Log the codec level being used by AMF-based encoders after
ffmpeg_opts have been parsed. Users could have manually changed the
codec level so query the level via AMF then determine the string for
logging.
2025-04-25 16:48:18 -04:00
Alex Luccisano 2217eb4d95 obs-ffmpeg: Set AMF codec level properly
The default "level" setting was being used for each codec (AVC, HEVC,
AV1) supported by AMF. For example, all HEVC encoders were using
level 6.2 and this caused some playback devices to reject the
bitstream for decode because the device reported a maximum decode
level lower than 6.2.

Add functionality to determine the best match for the codec level
instead of relying on the defaults.
2025-04-25 16:48:18 -04:00
Neal Gompa 39a692d960 obs-ffmpeg: Add OpenH264 H.264 software codec
This allows users to leverage the OpenH264 codec from Cisco to encode
H.264 video content. It is significantly reduced in capability from
alternatives, but it does the job.

This also provides a framework for adding support for other H.264
software codecs provided through FFmpeg.
2025-04-03 12:43:20 -07:00
Alex Luccisano 7decef8ab0 obs-ffmpeg: Make VAAPI rc_mode comparison case insensitive
`get_rc_mode()` compares the incoming rate control mode string
to the .name member of rc_mode_t, and the table entries are
all upper-case. This caused a crash when the incoming string
is set to "cbr" instead of "CBR". Make the string comparison
case insensitive.
2025-04-01 23:18:15 -04:00
Huts, Roman 11f2322711 obs-ffmpeg: Fix throughput checks for older AMD driver 2025-03-14 08:43:14 -04:00
Huts, Roman 1a2f8c2844 obs-ffmpeg: Add AMD AV1 B-frame support 2025-03-13 16:53:16 -04:00
PatTheMav d6e5ecd88a plugins: Add ARM64 support to obs-ffmpeg, obs-filters, and obs-outputs 2025-03-12 16:33:00 -04:00
Alex Luccisano e8c0e35fb4 obs-ffmpeg: Use obs_encoder_video_tex_active() for AMF
Use the recently added `obs_encoder_video_tex_active()` API
for AMD AMF-based encoders, similar to the recent commit for
obs-nvenc. This allows the OBS canvas to use non-NV12 pixel
formats (such as I444) while the multitrack video encoders will
use NV12 or P010 textures converted using the GPU.
2025-01-29 15:01:19 -05:00
tytan652 ecb0381b8e obs-ffmpeg: Fix deprecation with FFmpeg 7.1 2025-01-24 17:38:24 -05:00
David Rosca 173487afaf obs-ffmpeg: Add QVBR rate control for VA-API 2025-01-24 15:04:50 -05:00
Translation Updater 0b2c85845e Update translations from Crowdin 2024-12-06 23:21:55 +00:00
tytan652 dfc3a69c52 obs-ffmpeg: Avoid setting negative bitrate for lossless audio codec
Since FFmpeg 7.1 a check was added to disallow pre-initializing encoder
with a negative bitrate.

https://github.com/FFmpeg/FFmpeg/commit/74385dd496bdcda9a6e029fabf4946f2234a0d13
2024-11-20 13:27:38 -05:00
Exeldro 9e7b51a585 obs-ffmpeg: Fix deadlock on shutting down muxer 2024-10-07 15:16:42 -04:00
Translation Updater e6d9f73736 Update translations from Crowdin 2024-10-05 05:02:27 +00:00
Ryan Foster a1fbf1015f clang-format: Increase column limit from 80 to 120 2024-10-04 18:19:27 -04:00
tytan652 42670ab4e3 plugins/test: Remove legacy CMake remnants
Some legacy files were missed in 72428ccd97
2024-10-03 17:32:08 -04:00
PatTheMav 6c590805e8 cmake: Update supported CMake version range to 3.28 and 3.30 2024-09-13 14:42:32 -04:00
Exeldro 7a35d7c549 obs-ffmpeg: Add logging of audio track 2024-09-12 18:07:19 -04:00
tytan652 31385006d5 Remove legacy_check CMake macro
The macro was not removed in 72428ccd97
waiting for submodules to be be updated to a commit where their legacy
code path is removed.
2024-09-11 13:24:39 -04:00
tytan652 72428ccd97 Remove CMake legacy code path
Except submodules and legacy_check macro since the former depend on it.
2024-08-28 13:53:25 -04:00
Norihiro Kamae 15038232c5 obs-ffmpeg: Remove unexisting class name declaration
The class `Logger` was declared but it is never defined nor used.
2024-08-24 16:12:12 -07:00
derrod baa1e1dc35 obs-ffmpeg: Remove compatibility with FFmpeg < 6.1 2024-08-23 13:44:04 -04:00
Lluís Batlle i Rossell 7c85253667 obs-ffmpeg: Fix VAAPI/NVENC ifdefs
VAAPI init was under NVENC clauses, so it was disabled if no NVENC.

That was introduced in af555b9372
from #10536, which refactored NVENC.
2024-08-16 13:25:07 -04:00
PatTheMav b8cfacaec3 Update formatting of CMake files 2024-08-14 12:07:47 -04:00
pkv 1451554fb8 obs-ffmpeg: Fix SRT listener bug
Fixes #10504.
There was a bug in FFmpeg implementation which was hidden by a bug in
libsrt; it was fixed in a recent commit [1].
When we ported FFmpeg libsrt.c to obs, we brought the said bug along.
When starting an SRT stream in listener mode, if no connection is made
by a client, there were two issues:
- 1) obs was stuck into a connecting loop,
- 2) the socket was not closed when exiting OBS.
This fixes the issue so that SRT is displaying that a stream started
when in listener mode even if NO client is connected.
This is the correct behaviour for a listener.
The stream now closes properly.

[1] https://git.videolan.org/?p=ffmpeg.git;a=commit;h=87677c2195e86b126c3438439a05d0a46ae5bb50
Signed-off-by: pkv <pkv@obsproject.com>
2024-08-10 01:54:27 -07:00
derrod af555b9372 obs-ffmpeg: Remove native/disable FFmpeg NVENC 2024-08-08 22:52:40 +02:00
Norihiro Kamae e9c440401c obs-ffmpeg: Resolve unused-function warnings 2024-08-07 17:27:49 -04:00
Ruwen Hahn b2d83efcf3 obs-ffmpeg: Disable AMF DTS adjustment for AV1 2024-07-30 11:10:47 -04:00
Ruwen Hahn e7bf19d139 obs-ffmpeg: Disable NVENC DTS adjustment for AV1 2024-07-30 11:10:47 -04:00
tytan652 2a53015ad7 deps,shared,plugins: Move opts-parser to shared folder 2024-07-27 07:38:36 +02:00
tytan652 ade04f4f1c deps,shared,obs-ffmpeg: Move media-playback to shared folder 2024-07-27 07:38:36 +02:00
Translation Updater e7d6707fa7 Update translations from Crowdin 2024-07-17 09:34:12 +00:00
derrod c6a100a980 obs-ffmpeg: Honor preferred format in native NVENC 2024-07-06 16:18:52 -07:00
derrod b34fbb116e obs-ffmpeg: Check if current NVENC configuration supports 4:4:4 encode 2024-06-26 13:57:43 -04:00
tt2468 6c389271b3 obs-ffmpeg: Close VAAPI device on vaInitialize fail
On some systems (eg. mine), VAAPI fails on vaInitialize. Valgrind was
able to spot that the device was not being closed, and it appears to
have been correct. This fixes a memory leak.
2024-06-19 19:46:05 -07:00
derrod 86502764b9 obs-ffmpeg: Set encoder error message for CUDA errors 2024-06-10 17:08:57 -04:00
Translation Updater 8999d9fef9 Update translations from Crowdin 2024-06-07 09:47:58 +00:00
Kurt Kartaltepe fc1ab5fcbc obs-ffmpeg: Check correct VA-API codec support
Previously, we just checked for H264 regardless of which codec was
selected. This mostly worked, but on Fedora they ship AV1 without H264
or HEVC. In that case users wont see AV1 as an option.
2024-06-01 19:14:46 -04:00
pkv 06e2b31001 obs-ffmpeg: Fix 7.1 ALAC encoding
Commit [1] added ALAC & PCM support.
But 7.1 ALAC encoding fails.
This fixes the issue by assigning the correct 7.1 layout supported by
FFmpeg ALAC encoder (7.1(wide)).

[1] https://github.com/obsproject/obs-studio/commit/3ae98511d09f1ebaf5c9cc005a285efd1a26aeff

Signed-off-by: pkv <pkv@obsproject.com>
2024-05-09 10:27:20 -04:00
Kurt Kartaltepe 01b61fafbf obs-ffmpeg: Release encode texture early
During high graphics thread pressure it can take a significant time to
acquire the graphics lock. This change releases the OpenGL texture after
rendering to avoid the 2nd lock after sending the frame to FFmpeg. This
improves 99%-tile/100%-tile and median encode in a near encoder overload
scenario, and modestly raises the ceiling before encoder overload in my
test scene.

Master:
min=0 ms, median=4.29 ms, max=33.072 ms, 99th percentile=8.877 ms
min=0 ms, median=4.438 ms, max=77.157 ms, 99th percentile=9.853 ms
min=0 ms, median=4.527 ms, max=57.292 ms, 99th percentile=9.282 ms

This commit:
min=0.97 ms, median=3.009 ms, max=13.215 ms, 99th percentile=5.899 ms
min=1.181 ms, median=2.91 ms, max=9.854 ms, 99th percentile=5.56 ms
min=0.461 ms, median=3.013 ms, max=10.693 ms, 99th percentile=5.871 ms
2024-05-02 18:15:01 -04:00
derrod 14f588f318 obs-ffmpeg: Fix output path logging 2024-04-24 16:03:14 -04:00
derrod 8d2f4ed3e1 obs-ffmpeg-mux: Use new process args/pipe API 2024-04-20 18:30:46 -07:00
David Rosca 06e364b670 obs-ffmpeg: Implement texture encoding for VAAPI 2024-04-20 17:03:54 -07:00
tytan652 02ead5b096 obs-ffmpeg: Fix unused variable in native NVENC 2024-04-16 11:15:22 -04:00