From patchwork Sun Jul 5 13:05:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manolis Stamatogiannakis X-Patchwork-Id: 20819 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 2C50044A18F for ; Sun, 5 Jul 2020 16:06:12 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 04E1D68A3D6; Sun, 5 Jul 2020 16:06:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 76E5068AFA5 for ; Sun, 5 Jul 2020 16:06:06 +0300 (EEST) Received: by mail-ej1-f46.google.com with SMTP id l12so39557537ejn.10 for ; Sun, 05 Jul 2020 06:06:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=97dBolQfRs2ZF3CDdieHcwMwT+hBqVUuE9CiNN8nuxM=; b=aLvI0cXl5uTqdGjTiBmLJxU4Dp5eE0vT5cAjZDRurBSudt7gBdO0XUdygWWvvvWS/o 8O6S8IcpgC+qiUsn+Ds0ZFCs534JJDAFuC9AID1fDjWvPqE3+flawSbu9C1p8EaZJD/M cc3Pob6qRStnemgmj9ri/9kuxkHCupcyVTQ+zdc8VJhh6mTEa9YDmaaALYkgnC3WFrSg pfArjvOEMl/wOE56uj1hcBiz7W5o7NaMtabIXor0PJ3XdKhqdQ+hbIJi98tZ3DB0kZfP uPSj4KNtSSwfVklnRNj0EbHvQbW31wFP4WdsL0HDu9AWbwVMngctRVEMhBVk7psNHn4W 63Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=97dBolQfRs2ZF3CDdieHcwMwT+hBqVUuE9CiNN8nuxM=; b=FMtMv011+rRYsFlF7h/W8kLnB+sVC75CnoKQW3L0Pxqel76Zg+QiNtKVPsqLp6uB/e 7lmcPg1OMrT7D5yLfHL6AKUdHlZkhmLzeQiiR3j4z4lSezII80zcp2bY4Malfmx8gx+N vtTGM5p2QcpNb02vj6dY76bmby77SYvBvJJ41ydt+le4iXP+mxNbFDi++sZo3DGZmU5g AOhSIrU4kl0UeYWMOWJbuv/tsMHkIQFXwOuTnUk3PK75czLnnfk0hPnHLHqwNWyAAYsn Gz8SbsVLE7/m0Jh2zCTUNCVJrrgq7OBlwbdF41jkZR4EKD/fIperZCHscYB/ljZX+KYw Mq6w== X-Gm-Message-State: AOAM5328Al7QTQSMNUQiD1T8VDEDKjseohh39jG6muS4JFWN3yZOLwZE Br8PW2x6GrqCznmC7jfy0gGKTSpPREE= X-Google-Smtp-Source: ABdhPJyGd6AV8g5xEWz1ZQgJjZ6WmVIPmbS17lxxZGzK+Y7kkQMC4JMJGXCa0XzUADAtx0KvesuWig== X-Received: by 2002:a17:906:cc0e:: with SMTP id ml14mr38726205ejb.432.1593954365427; Sun, 05 Jul 2020 06:06:05 -0700 (PDT) Received: from wasteland.vu.local ([145.108.189.179]) by smtp.gmail.com with ESMTPSA id j5sm21339304edk.53.2020.07.05.06.06.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2020 06:06:04 -0700 (PDT) From: Manolis Stamatogiannakis To: ffmpeg-devel@ffmpeg.org Date: Sun, 5 Jul 2020 15:05:33 +0200 Message-Id: <20200705130535.5615-1-mstamat@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200704194543.1738-1-mstamat@gmail.com> References: <20200704194543.1738-1-mstamat@gmail.com> Subject: [FFmpeg-devel] [PATCH 1/3] avfilter/vf_subtitles: add shift option X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Manolis Stamatogiannakis MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Allows shifting of subtitle display times to align them with the video. This avoids having to rewrite the subtitle file in order to display subtitles correctly when input is seeked (-ss). Also handy for minor subtitle timing corrections without rewriting the subtitles file. Signed-off-by: Manolis Stamatogiannakis --- doc/filters.texi | 8 ++++++++ libavfilter/vf_subtitles.c | 23 +++++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index ad2448acb2..c962ac55b0 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -17935,6 +17935,9 @@ The filter accepts the following options: @item filename, f Set the filename of the subtitle file to read. It must be specified. +@item shift +Shift subtitles timings by the specified amount. + @item original_size Specify the size of the original video, the video for which the ASS file was composed. For the syntax of this option, check the @@ -17991,6 +17994,11 @@ To make the subtitles stream from @file{sub.srt} appear in 80% transparent blue subtitles=sub.srt:force_style='Fontname=DejaVu Serif,PrimaryColour=&HCCFF0000' @end example +To re-sync subtitles after seeking the input e.g. with @code{-ss 20:20}, use: +@example +subtitles=filename=sub.srt:shift='-20\:20' +@end example + @section super2xsai Scale the input by 2x and smooth using the Super2xSaI (Scale and diff --git a/libavfilter/vf_subtitles.c b/libavfilter/vf_subtitles.c index 1bd42391e0..125fbd9ac7 100644 --- a/libavfilter/vf_subtitles.c +++ b/libavfilter/vf_subtitles.c @@ -52,6 +52,7 @@ typedef struct AssContext { char *filename; char *fontsdir; char *charenc; + int64_t shift; char *force_style; int stream_index; int alpha; @@ -103,6 +104,11 @@ static av_cold int init(AVFilterContext *ctx) return AVERROR(EINVAL); } + if (ass->shift != 0) { + ass->shift = av_rescale_q(ass->shift, AV_TIME_BASE_Q, av_make_q(1, 1000)); + av_log(ctx, AV_LOG_DEBUG, "Shifting subtitles by %0.3fsec.\n", ass->shift/1000.0); + } + ass->library = ass_library_init(); if (!ass->library) { av_log(ctx, AV_LOG_ERROR, "Could not initialize libass.\n"); @@ -267,6 +273,7 @@ static const AVOption subtitles_options[] = { {"stream_index", "set stream index", OFFSET(stream_index), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS}, {"si", "set stream index", OFFSET(stream_index), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS}, {"force_style", "force subtitle style", OFFSET(force_style), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS}, + {"shift", "shift subtitles timing", OFFSET(shift), AV_OPT_TYPE_DURATION, {.i64 = 0}, INT64_MIN, INT64_MAX, FLAGS }, {NULL}, }; @@ -297,7 +304,7 @@ AVFILTER_DEFINE_CLASS(subtitles); static av_cold int init_subtitles(AVFilterContext *ctx) { - int j, ret, sid; + int j, ret, sid, nskip; int k = 0; AVDictionary *codec_opts = NULL; AVFormatContext *fmt = NULL; @@ -448,6 +455,7 @@ static av_cold int init_subtitles(AVFilterContext *ctx) av_init_packet(&pkt); pkt.data = NULL; pkt.size = 0; + nskip = 0; while (av_read_frame(fmt, &pkt) >= 0) { int i, got_subtitle; AVSubtitle sub = {0}; @@ -458,8 +466,17 @@ static av_cold int init_subtitles(AVFilterContext *ctx) av_log(ctx, AV_LOG_WARNING, "Error decoding: %s (ignored)\n", av_err2str(ret)); } else if (got_subtitle) { - const int64_t start_time = av_rescale_q(sub.pts, AV_TIME_BASE_Q, av_make_q(1, 1000)); + const int64_t start_time = av_rescale_q(sub.pts, AV_TIME_BASE_Q, av_make_q(1, 1000)) + ass->shift; const int64_t duration = sub.end_display_time; + + if (start_time + duration < 0) { + nskip++; + goto pkt_end; + } else if (nskip > 0) { + av_log(ctx, AV_LOG_INFO, "Skipped %d subtitles out of time range.\n", nskip); + nskip = 0; + } + for (i = 0; i < sub.num_rects; i++) { char *ass_line = sub.rects[i]->ass; if (!ass_line) @@ -472,6 +489,8 @@ static av_cold int init_subtitles(AVFilterContext *ctx) } } } + +pkt_end: av_packet_unref(&pkt); avsubtitle_free(&sub); } From patchwork Sun Jul 5 13:05:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manolis Stamatogiannakis X-Patchwork-Id: 20821 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 72EE744BBFC for ; Sun, 5 Jul 2020 17:02:09 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4492368B0EE; Sun, 5 Jul 2020 17:02:09 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4AF4B68A41E for ; Sun, 5 Jul 2020 17:02:02 +0300 (EEST) Received: by mail-lj1-f194.google.com with SMTP id q7so28974072ljm.1 for ; Sun, 05 Jul 2020 07:02:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KdMmjrMfvo2iLh5QwEeNgHu6QDZhZwnPfyDL1cLdfig=; b=nCP5GhvKNQGEfq5AgMNuxW7cy8YsLE4B+nyxawQCEqDYaGZA2qbskNulsm+Pb+atsG uRd0NRbkSm1XTQn4zbgM8ImTcK0mGpyL3XIgpBX6qkWp821sjrzxfbyeLOLBLHY75XuB 3bU1365/Zpd1SemfqtleVVjfMPrFB9etaAzwu/patCIbydlQq10HVWyk0Mc5/Qv8RgOe 3oOuNPMrISqhYSvoAL+/gSnwqVxr/wXmME7hSRIvrdTHmFrf2XWm8yZgi5Pc5NuOt2na 3+ziwhKyeGiSUjToFmfuuPALMGqH9TeqH4zMV4pmzS5VTUnEpoMqZOzVhYsRWqTOpdhh 08LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KdMmjrMfvo2iLh5QwEeNgHu6QDZhZwnPfyDL1cLdfig=; b=Ph0oJfPz6g2fUW2jSlzrIQqfqkZ031BifCTPWGThE3SSpApwG4dTjmWD9BGfSJwYgk THkzJrhNShbHk2rYClMc8uUxPXWzI4jAxnIsXMx9KUtO4lyjIB/wFGJdUKRs222gZY6r IJvXIs0GuApBUI0bWdvSRnDBpK6ejRf68dIkjiKCxmg4oyqQkKT9TRqpFbirw8EASmR6 cB3FFNU1wZslY9wj7Mr3CPTaRWAt54t+0kKzWTkDnZKFUyO53fT+nmG/DMGFAVpY4YAw jrGuGhc+Rn8AnLy+66WzNisyFN99kpn8ewAF9JHAgLIiGXoL4OA1mnU6yxNx4ZA8eSFC OuVw== X-Gm-Message-State: AOAM5304ej+4MYNmj+bwY21gTsMOd9amn3uWiv9rWrc9EqmfLApLpc/r d6yWUCu8wj8RtAgiGXVL0xSv9G6rXC0= X-Google-Smtp-Source: ABdhPJx2wyCytIcfCfWhZiXmfj5cbAUEHZXgfwU2V+xn46n5z5yQHtm81Zi/XDrcxjf45vR0A7pgyA== X-Received: by 2002:a17:906:6897:: with SMTP id n23mr38325766ejr.473.1593954371140; Sun, 05 Jul 2020 06:06:11 -0700 (PDT) Received: from wasteland.vu.local ([145.108.189.179]) by smtp.gmail.com with ESMTPSA id j5sm21339304edk.53.2020.07.05.06.06.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2020 06:06:10 -0700 (PDT) From: Manolis Stamatogiannakis To: ffmpeg-devel@ffmpeg.org Date: Sun, 5 Jul 2020 15:05:34 +0200 Message-Id: <20200705130535.5615-2-mstamat@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200705130535.5615-1-mstamat@gmail.com> References: <20200704194543.1738-1-mstamat@gmail.com> <20200705130535.5615-1-mstamat@gmail.com> Subject: [FFmpeg-devel] [PATCH 2/3] avfilter/vf_subtitles: add shift option for ass filter X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Manolis Stamatogiannakis MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Previously option implemented only for subtitles filter. Signed-off-by: Manolis Stamatogiannakis --- libavfilter/vf_subtitles.c | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/libavfilter/vf_subtitles.c b/libavfilter/vf_subtitles.c index 125fbd9ac7..09cca6aab8 100644 --- a/libavfilter/vf_subtitles.c +++ b/libavfilter/vf_subtitles.c @@ -67,11 +67,12 @@ typedef struct AssContext { #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM #define COMMON_OPTIONS \ - {"filename", "set the filename of file to read", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, \ - {"f", "set the filename of file to read", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, \ - {"original_size", "set the size of the original video (used to scale fonts)", OFFSET(original_w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, FLAGS }, \ - {"fontsdir", "set the directory containing the fonts to read", OFFSET(fontsdir), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, \ - {"alpha", "enable processing of alpha channel", OFFSET(alpha), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, FLAGS }, \ + {"filename", "set the filename of file to read", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, \ + {"f", "set the filename of file to read", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, \ + {"original_size", "set the size of the original video (used to scale fonts)", OFFSET(original_w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, FLAGS }, \ + {"fontsdir", "set the directory containing the fonts to read", OFFSET(fontsdir), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, \ + {"alpha", "enable processing of alpha channel", OFFSET(alpha), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, FLAGS }, \ + {"shift", "shift subtitles timing", OFFSET(shift), AV_OPT_TYPE_DURATION, {.i64 = 0 }, INT64_MIN, INT64_MAX, FLAGS }, \ /* libass supports a log level ranging from 0 to 7 */ static const int ass_libavfilter_log_level_map[] = { @@ -106,7 +107,7 @@ static av_cold int init(AVFilterContext *ctx) if (ass->shift != 0) { ass->shift = av_rescale_q(ass->shift, AV_TIME_BASE_Q, av_make_q(1, 1000)); - av_log(ctx, AV_LOG_DEBUG, "Shifting subtitles by %0.3fsec.\n", ass->shift/1000.0); + av_log(ctx, AV_LOG_INFO, "Shifting subtitles by %0.3fsec.\n", ass->shift/1000.0); } ass->library = ass_library_init(); @@ -233,6 +234,8 @@ AVFILTER_DEFINE_CLASS(ass); static av_cold int init_ass(AVFilterContext *ctx) { + int eid, nskip; + ASS_Event *event; AssContext *ass = ctx->priv; int ret = init(ctx); @@ -249,6 +252,24 @@ static av_cold int init_ass(AVFilterContext *ctx) ass->filename); return AVERROR(EINVAL); } + + /* Shift subtitles. */ + nskip = 0; + for (eid = 0; eid < ass->track->n_events; eid++) { + event = &ass->track->events[eid]; + event->Start += ass->shift; + if (event->Start + event->Duration < 0) { + ass_free_event(ass->track, eid); + nskip++; + continue; + } else if (nskip > 0) { + av_log(ctx, AV_LOG_INFO, "Skipped %d subtitles out of time range.\n", nskip); + memmove(event - nskip, event, (ass->track->n_events - eid) * sizeof(ASS_Event)); + ass->track->n_events -= nskip; + nskip = 0; + } + } + return 0; } @@ -273,7 +294,6 @@ static const AVOption subtitles_options[] = { {"stream_index", "set stream index", OFFSET(stream_index), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS}, {"si", "set stream index", OFFSET(stream_index), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS}, {"force_style", "force subtitle style", OFFSET(force_style), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS}, - {"shift", "shift subtitles timing", OFFSET(shift), AV_OPT_TYPE_DURATION, {.i64 = 0}, INT64_MIN, INT64_MAX, FLAGS }, {NULL}, }; @@ -466,6 +486,7 @@ static av_cold int init_subtitles(AVFilterContext *ctx) av_log(ctx, AV_LOG_WARNING, "Error decoding: %s (ignored)\n", av_err2str(ret)); } else if (got_subtitle) { + /* Shift subtitles. */ const int64_t start_time = av_rescale_q(sub.pts, AV_TIME_BASE_Q, av_make_q(1, 1000)) + ass->shift; const int64_t duration = sub.end_display_time; From patchwork Sun Jul 5 13:05:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manolis Stamatogiannakis X-Patchwork-Id: 20820 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 459CC44A18F for ; Sun, 5 Jul 2020 16:06:21 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3252D68AFE9; Sun, 5 Jul 2020 16:06:21 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ABDA168A08F for ; Sun, 5 Jul 2020 16:06:14 +0300 (EEST) Received: by mail-ej1-f42.google.com with SMTP id f12so13387109eja.9 for ; Sun, 05 Jul 2020 06:06:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5twOGYuNwC/3GMZrOWfV4DIXelCgydFq4Z8yu8V+KFw=; b=VArVBhwBIsdMBsuNsYeJL9QlmmTU6LzfmA0SLQDkXn2MaAHetBxgQouaY67WWHpx0W QhrwFgsq7/pghOFQ6zFLN3MSUa1GtK7MO9GS3JHwxte5i9Uhft2u3BfHYWqSftghV/tZ Ks2w+ln9u9/gZ8YCUWs3M95iy1k2DjMKVsomFpaT1aV+e7lRa6Hs0d9QDEV6O8igqrQ8 Moz6N3MsFr0EzWTe8LqoKQYQXJkKk3Tnuv5QCDkpPvZ7RThIZZABxSku95de+VYfm0Of OjRR3OLE8r3nxC/SuyDZ7pgfhVduX1ulYYdhU4zXkQFTLJyWF7JSoPZAx7Ps446DcKwE 0BHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5twOGYuNwC/3GMZrOWfV4DIXelCgydFq4Z8yu8V+KFw=; b=gH/Kbb9sAUkKwTNtEpLWMk4hylPPspx8quKPvIvyGh7f0kFkmxQJXlB4JAiuiU0fTp y3aVwGokigFOnCZ+bs38z6CHUhcURaLm2RTfvCOt5D2PDSsSu8DOpAB+oNrT7hXT9Ekz HDT6dxf8XpYjCoN9m5ZJ5gl6n/Ah8yjBdDgneh9S8fC/DWLrwaxRO9HmbMAcp6CuSBba l4AVOXtdAJi3wXv731B26HjTY2qKUfmVVP/Q3Fd+fLKFQVgw5CKGyMoKD32V4/7R4qPZ qsgBGJ3PrkxQSB0tmKoOwqDjh2w975Zj+vF2cVwYzbbwKwpWJbhlXsmg9StC/Y7zsa3j WRbw== X-Gm-Message-State: AOAM533e9vtCdpgmNN3I+3qOVmZcO6N6JILOAiRlFxha3j5KWcnRKM0G +7mWbaVsDLxHEEQ+4X+CSlwwcH0NIyQ= X-Google-Smtp-Source: ABdhPJyrjQK2bQ2/KA0d4EW4ZpYVTZkbUF7XmYBifuKPKSZw88IHTH56CxfjuPDb3uBErESHZI/LbA== X-Received: by 2002:a17:906:57c5:: with SMTP id u5mr23766525ejr.311.1593954373742; Sun, 05 Jul 2020 06:06:13 -0700 (PDT) Received: from wasteland.vu.local ([145.108.189.179]) by smtp.gmail.com with ESMTPSA id j5sm21339304edk.53.2020.07.05.06.06.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2020 06:06:13 -0700 (PDT) From: Manolis Stamatogiannakis To: ffmpeg-devel@ffmpeg.org Date: Sun, 5 Jul 2020 15:05:35 +0200 Message-Id: <20200705130535.5615-3-mstamat@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200705130535.5615-1-mstamat@gmail.com> References: <20200704194543.1738-1-mstamat@gmail.com> <20200705130535.5615-1-mstamat@gmail.com> Subject: [FFmpeg-devel] [PATCH 3/3] avfilter/vf_subtitles: Reorganized subtitles filter options. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Manolis Stamatogiannakis MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Some options are common between subtitles/ass filters. Rather than mentioning for each option whether it is common or not, the options are now displayed in two separate tables. Signed-off-by: Manolis Stamatogiannakis --- doc/filters.texi | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index c962ac55b0..c4ca39cb6d 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -6453,6 +6453,7 @@ This filter supports the following @ref{commands} that corresponds to option of @item planes @end table +@anchor{ass} @section ass Same as the @ref{subtitles} filter, except that it doesn't require libavcodec @@ -17929,15 +17930,12 @@ To enable compilation of this filter you need to configure FFmpeg with libavformat to convert the passed subtitles file to ASS (Advanced Substation Alpha) subtitles format. -The filter accepts the following options: +Common @ref{subtitles}/@ref{ass} filter options: @table @option @item filename, f Set the filename of the subtitle file to read. It must be specified. -@item shift -Shift subtitles timings by the specified amount. - @item original_size Specify the size of the original video, the video for which the ASS file was composed. For the syntax of this option, check the @@ -17952,12 +17950,18 @@ These fonts will be used in addition to whatever the font provider uses. @item alpha Process alpha channel, by default alpha channel is untouched. +@item shift +Shift subtitles timings by the specified amount. +@end table + +Additional options for @ref{subtitles} filter: + +@table @option @item charenc -Set subtitles input character encoding. @code{subtitles} filter only. Only -useful if not UTF-8. +Set subtitles input character encoding. Only useful if not UTF-8. @item stream_index, si -Set subtitles stream index. @code{subtitles} filter only. +Set subtitles stream index. @item force_style Override default style or script info parameters of the subtitles. It accepts a