Opened 8 years ago

Last modified 4 years ago

#5291 open defect

Wrong parsing when start time > end time in subtitles (.ass)

Reported by: Mif Linak Owned by:
Priority: important Component: undetermined
Version: git-master Keywords: ass regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no


Summary of the bug: .ass subtitles parsed wrong when dialog start time is larger than dialog end time.

How to reproduce:

Test file (test.ass):

[Script Info]
Title: Default Aegisub file
ScriptType: v4.00+
PlayResX: 1280
PlayResY: 720
PlayDepth: 16
Timer: 100,0000
WrapStyle: 1
YCbCr Matrix: TV.709

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,Arial,45,&H00FFFFFF,&H00005BFF,&H00010101,&HBE1F0C05,-1,0,0,0,90,100,0,0,1,2,0,2,10,10,15,1

Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 1,0:02:11.52,0:02:11.49,Default,,0,0,0,fx,test

And then:

ffmpeg -i test.ass -f webvtt -nostats -loglevel 0 -

02:11.520 --> 1193:04:58.786

As you see dialog with duration 0 ms converts to dialog with duration 1193 hours.

With loglevel 999 (but I think it's useless):

ffmpeg -i test.ass -f webvtt -loglevel 999 -
ffmpeg version N-76944-g15206ff Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
  configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libdcadec --enable-libfreetype --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvo-aacenc --enable-libvidstab
  libavutil      55.  9.100 / 55.  9.100
  libavcodec     57. 16.101 / 57. 16.101
  libavformat    57. 19.100 / 57. 19.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 17.100 /  6. 17.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Splitting the commandline.
Reading option '-i' ... matched as input file with argument 'test.ass'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'webvtt'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '999'.
Reading option '-' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument 999.
Successfully parsed a group of options.
Parsing a group of options: input file test.ass.
Successfully parsed a group of options.
Opening an input file: test.ass.
Probing ass score:100 size:660
Probing lrc score:5 size:660
[ass @ 0x2ee93c0] Format ass probed with size=2048 and score=100
[ass @ 0x2ee93c0] Before avformat_find_stream_info() pos: 660 bytes read:660 seeks:0
[ass @ 0x2ee93c0] All info found
[ass @ 0x2ee93c0] 0: start_time: -9223372036854.775 duration: -9223372036854.775
[ass @ 0x2ee93c0] stream: start_time: -9223372036854.775 duration: -9223372036854.775 bitrate=0 kb/s
[ass @ 0x2ee93c0] After avformat_find_stream_info() pos: 660 bytes read:660 seeks:0 frames:0
Input #0, ass, from 'test.ass':
  Duration: N/A, bitrate: N/A
    Stream #0:0, 0, 1/100: Subtitle: ass
Successfully opened the file.
Parsing a group of options: output file -.
Applying option f (force format) with argument webvtt.
Successfully parsed a group of options.
Opening an output file: -.
Successfully opened the file.
Output #0, webvtt, to 'pipe:':
    encoder         : Lavf57.19.100
    Stream #0:0, 0, 1/1000: Subtitle: webvtt
      encoder         : Lavc57.16.101 webvtt
Stream mapping:
  Stream #0:0 -> #0:0 (ass (native) -> webvtt (native))
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)

02:11.520 --> 1193:04:58.786
No more output streams to write to, finishing.
size=       0kB time=00:02:11.52 bitrate=   0.0kbits/s
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 345.454559%
Input file #0 (test.ass):
  Input stream #0:0 (subtitle): 1 packets read (26 bytes); 1 frames decoded;
  Total: 1 packets (26 bytes) demuxed
Output file #0 (pipe:):
  Output stream #0:0 (subtitle): 1 frames encoded; 1 packets muxed (11 bytes);
  Total: 1 packets (11 bytes) muxed
1 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x2eead20] Statistics: 0 seeks, 2 writeouts
[AVIOContext @ 0x2ef1f40] Statistics: 660 bytes read, 0 seeks

Change History (2)

comment:1 by Carl Eugen Hoyos, 8 years ago

Keywords: ass regression added
Priority: normalimportant
Reproduced by developer: set
Status: newopen
Version: unspecifiedgit-master

Regression since b01891a9.

comment:2 by Balling, 4 years ago

Is it even allowed?

Note: See TracTickets for help on using tickets.