]> git.sesse.net Git - nageru/commitdiff
Add a warning when trying to hardware-decode H.264 Baseline streams.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 15 Apr 2023 23:49:51 +0000 (01:49 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 15 Apr 2023 23:49:51 +0000 (01:49 +0200)
nageru/ffmpeg_capture.cpp

index 863f4fba4feaecc40b14d07b4662a04740c1894c..e099d18a34a5073ba1f8bc1b07158d40f778f720 100644 (file)
@@ -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;
                        }
                }