[FFmpeg-user] Which file formats can hold image subtitles (dvdsub) without other streams

Mark Filipak markfilipak.imdb at gmail.com
Mon Dec 4 21:21:20 EET 2023

On 12/4/23 13:18, bbb wrote:
> Thanks Mark,
> as Nicolas already pointed out, I was wrong about the mkv format. I see you are using it for just a 
> subtitle stream too in the first step.
> Though my problem is already solved with that, what you wrote looks very interesting. You are able 
> to convert image subtitles to text?

Indeed. It has removed my dependency on opensubtitles.org -- really messed up, low quality, soon to 
put up a paywall -- for HDMV PGS subtitles.

> I really should check out SubtitleEdit and that MKV toolkit too.

SubtitleEdit can grab subtitles directly from M2TS files but it makes mistakes whereas I've found 
that taking the time to make a sub-only MKS, and then have mkvextract make IDX & SUB files to submit 
to SubtitleEdit is reliable.

> On 12/4/23 18:11, Mark Filipak wrote:
>> Hi, Below is a Windows CMD I use. It employs ffmpeg, mkvextract, and SubtitleEdit.
>> The MKV made has only the subtitles -- no video required.
>> If SubtitleEdit has been properly trained, the results are excellent.
>> -- Mark.
>> : Convert hdmv_pgs_subtitle to subrip.
>> :   index file: %TARGETPATH%\%NAME%.idx  //contains the subtitle-timestamps
>> :   bitmap file: %TARGETPATH%\%NAME%.sub //contains the subtitle-bitmaps
>> : This assumes the zeroth subtitle stream (0:s:0) is desired.
>> : '%TARGETPATH%\%SOURCE%.mkv', '%TARGETPATH%\%NAME%.idx', and '%TARGETPATH%\%NAME%.sub'
>> : are preserved.
>> set NAME=
>> set M2TS=
>> ffmpeg -i "%M2TS%" -map 0:s:0 -s 1920x1080 -c:s dvdsub -f matroska "%TARGETPATH%\%NAME%.mkv"
>> "C:\Program Files\MKVToolNix\mkvextract" "%TARGETPATH%\%NAME%.mkv" tracks 0:"%TARGETPATH%\%NAME%"
>> "C:\Program Files\Subtitle Edit\SubtitleEdit" "%TARGETPATH%\%NAME%.idx"
>> pause

More information about the ffmpeg-user mailing list