Opened 14 months ago

Last modified 6 months ago

#9001 new defect

concat demuxed ASS subtitles don't work

Reported by: Gregory Beauregard Owned by:
Priority: normal Component: ffmpeg
Version: git-master Keywords: ass libass subtitles concat
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by Gregory Beauregard)

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. When concat demuxing two MKV files that each contain an ASS/SSA, the rendering will fail to render lines where it sees frame number dupes (i.e. in the second file that dupe from the first file). The G-li-co part rendered in the second file in the example has high frame numbers not encountered in the first file.

Attachments (5)

ffmpeg-20201123-000107.log (1.2 MB ) - added by Gregory Beauregard 14 months ago.
-report for the failing subtitles=subs.mkv case
assconcatsamp1.mkv (525.2 KB ) - added by Gregory Beauregard 6 months ago.
assconcatsamp2.mkv (479.5 KB ) - added by Gregory Beauregard 6 months ago.
ffmpeg-20210804-124257.log (1.2 MB ) - added by Gregory Beauregard 6 months ago.
log for failed-to-render ffconcat case as of 08/04
concatplaylist.txt (69 bytes ) - added by Gregory Beauregard 6 months ago.

Change History (16)

comment:1 by Gregory Beauregard, 14 months ago

libass version used is 0.15.0

comment:2 by Gregory Beauregard, 14 months ago

Compilation information.

❯ ffmpeg
ffmpeg version N-99979-gb0a8b40294 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.0 (Gentoo 9.3.0-r1 p3)
  configuration: --enable-nonfree --extra-cflags=-I/opt/cuda/targets/x86_64-linux/include --extra-ldflags=-L/opt/cuda/targets/x86_64-linux/lib --optflags='-march=native -O2 -pipe -Wa,-mbranches-within-32B-boundaries' --enable-libnpp --enable-vulkan --enable-cuda-llvm --enable-avfilter --disable-indev=oss --disable-indev=jack --disable-outdev=oss --enable-version3 --enable-bzlib --disable-runtime-cpudetect --disable-debug --disable-gcrypt --enable-gnutls --enable-gpl --enable-iconv --disable-libtls --enable-libxml2 --enable-lzma --enable-network --enable-opencl --enable-openssl --enable-postproc --disable-libsmbclient --enable-ffplay --enable-sdl2 --enable-vaapi --enable-vdpau --enable-xlib --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-zlib --disable-libcdio --disable-libiec61883 --disable-libdc1394 --disable-libcaca --disable-openal --enable-opengl --enable-libv4l2 --enable-libpulse --enable-libdrm --disable-libjack --enable-libopencore-amrwb --enable-libopencore-amrnb --disable-libcodec2 --enable-libdav1d --enable-libfdk-aac --enable-libopenjpeg --enable-libbluray --disable-libgme --disable-libgsm --enable-libaribb24 --disable-mmal --disable-libmodplug --enable-libopus --disable-libilbc --disable-librtmp --enable-libssh --enable-libspeex --enable-libsrt --enable-librsvg --enable-ffnvcodec --enable-libvorbis --enable-libvpx --enable-libzvbi --disable-appkit --disable-libbs2b --disable-chromaprint --disable-libflite --disable-frei0r --enable-libfribidi --enable-fontconfig --enable-ladspa --enable-libass --disable-libtesseract --enable-lv2 --enable-libfreetype --enable-libvidstab --enable-librubberband --enable-libzmq --enable-libzimg --enable-libsoxr --enable-pthreads --disable-libvo-amrwbenc --enable-libmp3lame --disable-libkvazaar --enable-libaom --disable-libopenh264 --disable-librav1e --disable-libsnappy --enable-libtheora --disable-libtwolame --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --disable-gnutls --disable-frei0r --disable-librav1e --disable-libzmq --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-neon --disable-vfp --disable-vfpv3 --disable-armv8 --disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu --disable-altivec --disable-vsx --disable-power8 --disable-amd3dnow --disable-amd3dnowext --disable-fma4 --disable-xop --cpu=host --disable-doc --disable-htmlpages --disable-manpages
  libavutil      56. 60.100 / 56. 60.100
  libavcodec     58.112.103 / 58.112.103
  libavformat    58. 64.100 / 58. 64.100
  libavdevice    58. 11.103 / 58. 11.103
  libavfilter     7. 90.100 /  7. 90.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

by Gregory Beauregard, 14 months ago

Attachment: ffmpeg-20201123-000107.log added

-report for the failing subtitles=subs.mkv case

comment:3 by Gregory Beauregard, 14 months ago

Keywords: ass libass subtitles added

comment:4 by Gregory Beauregard, 14 months ago

Component: undeterminedavfilter

comment:5 by Gregory Beauregard, 14 months ago

Component: avfilterffmpeg

comment:6 by Gregory Beauregard, 10 months ago

Keywords: concat added

comment:7 by Gregory Beauregard, 9 months ago

Description: modified (diff)

comment:8 by Gregory Beauregard, 7 months ago

~

Last edited 6 months ago by Gregory Beauregard (previous) (diff)

by Gregory Beauregard, 6 months ago

Attachment: assconcatsamp1.mkv added

by Gregory Beauregard, 6 months ago

Attachment: assconcatsamp2.mkv added

by Gregory Beauregard, 6 months ago

Attachment: ffmpeg-20210804-124257.log added

log for failed-to-render ffconcat case as of 08/04

by Gregory Beauregard, 6 months ago

Attachment: concatplaylist.txt added

comment:9 by Gregory Beauregard, 6 months ago

Description: modified (diff)
Summary: concat demuxed ASS subtitles stop working with subtitles filterconcat demuxed ASS subtitles don't work

comment:10 by Gregory Beauregard, 6 months ago

Description: modified (diff)

comment:11 by Gregory Beauregard, 6 months ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.