[FFmpeg-trac] #9001(ffmpeg:new): concat demuxed ASS subtitles don't work (was: concat demuxed ASS subtitles stop working with subtitles filter)
FFmpeg
trac at avcodec.org
Wed Aug 4 22:55:50 EEST 2021
#9001: concat demuxed ASS subtitles don't work
-------------------------------------+-------------------------------------
Reporter: Gregory | Owner: (none)
Beauregard |
Type: defect | Status: new
Priority: normal | Component: ffmpeg
Version: git-master | Resolution:
Keywords: ass libass | Blocked By:
subtitles concat |
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Changes (by Gregory Beauregard):
* summary: concat demuxed ASS subtitles stop working with subtitles filter
=> concat demuxed ASS subtitles don't work
Old description:
> Summary of the bug: The subtitles filter fails to reliably display concat
> demuxed ASS subtitles
> How to reproduce:
> Download test files (3.6 MB): [https://gably.net/testcase/test1.mkv]
> [https://gably.net/testcase/test2.mkv]
> 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.
> {{{
> #!/bin/bash
> rm -f playlist.txt
> echo "file '$(readlink -f "test1.mkv")'" >> playlist.txt
> echo "file '$(readlink -f "test2.mkv")'" >> playlist.txt
> 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
> ffmpeg -f concat -safe 0 -i playlist.txt -ss 00:00:00 -c:s text -map
> 0:s:0 -y textsubs.mkv
> 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
> 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
> }}}
> 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.
>
> ffmpeg version: master
> built on 2020-11-22 5 pm UTC
>
> In files I haven't clipped like this the concat demuxed subtitles stopped
> working exactly on the file boundaries.
New description:
ffmpeg version used: master as of 2021-08-04
Summary of the bug: The subtitles filter fails to display concat demuxed
ASS/SSA subtitles due to choking on the frame number.
How to reproduce:
Attached are two sample videos `assconcatsamp1.mkv` and
`assconcatsamp2.mkv`. We concat demux these files while rendering out the
subtitles:
Create a new file `concatplaylist.txt` in the same directory as the
samples that contains the following (or download attached):
{{{
ffconcat version 1.0
file assconcatsamp1.mkv
file assconcatsamp2.mkv
}}}
Now, we try to render out subtitles:
{{{
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
}}}
A log from running this is attached as `ffmpeg-20210804-124257.log`
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.
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.
--
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9001#comment:9>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list