Log in

View Full Version : .srt subtitles to dvb_subtitles on the command line?


subtitler
15th December 2020, 15:59
I'm trying to get from a .srt subtitle file + a .ts video file => a .ts video file with a dvb_subtitle.

My .srt (just an example):
```
1
00:00:00,000 --> 00:00:05,000
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi vel hendrerit massa.

2
00:00:05,000 --> 00:00:10,000
Aliquam dolor sapien, molestie ac sagittis eu, tempus nec est.

3
00:00:10,000 --> 00:00:28,000
Morbi id sem eu sapien consectetur imperdiet. Morbi sed purus et sapien interdum placerat vitae quis orci.
```

My .ts: sample_1920x1080.ts from https://filesamples.com/formats/ts

I know that Subtitle Edit has some capabilities here. I can use SubtitleEdit like this on the command line:
```
.\SubtitleEdit.exe /convert 'test_subtitles.srt' Blu-raysup /resolution:1920x1080 /overwrite
```

This creates a test_subtitles.sup file as expected.

I then use ffmpeg to include the .sup subtitles, like this:

```
.\ffmpeg.exe -y -i 'sample_1920x1080.ts' -fix_sub_duration -i 'test_subtitles.sup' -map 0:v -map 1:s -vcodec copy -acodec copy -scodec dvbsub -copyts -muxdelay 0 -max_delay 0 'output.ts'
```

This works, but the results are sometimes not very readable. Here's a screenshot:

https://i.stack.imgur.com/yGljC.jpg

Do I have any other options here? Or options within subtitleedit/ffmpeg to f.ex. make the subtitles be bigger? Something that I can do from the command line as I need to do this for many movies.

I learned from the author of SubtitleEdit that it's indeed possible to increase the font size if using the graphical user interface of SubtitleEdit (see here: https://github.com/SubtitleEdit/subtitleedit/issues/4539#issuecomment-734986814). However, I wish to do this using a command line tool.

Nikse555
15th December 2020, 16:38
What happens if you use a lower resolution for the sup file (e.g resolution:720x480)?
Perhaps the video player upscales the subtitles?