0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
Commit Graph

37 Commits

Author SHA1 Message Date
tytan652
6db418fb3f obs-ffmpeg: Replace external/AMF folder by obs-deps headers 2023-03-07 14:55:03 -05:00
Chris (Flaeri)
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 Huts
4ba6b8b6ee obs-ffmpeg: Add new rate control method mappings for AVC/HEVC 2022-12-09 15:37:09 -08:00
Roman Huts
72a2c3baaa obs-ffmpeg: Add new rate control methods for AMD AVC/HEVC 2022-12-03 15:39:38 -08:00
Chris
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
Chris
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 Huts
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 Huts
927733240c obs-ffmpeg: Add AMF AV1 encoder 2022-11-18 18:18:08 -08:00
Roman Huts
a8fc9226f8 obs-ffmpeg: Use codec enum for AMF texture encode check 2022-11-18 18:18:08 -08:00
Roman Huts
8b386a6417 obs-ffmpeg: Make AMF AVC encoder name consistent w/ others 2022-11-18 18:18:08 -08:00
Roman Huts
ef1a9c46e3 obs-ffmpeg: Only show b-frames AMF property for AVC 2022-11-18 18:18:08 -08:00
Roman Huts
1948ddf2fa obs-ffmpeg: Only allow AMF high/baseline profiles for AVC 2022-11-18 18:18:08 -08:00
Roman Huts
535ced04d5 obs-ffmpeg: Allow 0-51 for CQP property
0-51 makes it consistent with other encoder implementations (At least
for AVC/HEVC)
2022-11-18 18:18:08 -08:00
Roman Huts
21d079fdcc obs-ffmpeg: Use codec enum for amf_properties_internal 2022-11-18 18:18:08 -08:00
shinji3
9d7a6e7e8c obs-ffmpeg: Fix m3u8 recording in AMF 2022-09-29 15:47:26 -07:00
Ryan Foster
c5f1446ab3 obs-ffmpeg: Cap AMF encoder at 100 Mbps
The AMF docs specify that the maximum value for TARGET_BITRATE and
PEAK_BITRATE is 100,000,000 bit/s. Trying to set values above this
maximum value results in AMF choosing from its defaults instead of
capping at the maximum value. Let's cap at 100,000 Kbps in the UI to
prevent users from running in to this.

Fixes GitHub Issue obsproject/obs-studio#7423.
2022-09-24 16:38:17 -07:00
Jim
2e5f900fe6 obs-ffmpeg: In AMF, use bframe count + 1 as DTS offset
Recommended by Mikhail. Seems to work fine. Should also fix the DTS
regression.
2022-08-27 09:39:46 -07:00
Jim
4c3e671819 obs-ffmpeg: Set max AMF consecutive bframes to 3 by default
The AMF documentation states that this value is recommended to be 3 if
the bframe picture pattern property is a non-zero value.
2022-08-27 09:32:38 -07:00
Chris
7c36cba065 obs-ffmpeg: Change AMF bitrate to kbps
Move multiplication to when its passed to the encoder, so that bitrate
is kept in kbps. Changed for both for H264 and HEVC. Other encoders
(x264 and NVENC) already display bitrate in kbps in the log,
so it makes sense to mimic this with AMF. It's difficult to tell the
exact bitrate with bps.
2022-08-24 05:34:21 -07:00
jp9000
6dc8897e79 obs-ffmpeg: Fix AMF encoder lockup with older AMD cards
This goes back to a slightly older variant of the
SubmitInput/QueryOutput handling that doesn't use AMF's timeout
property. Older devices do not like it when you change the query timeout
on the fly and will lock up. So instead, wait one millisecond when the
AMF input is full, which appears to fix the issue according to testers.

Also adds a loop timeout in case it goes in an infinite loop (which it
shouldn't anymore, but still)

Big thanks to Flaeri for testing the old code, and Yukari for patiently
testing a whole bunch of builds.
2022-08-22 11:20:51 -07:00
Jim
a6c2bb1294 obs-ffmpeg: Use AMD example PTS/DTS offset
All this does is it uses the same exact code AMD uses with their own
example FFmpeg muxer code. Although instead of adding to the PTS, it
subtracts from the DTS.
2022-08-22 11:15:23 -07:00
Chris
0cc7ed4382 obs-ffmpeg: Add b-frame logging for AMD encoder
Add b-frame value to log for the AMD ENcoder When checking for b-frame
support, also set bf=0 so the log will reflect reality.
2022-08-17 05:38:54 -07:00
jpark37
eec66e10e3 obs-ffmpeg: Prevent invalid AMF combinations
Don't want to silently generate lossy video.
2022-08-16 07:37:36 -07:00
jpark37
690ba952de obs-ffmpeg: Fix leaks in AMF with unique_ptr 2022-08-16 07:37:36 -07:00
jp9000
2c43ca1dc6 obs-ffmpeg: Add b-frame option to AMF encoder 2022-08-10 02:20:11 -07:00
Chris
f5fe4d0acf obs-ffmpeg: Fix USAGE typo
Replace TRANSCONDING with TRANSCODING, because it is likely that the
typo compatibility will be removed in a future AMF header update. This
should also minimize confusion and improve search.
2022-08-06 20:02:48 -04:00
Vainock
e6a03be487 obs-ffmpeg, obs-transitions: Use property suffixes 2022-08-06 10:23:26 +10:00
Richard Stanway
68415fa08f obs-ffmpeg: Throw on invalid amf_format 2022-08-01 13:34:27 -07:00
Richard Stanway
ac025b51ac obs-ffmpeg: Use get_buf function to ensure buffers_mutex is locked 2022-08-01 13:34:27 -07:00
Richard Stanway
00408b6b3b obs-ffmpeg: Don't load AMF DLL before amf-test
In the event that simply loading the AMF DLL causes initialization code
to run that might crash, don't load the DLL before the AMF test process
has succeeded. Instead, we load the DLL as data to see if it exists,
then run the AMF test, then load the DLL for real.
2022-08-01 13:34:27 -07:00
jpark37
5ae7a92101 obs-ffmpeg: Set MaxCLL/MaxFALL for AMF 2022-07-29 23:23:25 -07:00
jp9000
f6f6690ccf obs-ffmpeg: Fix AMD falling back to wrong preset
If the API to query the maximum throughput isn't available, it was
intended to fall back to balanced. This code caused it to vall back to
speed instead because if the API isn't available, max_throughput will be
0. This fixes it to make it only fall back to balanced instead.
2022-07-24 11:18:18 -07:00
Richard Stanway
88226db6b3
obs-ffmpeg: Fix AMF AVC / HEVC check logic 2022-07-22 00:45:34 +02:00
OvchinnikovDmitrii
4e140d2ffe obs-ffmpeg: Add texture-based hardware AMD encoder
Adds support for texture-based AMD encoding, with both H264, HEVC, and
HDR support. Falls back to FFmpeg when texture-based encoding cannot be
used for whatever reason.

(Jim note: This is based upon obsproject/obs-studio#4538 by AMD/Luxoft
with fewer files, FFmpeg fallback for software encoding, and HDR
support. I also went to lengths to ensure that FFmpeg command line
parameters also works with it)

Co-authored-by: Jim <obs.jim@gmail.com>
2022-07-21 15:29:25 -07:00