[FFmpeg-devel] [PATCH 4/4] libavcodec: silence bogus ffmpeg/ffplay specific error message

wm4 nfxjfg at googlemail.com
Thu Aug 8 01:04:39 CEST 2013

This error message suggests using the -sub_charenc command line option,
which is highly specific to the ffmpeg and ffplay utilities. This makes
the message entirely useless and actively misleading for applications.
(Users would try passing -sub_charenc directly to the application, which
would not work.)

Also, this message would cause the application to spam the user with
this message. Typically, an application would try to convert each
subtitle event, which leads in one error message per line. This is not
very useful behavior.

Applications should instead check the error code returned by the decoder
to detect this case.
 libavcodec/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 5069b11..36c35d5 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2333,7 +2333,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
             for (i = 0; i < sub->num_rects; i++) {
                 if (sub->rects[i]->ass && !utf8_check(sub->rects[i]->ass)) {
-                    av_log(avctx, AV_LOG_ERROR,
+                    av_log(avctx, AV_LOG_VERBOSE,
                            "Invalid UTF-8 in decoded subtitles text; "
                            "maybe missing -sub_charenc option\n");

More information about the ffmpeg-devel mailing list