72 Commits
Author SHA1 Message Date
Warchamp7andRyan Foster 30b63c6849 Update C++ files with braces 2026-06-09 13:41:19 -04:00
Alex LuccisanoandRyan Foster 0943ea2cf6 plugins: Apply multitrack dynamic bitrate flag
Enable the `OBS_ENCODER_CAP_MULTITRACK_DYN_BITRATE` capability on
the encoders that support it.
2026-06-05 14:11:55 -04:00
Alex LuccisanoandRyan Foster b1be50013f obs-ffmpeg: Rework AMF dynamic bitrate change behavior
The `amf_xxx_update()` functions for AVC, HEVC, and AV1 are
unconditionally invoking Flush() and ReInit() even though this is not
required in all situations. Changing the bitrate at least in CBR mode
does not require the flush operation and can result in unaligned IDR
frames across members of an encoder group. Do not flush the pipeline
for CBR bitrate changes; instead, force an IDR to occur with the
bitrate change.
2026-06-05 14:11:55 -04:00
TaruliaandRyan Foster 1290898c74 plugins: Set missed default bitrates to 6000 kbps
efca325 already increased the default bitrate for various encoders.
However, some were missed and this commit fills the gap:

* Mac-VT
* OpenH264
* Texture AMF
* VAAPI
2025-12-17 21:12:59 -05:00
Richard StanwayandRyan Foster efca325c2c frontend, plugins: Set default bitrate to 6000 kbps
The default of 2500 kbps was chosen 10 years ago and times have changed.
Logs and forums posts show that many users of OBS for recording don't
change their bitrate and end up with a 2.5 mbps recording which looks
terrible.

Now that service bitrate enforcement exists, this will be automatically
capped to the maximum bitrate for streaming services, so the only time
this should result in a problem is if the user's upload speed is the
limiting factor, hopefully rarer these days with increasing internet
speeds.
2025-09-17 19:56:04 -04:00
Huts, RomanandRyan Foster ef4c542850 obs-ffmpeg: Add missing color range property setting for AMD AV1 encoder 2025-08-21 17:16:06 -04:00
Dennis SädtlerandRyan Foster c1a65901f5 obs-ffmpeg: Correct P-frame packet priority in AMF encoder 2025-08-21 14:12:20 -04:00
Huts, RomanandRyan Foster 345700b199 obs-ffmpeg: Add Pre-Analysis checkbox for AMD encoder 2025-08-20 15:15:08 -04:00
Huts, RomanandRyan Foster 4fb20ee9ad obs-ffmpeg: Update default AMD encoding settings 2025-08-20 15:15:08 -04:00
Huts, RomanandRyan Foster 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, RomanandRyan Foster c518f69c84 obs-ffmpeg: Add Pre-Analysis checkbox for AMD encoder 2025-05-05 17:43:00 -04:00
Huts, RomanandRyan Foster 5a1f622ac1 obs-ffmpeg: New default AMD encoding settings
# Conflicts:
#	plugins/obs-ffmpeg/texture-amf.cpp
2025-05-05 17:43:00 -04:00
Alex LuccisanoandRyan Foster 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 LuccisanoandRyan Foster 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
Huts, RomanandRyan Foster 11f2322711 obs-ffmpeg: Fix throughput checks for older AMD driver 2025-03-14 08:43:14 -04:00
Huts, RomanandRyan Foster 1a2f8c2844 obs-ffmpeg: Add AMD AV1 B-frame support 2025-03-13 16:53:16 -04:00
Alex LuccisanoandRyan Foster 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
Ryan Foster a1fbf1015f clang-format: Increase column limit from 80 to 120 2024-10-04 18:19:27 -04:00
Ruwen HahnandRyan Foster b2d83efcf3 obs-ffmpeg: Disable AMF DTS adjustment for AV1 2024-07-30 11:10:47 -04:00
Alex LuccisanoandLain c0f71f002c obs-ffmpeg: Use video_output_info in amf_create_encoder()
The frame rate used to initialize an AMF encoder should be aligned
with the derived frame rate in video_output_info instead of the global
obs_video_info structure. With this change, IDRs can be aligned when
multiple renditions are being encoded.

Using video_output_info members for the format, colorspace, and range
parameters in addition to the frame rate provides a single source for
this information and obs_video_info is no longer needed.
2024-04-13 17:00:26 -07:00
Evgeny PavlovandGitHub b79ba49252 obs-ffmpeg: Fix wrong framerate in AMF VUI header
Frame rate should be defined before AMF encoder initialization,
because this information is used for setting vui_time_scale in SPS.
If frame rate isn't defined before initialization,
then AMF encoder set default frame rate into VUI header (30 fps).
2024-02-03 17:31:00 -06:00
rhutsAMDandRyan Foster ab0b0cb7e2 obs-ffmpeg: Default the number of B-frames to 3 2024-01-22 09:48:12 -05:00
rhutsAMDandRyan Foster e657e62c29 obs-ffmpeg: Fix issue with B-frames introducing motion blur
If a user sets both AdaptiveMiniGOP=true and EnablePreAnalysis=true
in the AMF/FFmpeg options field, AMF will adaptively insert
B-pictures, and no longer uses the fixed B pattern.

For a fixed B-frames pattern, it is expected that increasing B-frames
can cause a quality drop for certain content such as with high motion.
AdaptiveMiniGOP is recommended when using B-frames to improve the
quality in such cases. AdaptiveMiniGOP is dependent on PreAnalysis
which means that trying to enable it without having PreAnalysis turned
ON will have no negative effect (AdaptiveMiniGOP won't be enabled).
2024-01-22 09:48:12 -05:00
Rodney 730ab5e6d1 obs-ffmpeg: Add ROI support to AMF 2024-01-11 13:36:35 +01:00
derrodandRyan Foster 5dde70ccff obs-ffmpeg: Readd OBS_ENCODER_CAP_DYN_BITRATE to AMF texture encoders 2023-10-05 16:55:21 -04:00
Richard StanwayandLain d3ab68c5ca plugins: Quote program paths used in os_process_pipe_create
These end up being passed to CreateProcessW, so paths with spaces in the
name may be open to misinterpretation by the OS.
2023-08-26 16:44:53 -07:00
Ruwen Hahn 526990d37c obs-ffmpeg: Enable GPU scaling for AMF texture encoder 2023-06-26 13:32:25 +02:00
Huts, RomanandRyan Foster 94d0b654f0 obs-ffmpeg: Fix logic in one of the AMF preset fallback checks 2023-06-16 18:37:07 -04:00
rhutsAMDandLain 4bfe291520 obs-ffmpeg: Consider requested throughput in AMF preset fallback 2023-06-06 18:27:56 -07:00
Huts, RomanandLain 275bb344d8 obs-ffmpeg: Fix AMF encoder reconfiguration
Must Flush() or Drain() before ReInit()
2023-06-03 14:37:57 -07:00
Ryan Foster 877c1c74d0 obs-ffmpeg: Set error message for AMF with P216/P416
If P216 or P416 color formats are selected with AMF, these color formats
were not explicitly handled, so the switch statements would end up in
the default case. If the user had also selected a Rec. 2100 color space,
this would result in the strange error message:
"OBS does not support 8-bit output of Rec. 2100."

This message is confusing and does not correctly reflect the chosen
settings. Let's explicitly handle the P216/P416 cases and provide a more
accurate error message.
2023-05-01 18:45:32 -04:00
derrodandJim ba38a7d9f4 obs-ffmpeg: Disable AMF texture encoder runtime reconfiguration 2023-04-05 10:18:20 -07:00
PatTheMavandRyan Foster 349372b3b3 cmake: Add changes for CMake build framework 3.0
New code path only taken if OBS_CMAKE_VERSION is set to 3.0.0 or
greater, old functionality remains unchanged.
2023-03-26 18:20:38 -04:00
tytan652andRyan Foster 6db418fb3f obs-ffmpeg: Replace external/AMF folder by obs-deps headers 2023-03-07 14:55:03 -05:00
Chris (Flaeri)andRyan Foster e7cd29bbe5 obs-ffmpeg: Implement QVBR for AMF encoders
Makes QVBR rate control usable. Fix wrong rate control check on line
1457. Switch from bitrate to CQ/QP value (no bitrate needed).
2023-03-03 21:48:59 +00:00
jp9000 122e864c38 obs-ffmpeg, obs-qsv11: Ensure adapter order in encoder tests
On systems with multiple graphics adapters, one card can be configured
as power saving, and another card can be configured as performance.
Sometimes, OBS and the encoder test subprocesses will not be configured
the same way, so it's necessary to provide adapter order to the encoder
test subprocesses.

This change ensures the adapter order by passing the LUIDs to the test
subprocesses. The adapter indexes will then be updated accordingly.
2022-12-19 12:17:30 -08:00
Jim c84fae52e8 obs-ffmpeg: Fix AMF default CQP value
Was 7 for some reason, was supposed to be 20
2022-12-10 19:03:15 -08:00
Roman HutsandJim 4ba6b8b6ee obs-ffmpeg: Add new rate control method mappings for AVC/HEVC 2022-12-09 15:37:09 -08:00
Roman HutsandJim 72a2c3baaa obs-ffmpeg: Add new rate control methods for AMD AVC/HEVC 2022-12-03 15:39:38 -08:00
ChrisandRyan Foster 3d87b3b948 obs-ffmpeg: Disable VBAQ for H264 CQP rate control
Checks if rate control is CQP, if not, enable VBAQ. As per AMD, VBAQ
should not be used with CQP.
2022-11-30 17:42:59 -05:00
ChrisandJim c4a8364b8c obs-ffmpeg: Disable VBAQ for HEVC CQP rate control
Check rate control, if cqp (0), dont use vbaq
2022-11-22 04:13:56 -08:00
Matt Gajownik 0716e8b482 obs-ffmpeg: Fix building without HEVC on Windows 2022-11-21 18:54:09 +11:00
Roman Hutsandjp9000 341f288b57 obs-ffmpeg: Fix encoder preset quality fallbacks for AVC/HEVC/AV1
(Jim note: The missing description of this commit is that basically, the
CAP_MAX_THROUGHPUT value returns a different result based upon what the
other settings are currently set to. It didn't operate the way it was
originally programmed.)
2022-11-18 18:18:08 -08:00
Roman Hutsandjp9000 927733240c obs-ffmpeg: Add AMF AV1 encoder 2022-11-18 18:18:08 -08:00
Roman Hutsandjp9000 a8fc9226f8 obs-ffmpeg: Use codec enum for AMF texture encode check 2022-11-18 18:18:08 -08:00
Roman Hutsandjp9000 8b386a6417 obs-ffmpeg: Make AMF AVC encoder name consistent w/ others 2022-11-18 18:18:08 -08:00
Roman Hutsandjp9000 ef1a9c46e3 obs-ffmpeg: Only show b-frames AMF property for AVC 2022-11-18 18:18:08 -08:00
Roman Hutsandjp9000 1948ddf2fa obs-ffmpeg: Only allow AMF high/baseline profiles for AVC 2022-11-18 18:18:08 -08:00