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:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user