[FFmpeg-devel] subtitle filter

Calvin Walton calvin.walton at kepstin.ca
Mon Apr 14 21:03:34 CEST 2014


On Sun, 2014-04-13 at 00:39 +0400, Iliya Bunov wrote:
> It is impossible to make a screenshot with hardsubs.
> ffmpeg -ss 00:10:57 -t 1 -i m.mkv -vf "ass=m.ass" -f mjpeg image01.png
> Subtitles always start from the beginning (00:00 not 00:10:57).
> 
> Adding "ss" option can solve this problem.
> ffmpeg -ss 00:10:57 -t 1 -i m.mkv -vf "ass=m.ass:ss='10\:57'" -f mjpeg
> image01.png

Setting the timestamp offset on the video input should do the trick here
with none of the other side-effects of using -copyts; something like:

ffmpeg -ss 00:10:57 -itsoffset 00:10:57 -t 1 -i m.mkv -vf  ass=m.ass -f mjpeg image01.png

(If you're encoding to a new video stream rather than a single snapshot
and want the output timestamps to start at 0, you would have to add a
setpts filter after the ass filter)

-- 
Calvin Walton <calvin.walton at kepstin.ca>



More information about the ffmpeg-devel mailing list