Changes between Version 7 and Version 9 of Ticket #9001


Ignore:
Timestamp:
Aug 4, 2021, 7:55:50 PM (5 years ago)
Author:
Gregory Beauregard
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #9001

    • Property Summary concat demuxed ASS subtitles stop working with subtitles filter → concat demuxed ASS subtitles don't work
  • Ticket #9001 – Description

    v7 v9  
    1 Summary of the bug: The subtitles filter fails to reliably display concat demuxed ASS subtitles
     1ffmpeg version used: master as of 2021-08-04
     2
     3Summary of the bug: The subtitles filter fails to display concat demuxed ASS/SSA subtitles due to choking on the frame number.
     4
    25How to reproduce:
    3 Download test files (3.6 MB): [https://gably.net/testcase/test1.mkv] [https://gably.net/testcase/test2.mkv]
    4 Each test file has 20 seconds of video with ASS subtitles. Note in particular the last section of subtitles in the second clip. Concat demux the subtitles and videos as follows. Once by converting first to text, and once by leaving as ASS subtitles.
     6Attached are two sample videos `assconcatsamp1.mkv` and `assconcatsamp2.mkv`. We concat demux these files while rendering out the subtitles:
     7
     8Create a new file `concatplaylist.txt` in the same directory as the samples that contains the following (or download attached):
    59{{{
    6 #!/bin/bash
    7 rm -f playlist.txt
    8 echo "file '$(readlink -f "test1.mkv")'" >> playlist.txt
    9 echo "file '$(readlink -f "test2.mkv")'" >> playlist.txt
    10 ffmpeg -f concat -safe 0 -i playlist.txt -ss 00:00:00 -c:s copy -map 0:s:0 -map 0:t? -y subs.mkv
    11 ffmpeg -f concat -safe 0 -i playlist.txt -ss 00:00:00 -c:s text -map 0:s:0 -y textsubs.mkv
    12 ffmpeg -f concat -safe 0 -ss 00:00:00 -i playlist.txt -vf subtitles=subs.mkv -c:v libx264 -b:v 1M -c:a libopus -b:a 96k -map 0:v -map 0:a -y concat.mkv
    13 ffmpeg -f concat -safe 0 -ss 00:00:00 -i playlist.txt -vf subtitles=textsubs.mkv -c:v libx264 -b:v 1M -c:a libopus -b:a 96k -map 0:v -map 0:a -y textconcat.mkv
     10ffconcat version 1.0
     11file assconcatsamp1.mkv
     12file assconcatsamp2.mkv
    1413}}}
    15 Observe that `concat.mkv` is missing some of the ASS subtitles at the end of the second clip that `textconcat.mkv` is not missing. The subs are present in `test2.mkv`. This bug was originally observed when concatenating entire files as the ASS subtitles suddenly failing to render entirely. Various insertions of `-fix_sub_duration` don't change the situation. Note not including the `-ss` arguments produce other odd timing problems, but this may need to be filed as a separate bug.
    1614
    17 ffmpeg version: master
    18 built on 2020-11-22 5 pm UTC
     15Now, we try to render out subtitles:
     16{{{
     17ffmpeg -report -f concat -safe 0 -i concatplaylist.txt -vf subtitles=concatplaylist.txt -c:v libx264 -b:v 1M -c:a libopus -b:a 96k -map 0:v -map 0:a -y assconcat.mkv
     18}}}
    1919
    20 In files I haven't clipped like this the concat demuxed subtitles stopped working exactly on the file boundaries.
     20A log from running this is attached as `ffmpeg-20210804-124257.log`
     21
     22The output `assconcat.mkv` can be inspected to see all the subtitles in second clip weren't rendered except a part that says G-li-co.
     23
     24When stored in MKV (ONLY when stored in MKV), ASS/SSA subtitle lines have an associated frame number that indicates their position within the original file. It's failing at lines with dupe frame numbers.