[FFmpeg-trac] #7117(undetermined:new): DVB subtitles render incorrectly
FFmpeg
trac at avcodec.org
Sun Apr 1 20:22:50 EEST 2018
#7117: DVB subtitles render incorrectly
-------------------------------------+-------------------------------------
Reporter: leoenc | Type: defect
Status: new | Priority: normal
Component: | Version:
undetermined | unspecified
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Summary of the bug:
Conversion of sup subtitles (pgssub) to DVB subtitles and muxing to mpeg-
ts results in bad looking subtitles.
When using the overlay filter instead, they render correctly.
I am using the latest nightly build 20180331-be502ec and testing with VLC
Player 3.0.1 (Windows). I also tried playing the dvb output with ffplay
but subtitles aren't showing but instead the screen is just flashing from
black to video.
I tried with or without canvas_size 1920x1080 and/or s:s 1920x1080, makes
no difference.
How to reproduce:
I've attached the input video and subtitles needed to reproduce + both
outputs I got on my end.
Output with DVB subtitles which looks wrong:
{{{
ffmpeg -y -i input.mp4 -fix_sub_duration -i subtitles.sup -vcodec libx264
-crf 24 -f mpegts -scodec dvbsub output_dvb.ts
ffmpeg version N-90553-gbe502ec6cd Copyright (c) 2000-2018 the FFmpeg
developers
built with gcc 7.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-
bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass
--enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-
libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
--enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr
--enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack
--enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2
--enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-
libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa
--enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx
--enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-
nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
libavutil 56. 12.100 / 56. 12.100
libavcodec 58. 16.100 / 58. 16.100
libavformat 58. 10.100 / 58. 10.100
libavdevice 58. 2.100 / 58. 2.100
libavfilter 7. 13.100 / 7. 13.100
libswscale 5. 0.102 / 5. 0.102
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isomavc1
creation_time : 2018-04-01T16:37:29.000000Z
Duration: 00:00:30.12, start: 0.000000, bitrate: 20 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
1920x1080 [SAR 1:1 DAR 16:9], 18 kb/s, 25 fps, 25 tbr, 100 tbn, 50 tbc
(default)
Metadata:
creation_time : 2018-04-01T16:37:29.000000Z
handler_name : 264 at GPAC0.7.0-rev0-gbd5c9af-master
Input #1, sup, from 'subtitles.sup':
Duration: N/A, start: 3.440000, bitrate: N/A
Stream #1:0: Subtitle: hdmv_pgs_subtitle, 1920x1080
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #1:0 -> #0:1 (hdmv_pgs_subtitle (pgssub) -> dvb_subtitle
(dvbsub))
Press [q] to stop, [?] for help
[sup @ 00000271594a0140] Invalid timestamps stream=0, pts=0, dts=303570,
size=4974
[libx264 @ 00000271594833c0] using SAR=1/1
[libx264 @ 00000271594833c0] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 00000271594833c0] profile High, level 4.0
Output #0, mpegts, to 'output_dvb.ts':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isomavc1
encoder : Lavf58.10.100
Stream #0:0(und): Video: h264 (libx264), yuv420p, 1920x1080 [SAR 1:1
DAR 16:9], q=-1--1, 25 fps, 90k tbn, 25 tbc (default)
Metadata:
creation_time : 2018-04-01T16:37:29.000000Z
handler_name : 264 at GPAC0.7.0-rev0-gbd5c9af-master
encoder : Lavc58.16.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream #0:1: Subtitle: dvb_subtitle (dvbsub), 1920x1080
Metadata:
encoder : Lavc58.16.100 dvbsub
[sup @ 00000271594a0140] Invalid timestamps stream=0, pts=0, dts=767997,
size=6238
[sup @ 00000271594a0140] Invalid timestamps stream=0, pts=0, dts=1135096,
size=9926
frame= 150 fps=0.0 q=29.0 size= 27kB time=00:00:06.68 bitrate=
33.1kbits/s sp[sup @ 00000271594a0140] Invalid timestamps stream=0, pts=0,
dts=1635183, size=17502
frame= 310 fps=309 q=29.0 size= 80kB time=00:00:11.80 bitrate=
55.6kbits/s sp[sup @ 00000271594a0140] Invalid timestamps stream=0, pts=0,
dts=2218393, size=18698
frame= 478 fps=317 q=29.0 size= 133kB time=00:00:18.60 bitrate=
58.7kbits/s spframe= 639 fps=318 q=29.0 size= 187kB time=00:00:24.20
bitrate= 63.1kbits/s spframe= 753 fps=310 q=-1.0 Lsize= 221kB
time=00:00:30.00 bitrate= 60.3kbits/s speed=12.3x
video:54kB audio:0kB subtitle:65kB other streams:0kB global headers:0kB
muxing overhead: 85.350807%
[libx264 @ 00000271594833c0] frame I:4 Avg QP: 8.50 size: 642
[libx264 @ 00000271594833c0] frame P:190 Avg QP:10.10 size: 77
[libx264 @ 00000271594833c0] frame B:559 Avg QP:13.67 size: 69
[libx264 @ 00000271594833c0] consecutive B-frames: 0.9% 0.3% 0.0% 98.8%
[libx264 @ 00000271594833c0] mb I I16..4: 100.0% 0.0% 0.0%
[libx264 @ 00000271594833c0] mb P I16..4: 0.0% 0.0% 0.0% P16..4:
0.0% 0.0% 0.0% 0.0% 0.0% skip:100.0%
[libx264 @ 00000271594833c0] mb B I16..4: 0.0% 0.0% 0.0% B16..8:
0.0% 0.0% 0.0% direct: 0.0% skip:100.0%
[libx264 @ 00000271594833c0] 8x8 transform intra:0.0%
[libx264 @ 00000271594833c0] coded y,uvDC,uvAC intra: 0.0% 0.0% 0.0%
inter: 0.0% 0.0% 0.0%
[libx264 @ 00000271594833c0] i16 v,h,dc,p: 99% 0% 1% 0%
[libx264 @ 00000271594833c0] i8c dc,h,v,p: 100% 0% 0% 0%
[libx264 @ 00000271594833c0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 00000271594833c0] kb/s:14.75
}}}
Output with overlay subtitles which looks correct:
{{{
ffmpeg -y -i input.mp4 -i subtitles.sup -filter_complex
"[1:s]scale=width=1920:height=1080[sub];[0:v][sub]overlay" -vcodec libx264
-crf 24 -f mpegts output_overlay.ts
ffmpeg version N-90553-gbe502ec6cd Copyright (c) 2000-2018 the FFmpeg
developers
built with gcc 7.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-
bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass
--enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-
libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
--enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr
--enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack
--enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2
--enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-
libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa
--enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx
--enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-
nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
libavutil 56. 12.100 / 56. 12.100
libavcodec 58. 16.100 / 58. 16.100
libavformat 58. 10.100 / 58. 10.100
libavdevice 58. 2.100 / 58. 2.100
libavfilter 7. 13.100 / 7. 13.100
libswscale 5. 0.102 / 5. 0.102
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isomavc1
creation_time : 2018-04-01T16:37:29.000000Z
Duration: 00:00:30.12, start: 0.000000, bitrate: 20 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
1920x1080 [SAR 1:1 DAR 16:9], 18 kb/s, 25 fps, 25 tbr, 100 tbn, 50 tbc
(default)
Metadata:
creation_time : 2018-04-01T16:37:29.000000Z
handler_name : 264 at GPAC0.7.0-rev0-gbd5c9af-master
Input #1, sup, from 'subtitles.sup':
Duration: N/A, start: 3.440000, bitrate: N/A
Stream #1:0: Subtitle: hdmv_pgs_subtitle, 1920x1080
Stream mapping:
Stream #0:0 (h264) -> overlay:main
Stream #1:0 (pgssub) -> scale
overlay -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
[sup @ 00000292aeae0600] Invalid timestamps stream=0, pts=0, dts=303570,
size=4974
[sup @ 00000292aeae0600] Invalid timestamps stream=0, pts=0, dts=767997,
size=6238
[sup @ 00000292aeae0600] sub2video: using 720x576 canvas
[libx264 @ 00000292ae6e2700] using SAR=1/1
[libx264 @ 00000292ae6e2700] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 00000292ae6e2700] profile High, level 4.0
Output #0, mpegts, to 'output_overlay.ts':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isomavc1
encoder : Lavf58.10.100
Stream #0:0: Video: h264 (libx264), yuv420p, 1920x1080 [SAR 1:1 DAR
16:9], q=-1--1, 25 fps, 90k tbn, 25 tbc (default)
Metadata:
encoder : Lavc58.16.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame= 57 fps=0.0 q=29.0 size= 7kB time=-00:00:00.07 bitrate=N/A
speed=N/A frame= 123 fps=123 q=29.0 size= 20kB time=00:00:02.56
bitrate= 62.9kbits/s sp[sup @ 00000292aeae0600] Invalid timestamps
stream=0, pts=0, dts=1135096, size=9926
frame= 189 fps=126 q=29.0 size= 40kB time=00:00:05.20 bitrate=
63.6kbits/s sp[sup @ 00000292aeae0600] Invalid timestamps stream=0, pts=0,
dts=1635183, size=17502
frame= 255 fps=127 q=29.0 size= 53kB time=00:00:07.84 bitrate=
55.2kbits/s spframe= 322 fps=128 q=29.0 size= 78kB time=00:00:10.52
bitrate= 60.5kbits/s sp[sup @ 00000292aeae0600] Invalid timestamps
stream=0, pts=0, dts=2218393, size=18698
frame= 388 fps=129 q=29.0 size= 91kB time=00:00:13.16 bitrate=
56.5kbits/s spframe= 454 fps=129 q=29.0 size= 125kB time=00:00:15.80
bitrate= 64.6kbits/s spframe= 518 fps=129 q=29.0 size= 137kB
time=00:00:18.36 bitrate= 61.2kbits/s spframe= 583 fps=129 q=29.0 size=
149kB time=00:00:20.96 bitrate= 58.4kbits/s spframe= 649 fps=129 q=29.0
size= 184kB time=00:00:23.60 bitrate= 64.0kbits/s spframe= 716
fps=129 q=29.0 size= 198kB time=00:00:26.28 bitrate= 61.6kbits/s
spframe= 754 fps=127 q=-1.0 Lsize= 216kB time=00:00:30.04 bitrate=
58.8kbits/s speed=5.07x
video:116kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 85.782951%
[libx264 @ 00000292ae6e2700] frame I:5 Avg QP: 8.08 size: 12890
[libx264 @ 00000292ae6e2700] frame P:190 Avg QP: 9.85 size: 81
[libx264 @ 00000292ae6e2700] frame B:559 Avg QP:13.61 size: 70
[libx264 @ 00000292ae6e2700] consecutive B-frames: 1.1% 0.3% 0.0% 98.7%
[libx264 @ 00000292ae6e2700] mb I I16..4: 95.4% 3.1% 1.5%
[libx264 @ 00000292ae6e2700] mb P I16..4: 0.0% 0.0% 0.0% P16..4:
0.0% 0.0% 0.0% 0.0% 0.0% skip:100.0%
[libx264 @ 00000292ae6e2700] mb B I16..4: 0.0% 0.0% 0.0% B16..8:
0.0% 0.0% 0.0% direct: 0.0% skip:100.0% L0:42.3% L1:57.7% BI: 0.0%
[libx264 @ 00000292ae6e2700] 8x8 transform intra:3.0% inter:6.6%
[libx264 @ 00000292ae6e2700] coded y,uvDC,uvAC intra: 1.0% 1.5% 1.5%
inter: 0.0% 0.0% 0.0%
[libx264 @ 00000292ae6e2700] i16 v,h,dc,p: 98% 0% 2% 0%
[libx264 @ 00000292ae6e2700] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 55% 4% 41%
0% 0% 0% 0% 0% 0%
[libx264 @ 00000292ae6e2700] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 43% 18% 14%
3% 4% 6% 5% 4% 3%
[libx264 @ 00000292ae6e2700] i8c dc,h,v,p: 99% 1% 0% 0%
[libx264 @ 00000292ae6e2700] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 00000292ae6e2700] ref P L0: 90.5% 6.0% 3.6%
[libx264 @ 00000292ae6e2700] ref B L0: 75.5% 24.5%
[libx264 @ 00000292ae6e2700] ref B L1: 98.5% 1.5%
[libx264 @ 00000292ae6e2700] kb/s:0.00
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/7117>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list