mpv
mpv copied to clipboard
Error with SRT subtitles with multiple line breaks
mpv Information
mpv v0.38.0-372-g481e4984 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
built on May 31 2024 12:18:20
libplacebo version: v7.349.0 (v6.338.0-140-g50ddb03-dirty)
FFmpeg version: N-115464-g249c66bb2
FFmpeg library versions:
libavutil 59.20.100
libavcodec 61.5.104
libavformat 61.3.104
libswscale 8.2.100
libavfilter 10.2.102
libswresample 5.2.100
Important Information
- Platform version: Windows 10 22H2
- GPU model, driver and version: NVIDIA GeForce GTX 1650, driver version 555.85
- Source: https://github.com/zhongfly/mpv-winbuild/releases
- Introduced in version: Unknown. This is an extremely niche case so I'm not sure if this is a regression.
Reproduction Steps
I am having an issue with SRT subtitles that contain lines with more than one line break in the subtitle track. When there are at least two line breaks between dialogue lines, only the first line is displayed.
For instance, this is a line from the SRT subtitle track from the sample video provided below:
3
00:00:06,131 --> 00:00:09,217
SQUAD 1 BARRACKS - FRONT GATE
That man is very cunning.
There are ten breaks between the two lines; however, when played with mpv using mpv --no-config only the first line appears:
This is with MPC-HC (using the internal subtitle renderer with all libass options checked):
This is with VLC:
There is also a difference in behavior depending on whether or not the SRT track is an internal track or an external track. If the SRT track is extracted and loaded as an external track, then both lines are displayed, but with only a single line break.
Internal track:
The same subtitle track but loaded as an external subtitle track:
Expected Behavior
Both dialogue lines with the correct number of line breaks should be displayed.
Actual Behavior
With internal SRT subtitles, only the first line is displayed, and with external SRT subtitles, both lines are displayed, but with only one line break regardless of the number of breaks in the subtitle track.
Log File
Sample Files
I carefully read all instruction and confirm that I did the following:
- [X] I tested with the latest mpv version to validate that the issue is not already fixed.
- [X] I provided all required information including system and mpv version.
- [X] I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of
--log-file=output.txt. - [X] I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
- [X] I attached the full, untruncated log file.
- [X] I attached the backtrace in the case of a crash.
ffplay seems to reproduce the same behavior. I think the converter likely strips newlines or something.
The sample is malformed. SRT subtitle format doesn't support multiple line breaks. A blank line always indicates a new part of the subtitle. Both the linked spec and the SubRip program work like this.