Commit Graph

18 Commits (master)

Author SHA1 Message Date
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