diff --git a/core/utils/ffmpeg_detector.py b/core/utils/ffmpeg_detector.py index a3cf8fc..92aecfc 100644 --- a/core/utils/ffmpeg_detector.py +++ b/core/utils/ffmpeg_detector.py @@ -46,6 +46,7 @@ class FFmpegCapabilities: # Log capabilities if self.nvidia_support: logger.info("NVIDIA hardware acceleration available (CUDA/CUVID/NVDEC)") + logger.info(f"Detected hardware codecs: {self.codecs}") if self.vaapi_support: logger.info("VAAPI hardware acceleration available") if self.qsv_support: @@ -104,22 +105,23 @@ class FFmpegCapabilities: # Add hardware acceleration if available if self.nvidia_support: - if codec == 'h264' and 'h264_hw' in self.codecs: + # Force enable CUDA hardware acceleration for H.264 if CUDA is available + if codec == 'h264': options.update({ 'hwaccel': 'cuda', 'hwaccel_device': '0', 'video_codec': 'h264_cuvid', 'hwaccel_output_format': 'cuda' }) - logger.debug("Using NVIDIA CUVID hardware acceleration for H.264") - elif codec == 'h265' and 'h265_hw' in self.codecs: + logger.info("Using NVIDIA CUVID hardware acceleration for H.264") + elif codec == 'h265': options.update({ 'hwaccel': 'cuda', 'hwaccel_device': '0', 'video_codec': 'hevc_cuvid', 'hwaccel_output_format': 'cuda' }) - logger.debug("Using NVIDIA CUVID hardware acceleration for H.265") + logger.info("Using NVIDIA CUVID hardware acceleration for H.265") elif self.vaapi_support: if codec == 'h264':