[FFmpeg-trac] #8723(avcodec:new): scc captions overlap if more than one code to erase display per line
FFmpeg
trac at avcodec.org
Tue Jun 9 22:32:05 EEST 2020
#8723: scc captions overlap if more than one code to erase display per line
--------------------------------------+---------------------------------
Reporter: dericed | Owner:
Type: defect | Status: new
Priority: normal | Component: avcodec
Version: git-master | Keywords: scc
Blocked By: | Blocking:
Reproduced by developer: 0 | Analyzed by developer: 0
--------------------------------------+---------------------------------
Summary of the bug:
I am using
{{{ffmpeg -f lavfi -i color=s=720x480 -vf
subtitles=URBN02008_SEG01_UUAPRIL2020_SHOW_OPEN_TOSS.scc -t 30 -pix_fmt
yuv420p -y test.mp4}}}
to produce an output with hard-coded subtitles from an scc file (I'm
recreating this with a generated video source since the issue isn't
related to the source file used). Some lines htat include more than code
to erase the onscreen display and continue with more characters (at 20
seconds in with this example).
How to reproduce:
{{{
ffmpeg -f lavfi -i color=s=720x480 -vf
subtitles=URBN02008_SEG01_UUAPRIL2020_SHOW_OPEN_TOSS.scc -t 30 -pix_fmt
yuv420p -y test.mp4
ffmpeg version 4.2.3 Copyright (c) 2000-2020 the FFmpeg developers
built with Apple clang version 11.0.3 (clang-1103.0.32.59)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.3_1 --enable-shared
--enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-
cflags=-fno-stack-check --host-ldflags= --enable-ffplay --enable-gnutls
--enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d
--enable-libmp3lame --enable-libopus --enable-librubberband --enable-
libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora
--enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-
libfontconfig --enable-libfreetype --enable-frei0r --enable-libass
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
--enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox
--disable-libjack --disable-indev=jack
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Input #0, lavfi, from 'color=s=720x480':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 720x480
[SAR 1:1 DAR 3:2], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[Parsed_subtitles_0 @ 0x7fd5b8c04880] Shaper: FriBidi 0.19.7 (SIMPLE)
HarfBuzz-ng 2.6.6 (COMPLEX)
[Parsed_subtitles_0 @ 0x7fd5b8c04880] Using font provider coretext
[libx264 @ 0x7fd5ba014a00] using SAR=1/1
[libx264 @ 0x7fd5ba014a00] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7fd5ba014a00] profile High, level 3.0, 4:2:0, 8-bit
[libx264 @ 0x7fd5ba014a00] 264 - core 159 r2999 296494a - H.264/MPEG-4 AVC
codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options:
cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1
psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1
cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12
lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25
scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0
qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'test.mp4':
Metadata:
encoder : Lavf58.29.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p,
720x480 [SAR 1:1 DAR 3:2], q=-1--1, 25 fps, 12800 tbn, 25 tbc
Metadata:
encoder : Lavc58.54.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
[Parsed_subtitles_0 @ 0x7fd5b8c04880] fontselect: (Monospace, 400, 0) ->
/System/Library/Fonts/Courier.dfont, -1, Courier
frame= 750 fps=684 q=-1.0 Lsize= 74kB time=00:00:29.88 bitrate=
20.2kbits/s speed=27.3x
video:64kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 15.011199%
[libx264 @ 0x7fd5ba014a00] frame I:7 Avg QP: 9.91 size: 3949
[libx264 @ 0x7fd5ba014a00] frame P:187 Avg QP: 9.56 size: 122
[libx264 @ 0x7fd5ba014a00] frame B:556 Avg QP:12.67 size: 26
[libx264 @ 0x7fd5ba014a00] consecutive B-frames: 0.9% 0.3% 1.2% 97.6%
[libx264 @ 0x7fd5ba014a00] mb I I16..4: 75.7% 19.6% 4.7%
[libx264 @ 0x7fd5ba014a00] mb P I16..4: 0.0% 0.0% 0.1% P16..4: 0.1%
0.0% 0.0% 0.0% 0.0% skip:99.7%
[libx264 @ 0x7fd5ba014a00] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.3%
0.0% 0.0% direct: 0.0% skip:99.7% L0:53.4% L1:46.6% BI: 0.0%
[libx264 @ 0x7fd5ba014a00] 8x8 transform intra:19.7% inter:1.9%
[libx264 @ 0x7fd5ba014a00] coded y,uvDC,uvAC intra: 3.8% 0.0% 0.0% inter:
0.0% 0.0% 0.0%
[libx264 @ 0x7fd5ba014a00] i16 v,h,dc,p: 95% 1% 4% 0%
[libx264 @ 0x7fd5ba014a00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 70% 11% 19% 0%
0% 0% 0% 0% 0%
[libx264 @ 0x7fd5ba014a00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 14% 31% 3%
3% 6% 5% 4% 3%
[libx264 @ 0x7fd5ba014a00] i8c dc,h,v,p: 100% 0% 0% 0%
[libx264 @ 0x7fd5ba014a00] Weighted P-Frames: Y:1.6% UV:0.0%
[libx264 @ 0x7fd5ba014a00] ref P L0: 77.7% 6.1% 15.5% 0.7%
[libx264 @ 0x7fd5ba014a00] ref B L0: 55.3% 44.7%
[libx264 @ 0x7fd5ba014a00] ref B L1: 99.7% 0.3%
[libx264 @ 0x7fd5ba014a00] kb/s:17.32
}}}
At the 20 second mark of the output the text on the output frames shows
"BUT FIRST...E ON BLACK \nCORALS AND PRESERVING EELS."
If the process is done by first converting the scc to an srt like:
{{{
ffmpeg -i URBN02008_SEG01_UUAPRIL2020_SHOW_OPEN_TOSS.scc
URBN02008_SEG01_UUAPRIL2020_SHOW_OPEN_TOSS.srt
ffmpeg -f lavfi -i color=s=720x480 -vf
subtitles=URBN02008_SEG01_UUAPRIL2020_SHOW_OPEN_TOSS.srt -t 30 -pix_fmt
yuv420p -y test2.mp4
}}}
Then that resulting frame shows:
"RESEARCH DONE ON BLACK \nCORALS AND PRESERVING EELS. BUT FIRST..."
Which is a little better since the text is unobscured, but the
instructions of the scc suggest.
"RESEARCH DONE ON BLACK \nCORALS AND PRESERVING EELS."
<clear on-screen text>
"BUT FIRST..."
--
Ticket URL: <https://trac.ffmpeg.org/ticket/8723>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list