From: Steinar H. Gunderson Date: Sat, 15 Apr 2023 23:49:51 +0000 (+0200) Subject: Add a warning when trying to hardware-decode H.264 Baseline streams. X-Git-Tag: 2.2.1~4 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=ef52ac608e069f76af5e56de585833e8efa93168 Add a warning when trying to hardware-decode H.264 Baseline streams. --- diff --git a/nageru/ffmpeg_capture.cpp b/nageru/ffmpeg_capture.cpp index 863f4fb..e099d18 100644 --- a/nageru/ffmpeg_capture.cpp +++ b/nageru/ffmpeg_capture.cpp @@ -479,6 +479,11 @@ AVPixelFormat get_hw_format(AVCodecContext *ctx, const AVPixelFormat *fmt) if (config->pix_fmt == *fmt_ptr) { fprintf(stderr, "Initialized '%s' hardware decoding for codec '%s'.\n", av_hwdevice_get_type_name(type), ctx->codec->name); + if (ctx->profile == FF_PROFILE_H264_BASELINE) { + fprintf(stderr, "WARNING: Stream claims to be H.264 Baseline, which is generally poorly supported in hardware decoders.\n"); + fprintf(stderr, " Consider encoding it as Constrained Baseline, Main or High instead.\n"); + fprintf(stderr, " Decoding might fail and fall back to software.\n"); + } return config->pix_fmt; } }