#10659(undetermined:new): Converting to ass subtitles results in overlap.
#10659: Converting to ass subtitles results in overlap. -------------------------------------+------------------------------------- Reporter: typological | Type: defect Status: new | Priority: normal Component: | Version: undetermined | unspecified Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Summary of the bug: When converting to ass subtitles from srt or vtt, there are some overlaps that weren't there, probably due to wrong rounding. How to reproduce: {{{ % ffmpeg -i sub.srt sub.ass ffmpeg version n6.0 Copyright (c) 2000-2023 the FFmpeg developers built with gcc 13.2.1 (GCC) 20230801 }}} sub.srt (input): {{{ 1 00:00:29,566 --> 00:00:34,332 test 1 2 00:00:34,333 --> 00:00:38,833 test 2 3 00:00:38,833 --> 00:00:39,833 test 3 }}} sub.ass (actual output): {{{ ... [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:29.57,0:00:34.34,Default,,0,0,0,,test 1 Dialogue: 0,0:00:34.33,0:00:38.83,Default,,0,0,0,,test 2 Dialogue: 0,0:00:38.83,0:00:39.83,Default,,0,0,0,,test 3 }}} sub.ass (expected output): {{{ ... [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:29.57,0:00:34.33,Default,,0,0,0,,test 1 Dialogue: 0,0:00:34.33,0:00:38.83,Default,,0,0,0,,test 2 Dialogue: 0,0:00:38.83,0:00:39.83,Default,,0,0,0,,test 3 }}} (note the 34, that should've been 33, at the first Dialogue line) the same happens if I use sub.vtt as input with the command {{{ ffmpeg -i sub.vtt sub.ass }}} with sub.vtt (input) {{{ WEBVTT Kind: captions Language: en 00:00:29.566 --> 00:00:34.332 test 1 00:00:34.333 --> 00:00:38.833 test 2 00:00:38.833 --> 00:00:39.833 test 3 }}} -- Ticket URL: <https://trac.ffmpeg.org/ticket/10659> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#10659: Converting to ass subtitles results in overlap. -------------------------------------+------------------------------------- Reporter: typological | Owner: (none) Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Changes (by typological): * Attachment "patch.diff" added. -- Ticket URL: <https://trac.ffmpeg.org/ticket/10659> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#10659: Converting to ass subtitles results in overlap. -------------------------------------+------------------------------------- Reporter: typological | Owner: (none) Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by typological): I'm new to ffmpeg's codebase, I know the following patch is horrible, but it's a start. Problem seems to be the following: ASS uses only 10ms precision. AVPackets store start time and duration and not end time; in this case, the first packet had a duration of 4766ms which gets rounded to 4770ms when converting to the ASS timebase. The start time also gets rounded upwards and this adds a + 1 to the end time that would not have happened had the end time been rounded to 10ms itself. the patch makes ass subtitles a special case, and uses a rescale_ts function that rounds duration + start, then subtracts the start. not sure what are the possible issues that could appear from this change. -- Ticket URL: <https://trac.ffmpeg.org/ticket/10659#comment:1> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#10659: Converting to ass subtitles results in overlap. -------------------------------------+------------------------------------- Reporter: typological | Owner: (none) Type: defect | Status: open Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Changes (by Balling): * status: new => open Comment: 00:00:34,332 is smaller than 00:00:34,333. That means that 0:00:34.34 should be smaller than 0,0:00:34.33, but it is not. It should probably be 0:00:34.32 though, smaller. -- Ticket URL: <https://trac.ffmpeg.org/ticket/10659#comment:2> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#10659: Converting to ass subtitles results in overlap. -------------------------------------+------------------------------------- Reporter: typological | Owner: (none) Type: defect | Status: open Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by Balling): So when will you send a patch? -- Ticket URL: <https://trac.ffmpeg.org/ticket/10659#comment:3> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#10659: Converting to ass subtitles results in overlap. -------------------------------------+------------------------------------- Reporter: typological | Owner: (none) Type: defect | Status: open Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by typological): Sorry, got busy with others things. Sent. -- Ticket URL: <https://trac.ffmpeg.org/ticket/10659#comment:4> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#10659: Converting to ass subtitles results in overlap. -------------------------------------+------------------------------------- Reporter: typological | Owner: (none) Type: defect | Status: open Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Changes (by lilydjwg): * cc: lilydjwg (added) -- Ticket URL: <https://trac.ffmpeg.org/ticket/10659#comment:5> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#10659: Converting to ass subtitles results in overlap. -------------------------------------+------------------------------------- Reporter: typological | Owner: (none) Type: defect | Status: open Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by typological): can anyone take a look at the patch? https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2023-November/317250.html -- Ticket URL: <https://trac.ffmpeg.org/ticket/10659#comment:6> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg