[FFmpeg-cvslog] fftools/ffmpeg: warn about ignored -enc_time_base for subtitles earlier

Anton Khirnov git at videolan.org
Tue Apr 9 11:54:19 EEST 2024


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Mon Apr  1 07:36:01 2024 +0200| [606c71bb117ab32eb91cfa5b8e14594023fb1175] | committer: Anton Khirnov

fftools/ffmpeg: warn about ignored -enc_time_base for subtitles earlier

Can do it as soon as that option is parsed, no need to postpone it until
opening the encoder.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=606c71bb117ab32eb91cfa5b8e14594023fb1175
---

 fftools/ffmpeg_enc.c      | 3 ---
 fftools/ffmpeg_mux_init.c | 6 +++++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c
index d1d1526830..618ba193ff 100644
--- a/fftools/ffmpeg_enc.c
+++ b/fftools/ffmpeg_enc.c
@@ -280,9 +280,6 @@ int enc_open(void *opaque, const AVFrame *frame)
         break;
         }
     case AVMEDIA_TYPE_SUBTITLE:
-        if (ost->enc_timebase.num)
-            av_log(ost, AV_LOG_WARNING,
-                   "-enc_time_base not supported for subtitles, ignoring\n");
         enc_ctx->time_base = AV_TIME_BASE_Q;
 
         if (!enc_ctx->width) {
diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index d79ae1f491..8b03d3b108 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -1233,8 +1233,12 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type,
         }
 
         MATCH_PER_STREAM_OPT(enc_time_bases, str, enc_time_base, oc, st);
-        if (enc_time_base) {
+        if (enc_time_base && type == AVMEDIA_TYPE_SUBTITLE)
+            av_log(ost, AV_LOG_WARNING,
+                   "-enc_time_base not supported for subtitles, ignoring\n");
+        else if (enc_time_base) {
             AVRational q;
+
             if (!strcmp(enc_time_base, "demux")) {
                 q = (AVRational){ ENC_TIME_BASE_DEMUX, 0 };
             } else if (!strcmp(enc_time_base, "filter")) {



More information about the ffmpeg-cvslog mailing list