[FFmpeg-user] Extracting first subtitle as an image

petesea at frontier.com petesea at frontier.com
Thu Mar 19 05:51:51 CET 2015

Is there an easy way to extract the first subtitle (dvdsub) for a specific 
stream as an image?  In such a way that I can see the subtitle in the 
resulting image.

The following works... (limited testing) but it's kind of slow and 
cumbersome and I'm hoping there's a better way:

   $ ffprobe -i movie.vob -select_streams 5 -show_frames -print_format flat | grep 'pts_time=' | head -n1
   (get the value of pts_time from output and use in -ss option)
   $ ffmpeg -i movie.vob -ss 209.883889 -codec:v mpeg2video -filter_complex '[0:v][0:5]overlay' -frames:v 1 -f mpeg - | ffmpeg -i - -frames:v 1 subtitle-05.png

I don't care if the subtitle is overlayed onto the video, all I want is to 
see the subtitle.  In fact I'd prefer it was NOT overlayed... or if it has 
to be overlayed, could it be overlayed onto some kind of blank background?

More information about the ffmpeg-user mailing list