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>
This commit is contained in:
OvchinnikovDmitrii
2022-04-22 17:39:59 -07:00
committed by Jim
parent 4e206896b2
commit 4e140d2ffe
56 changed files with 11835 additions and 2 deletions

View File

@@ -294,6 +294,8 @@ static bool vaapi_supported(void)
#ifdef _WIN32
extern void jim_nvenc_load(bool h264, bool hevc);
extern void jim_nvenc_unload(void);
extern void amf_load(void);
extern void amf_unload(void);
#endif
#if ENABLE_FFMPEG_LOGGING
@@ -353,6 +355,11 @@ bool obs_module_load(void)
obs_register_encoder(&hevc_nvenc_encoder_info);
#endif
}
#ifdef _WIN32
amf_load();
#endif
#if !defined(_WIN32) && defined(LIBAVUTIL_VAAPI_AVAILABLE)
if (vaapi_supported()) {
blog(LOG_INFO, "FFMPEG VAAPI supported");
@@ -374,6 +381,7 @@ void obs_module_unload(void)
#endif
#ifdef _WIN32
amf_unload();
jim_nvenc_unload();
#endif
}