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

Mark Filipak markfilipak.imdb at gmail.com
Mon Dec 4 19:11:44 EET 2023

On 12/4/23 07:29, bbb wrote:
> Hi,
> I need a file format for a temporary file to store image subtitles (dvdsub) in. So far I've been 
> using .mpg which generally works, but seems to be unable to keep the metadata. When I try to use mkv 
> it insists on having a video stream (... figures). Is there a file format in which I can temporarily 
> store subtitles alone and keep their metadata?
> Regards

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.
: 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"

More information about the ffmpeg-user mailing list