Changes between Version 7 and Version 9 of Ticket #9001
- Timestamp:
- Aug 4, 2021, 7:55:50 PM (5 years ago)
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 1 ffmpeg version used: master as of 2021-08-04 2 3 Summary of the bug: The subtitles filter fails to display concat demuxed ASS/SSA subtitles due to choking on the frame number. 4 2 5 How 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. 6 Attached are two sample videos `assconcatsamp1.mkv` and `assconcatsamp2.mkv`. We concat demux these files while rendering out the subtitles: 7 8 Create a new file `concatplaylist.txt` in the same directory as the samples that contains the following (or download attached): 5 9 {{{ 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 10 ffconcat version 1.0 11 file assconcatsamp1.mkv 12 file assconcatsamp2.mkv 14 13 }}} 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.16 14 17 ffmpeg version: master 18 built on 2020-11-22 5 pm UTC 15 Now, we try to render out subtitles: 16 {{{ 17 ffmpeg -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 }}} 19 19 20 In files I haven't clipped like this the concat demuxed subtitles stopped working exactly on the file boundaries. 20 A log from running this is attached as `ffmpeg-20210804-124257.log` 21 22 The 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 24 When 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.


