[FFmpeg-devel] subtitles filter and -ss
Manolis Stamatogiannakis
mstamat at gmail.com
Sun May 3 21:16:32 EEST 2020
Thanks for the prompt response. It did save me from wasting more time
trying to get the value of -ss starting from the AVFilterContext pointer.
I've submitted a patch that adds a "shift" option to the plugin.
I've opted for "shift" instead of "seek" as the name of the new option.
This should make it evident that the option can also be used for applying
minor timing corrections to the subtitles.
Any feedback is welcome.
Best regards,
Manolis
On Sun, 3 May 2020 at 17:34, Gyan Doshi <ffmpeg at gyani.pro> wrote:
>
>
> On 03-05-2020 08:36 pm, Manolis Stamatogiannakis wrote:
> > Hello,
> >
> > I've noticed what appears to be a bug/missing feature in the subtitles
> > filter: when "-ss" is used for the input, it is not applied to the
> > subtitles stream. E.g., for the following command line, the video
> playback
> > will start on 20:10, but the subtitles will start from 00:00.
> >
> > ffmpeg -re -ss 20:10.00 -i input.mp4
> > -vf subtitles=subs.srt \
> > -c:v libx264 crf 25 -c:a aac -ab 160k \
> > -strict experimental \
> > -f flv $RTMP_URL
> >
> > This should be fairly straightforward to fix and review, so I'd like to
> > directly submit a patch rather than opening a bug and having someone else
> > fix it. As I'm not an expert with the ffmpeg internals, I'd like some
> > guidance on implementing a proper fix.
> >
> > What would be considered more appropriate:
> > (a) automatically skipping the subtitles for the time specified by -ss?
> > (b) adding a shift option to the subtitles filter that allows shifting
> > subtitles time by specific time?
> > (c) something else I can't think of?
>
> -ss executes a seek for that input. The subtitles filter does not have
> access to that data. You can add an option to the subtitles filter that
> also carries out a seek. And make sure to adjust timestamps depending on
> the seek match.
>
> Gyan
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
More information about the ffmpeg-devel
mailing list