Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#4200 closed defect (fixed)

ffmpeg wont display/decode dvbsubs

Reported by: gentian Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: dvbsub
Cc: Michael Niedermayer Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

I have been trying to burn live dvbsub subtitles into HLS stream but it is not working. The encoding starts fine but there are no subtitles on the video. sometimes you can see them only for a second and then nothing is shown except some clicks and freezes on the video. what could be wrong?

ffmpeg -i 'udp://@232.1.1.1:5500?fifo_size=1000000&overrun_nonfatal=1' -filter_complex "[0:p:1002:0][0:p:1002:2]overlay[v]" -map [v] -map 0:p:1002:1 -c:v libx264 -preset superfast -b:v 3024k -maxrate 3024k -bufsize 1024k -c:a copy -async 1 -deinterlace -f tee [hls_time=10:hls_list_size=2:hls_wrap=4:start_number=1]/var/www/html/test.m3u8
ffmpeg version git-2014-12-19-c89751a Copyright (c) 2000-2014 the FFmpeg developers

built on Dec 19 2014 05:46:34 with gcc 4.8.2 (GCC) 20140120 (Red Hat 4.8.2-16)
configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libx264 --enable-libx265 --enable-libfreetype --enable-fontconfig --enable-iconv
libavutil 54. 15.100 / 54. 15.100
libavcodec 56. 16.100 / 56. 16.100
libavformat 56. 16.101 / 56. 16.101
libavdevice 56. 3.100 / 56. 3.100
libavfilter 5. 4.100 / 5. 4.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100

[h264 @ 0x2496600] non-existing SPS 0 referenced in buffering period
[h264 @ 0x2496600] non-existing PPS 0 referenced
[h264 @ 0x2496600] non-existing SPS 0 referenced in buffering period
[h264 @ 0x2496600] non-existing PPS 0 referenced
[h264 @ 0x2496600] decode_slice_header error
[h264 @ 0x2496600] no frame!

Input #0, mpegts, from 'udp://@232.1.1.1:5500?fifo_size=1000000&overrun_nonfatal=1':

Duration: N/A, start: 2117.316033, bitrate: N/A


Program 1002

Metadata:

service_name : Film
service_provider: TEST

Stream #0:0[0x3fd]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:1[0x3fe](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 160 kb/s
Stream #0:2[0x401](alb): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:3[0x402](eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)

[mpegts @ 0x247b360] sub2video: using 1920x1080 canvas
[libx264 @ 0x26c8420] using SAR=1/1
[libx264 @ 0x26c8420] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x26c8420] profile High, level 4.0
Output #0, tee, to '[hls_time=10:hls_list_size=2:hls_wrap=4:start_number=1]/var/www/html/test.m3u8':

Metadata:

encoder : Lavf56.16.101
Stream #0:0: Video: h264 (libx264), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 3024 kb/s, 25 fps, 25 tbn, 25 tbc (default)
Metadata:

encoder : Lavc56.16.100 libx264

Stream #0:1(eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, 160 kb/s

Stream mapping:

Stream #0:0 (h264) -> overlay:main
Stream #0:2 (dvbsub) -> overlay:overlay
overlay -> Stream #0:0 (libx264)
Stream #0:1 -> #0:1 (copy)

Press [q] to stop, ? for help
[h264 @ 0x33a0f20] reference picture missing during reorder
[h264 @ 0x33a0f20] Missing reference picture, default is 2147483647
[h264 @ 0x24fc7c0] mmco: unref short failure
[h264 @ 0x24fc7c0] reference picture missing during reorder
[h264 @ 0x24fc7c0] Missing reference picture, default is 65600
[h264 @ 0x47aed60] mmco: unref short failure
[h264 @ 0x26155e0] mmco: unref short failure
[mpegts @ 0x247b360] PES packet size mismatch

Last message repeated 10 times

[mpegts @ 0x247b360] PES packet size mismatch0:03.33 bitrate=N/A dup=56 drop=0
frame= 162 fps= 40 q=-1.0 Lsize=N/A time=00:00:06.40 bitrate=N/A dup=56 drop=0

Attachments (2)

sample1.ts (1.7 MB ) - added by gentian 10 years ago.
Sample TS file from the input
dvbsub-sample.ts (2.3 MB ) - added by ilir 10 years ago.
DVBsub sample

Change History (19)

comment:1 by Carl Eugen Hoyos, 10 years ago

Do you believe this is a regression?

Is the issue only reproducible with hls output or also with file output?
Is the issue only reproducible with the tee muxer or also without?
Is audio required to reproduce the issue or is it also reproducible with -an?
Is using an external library like libx264 required to reproduce the issue or is it reproducible with a native (internal) encoder?

And most important: Is the issue reproducible with file input?

comment:2 by gentian, 10 years ago

I have been trying for almost a year , constantly trying updates from master, to achive this but no luck. The maximum i achive is 1 or 2 subtitles for the first 3-4 seconds then i see nothing, while the video has some small glitches and freezes (which i believe they happen at the time when subtitles are burned)...So for me is not a regression because i never could achieve a live burning of dvbsub subtitles to hls...

I always tried HLS with tee muxer. I tried -an but nothing changes, audio does not play any role with it. Never tried other codec as i only need H264 and HLS output.

comment:3 by Carl Eugen Hoyos, 10 years ago

Keywords: overlay subtitles burning removed
Priority: importantnormal

Please provide a dump of the input stream.

comment:4 by gentian, 10 years ago

a TS file from the output hls file? the input is MPTS stream.

comment:5 by Carl Eugen Hoyos, 10 years ago

Please provide a dump of the input MPTS stream.

by gentian, 10 years ago

Attachment: sample1.ts added

Sample TS file from the input

comment:6 by gentian, 10 years ago

I have also feedback from other companies that deliver OTT services using ffmpeg/HLS that they can not support dvbsub subtitles and could not burn them for live channels. only by using proprietary encoding appliances they could achieve this feature.
if there is someone from ffmpeg community who has done this please contribute with a fix or let us know as i believe there are many others who desperately need this feature to work with ffmpeg.

comment:7 by Carl Eugen Hoyos, 10 years ago

Please ask other companies if they reported this issue to FFmpeg / how they believe that issues may be fixed without a report...
(Trac does not report file uploads as ticket updates, I didn't know you provided a sample until now.)

comment:8 by gentian, 10 years ago

ok, i did not know that trac was not reporting file upload.

not sure, but i have checked their service in two cases and there are no subs. and i have seen some tickets with dvbsub-burning issue so i have a feeling there is a general problem with that. if it only with me then is better cause then there would be a solution :)

comment:9 by Carl Eugen Hoyos, 10 years ago

service_name and service_provider differ between your console output and the uploaded sample: How did you produce the uploaded sample?
Please upload a dump of the input stream, not a file created with remuxing the input stream with FFmpeg.

comment:10 by gentian, 10 years ago

i used ffmpeg -i <mulitcast> -map 0:p:1002 -c copy to sample.ts,
tell me what do you need me to use for the dumping process?

comment:11 by Carl Eugen Hoyos, 10 years ago

I often use mplayer -dumpstream, I am sure there are alternatives.

by ilir, 10 years ago

Attachment: dvbsub-sample.ts added

DVBsub sample

comment:12 by ilir, 10 years ago

I just uploaded a sample with similar problems (https://trac.ffmpeg.org/attachment/ticket/4200/dvbsub-sample.ts). I extracted it with mplayer -dumpstream.

No subtitles are shown in FFplay/FFmpeg but VLC shows subtitles without a problem.

Is there a solution for this?

Thank you.

Last edited 10 years ago by ilir (previous) (diff)

comment:13 by compn, 9 years ago

Reproduced by developer: set
Status: newopen
Summary: dvbsub burning overlay not workingffmpeg wont display/decode dvbsubs

ffmpeg -i dvbsub-sample.ts -filter_complex "[0:v][0:s]overlay[v]" -map "[v]" -map 0:a out.mkv

does indeed fail to burn subs.
subs also do not appear in ffplay using 't' key.

subs display in vlc 3.0.0 nb

H:\>d:\ffmpeg -i dvbsub-sample.ts -filter_complex "[0:v][0:s]o
verlay[v]" -map "[v]" -map 0:a -an out.mkv -y
ffmpeg version N-73541-g944a1aa Copyright (c) 2000-2015 the FFmpeg developers

built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzli

b --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libblu
ray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enab
le-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger

--enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --ena

ble-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --en
able-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --ena
ble-decklink --enable-zlib

libavutil 54. 28.100 / 54. 28.100
libavcodec 56. 47.100 / 56. 47.100
libavformat 56. 40.100 / 56. 40.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 21.100 / 5. 21.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.100 / 1. 2.100
libpostproc 53. 3.100 / 53. 3.100

[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] decode_slice_header error
[h264 @ 0320d9e0] no frame!
[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] decode_slice_header error
[h264 @ 0320d9e0] no frame!
[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] decode_slice_header error
[h264 @ 0320d9e0] no frame!
[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] decode_slice_header error
[h264 @ 0320d9e0] no frame!
[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] decode_slice_header error
[h264 @ 0320d9e0] no frame!
[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] decode_slice_header error
[h264 @ 0320d9e0] no frame!
[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] decode_slice_header error
[h264 @ 0320d9e0] no frame!
[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] decode_slice_header error
[h264 @ 0320d9e0] no frame!
[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] decode_slice_header error
[h264 @ 0320d9e0] no frame!
[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] decode_slice_header error
[h264 @ 0320d9e0] no frame!
[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] non-existing SPS 0 referenced in buffering period
[h264 @ 0320d9e0] non-existing PPS 0 referenced
[h264 @ 0320d9e0] decode_slice_header error
[h264 @ 0320d9e0] no frame!
[NULL @ 031f3300] start time for stream 3 is not set in estimate_timings_from_pts
[mpegts @ 031f0340] PES packet size mismatch

Last message repeated 1 times

Input #0, mpegts, from 'dvbsub-sample.ts':

Duration: 04:22:55.12, start: 85235.728911, bitrate: 1 kb/s
Program 21

Metadata:

service_name : Tring Max
service_provider: tring tv

Stream #0:0[0x514]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg), 720x576 [

SAR 16:11 DAR 20:11], 25 fps, 50 tbr, 90k tbn, 50 tbc

Stream #0:1[0x51e](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 128 kb/s
Stream #0:2[0x200](alb): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:3[0x202](und): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)

[mpegts @ 031f0340] sub2video: using 720x576 canvas
[libx264 @ 034ea800] using SAR=16/11
[libx264 @ 034ea800] using cpu capabilities: MMX2 SSE2 SSE3 Cache64
[libx264 @ 034ea800] profile High, level 3.0
[libx264 @ 034ea800] 264 - core 146 r2538 121396c - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - ht
tp://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subm
e=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=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 i
nterlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 we
ightb=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, matroska, to 'out.mkv':

Metadata:

encoder : Lavf56.40.100
Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 720x576 [SAR 16:11 DAR 20:11],

q=-1--1, 25 fps, 1k tbn, 25 tbc (default)

Metadata:

encoder : Lavc56.47.100 libx264

Stream mapping:

Stream #0:0 (h264) -> overlay:main
Stream #0:2 (dvbsub) -> overlay:overlay
overlay -> Stream #0:0 (libx264)

Press [q] to stop, ? for help
[h264 @ 03330a40] Found reference and non-reference fields in the same frame, which is not implement
ed. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means tha
t your file has a feature which has not been implemented.
[h264 @ 03330a40] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incom
ing/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
[h264 @ 03330a40] decode_slice_header error
[h264 @ 03ee1680] reference picture missing during reorder
[h264 @ 03ee1680] Missing reference picture, default is 2147483647
[h264 @ 03330a40] mmco: unref short failure

Last message repeated 1 times

[h264 @ 034be8a0] mmco: unref short failure

Last message repeated 1 times

[mpegts @ 031f0340] PES packet size mismatchime=00:00:08.04 bitrate= 467.8kbits/s
[h264 @ 03ee1680] error while decoding MB 22 14, bytestream -7
frame= 245 fps= 13 q=-1.0 Lsize= 573kB time=00:00:10.16 bitrate= 461.7kbits/s dup=0 drop=7
video:570kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.419933%
[libx264 @ 034ea800] frame I:3 Avg QP:16.44 size: 17370
[libx264 @ 034ea800] frame P:66 Avg QP:20.30 size: 4940
[libx264 @ 034ea800] frame B:176 Avg QP:24.00 size: 1165
[libx264 @ 034ea800] consecutive B-frames: 1.2% 4.9% 12.2% 81.6%
[libx264 @ 034ea800] mb I I16..4: 32.1% 56.3% 11.6%
[libx264 @ 034ea800] mb P I16..4: 0.9% 3.7% 0.7% P16..4: 30.3% 10.0% 4.4% 0.0% 0.0% skip:
49.9%
[libx264 @ 034ea800] mb B I16..4: 0.1% 0.2% 0.0% B16..8: 26.7% 1.9% 0.2% direct: 0.6% skip:
70.4% L0:41.3% L1:53.3% BI: 5.5%
[libx264 @ 034ea800] 8x8 transform intra:63.9% inter:80.8%
[libx264 @ 034ea800] coded y,uvDC,uvAC intra: 51.6% 64.2% 25.6% inter: 6.1% 10.4% 0.1%
[libx264 @ 034ea800] i16 v,h,dc,p: 57% 23% 8% 12%
[libx264 @ 034ea800] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 18% 19% 4% 6% 9% 5% 9% 5%
[libx264 @ 034ea800] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 31% 15% 4% 6% 7% 5% 6% 5%
[libx264 @ 034ea800] i8c dc,h,v,p: 50% 19% 23% 8%
[libx264 @ 034ea800] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 034ea800] ref P L0: 64.3% 13.3% 17.1% 5.3%
[libx264 @ 034ea800] ref B L0: 93.5% 5.3% 1.1%
[libx264 @ 034ea800] ref B L1: 97.0% 3.0%
[libx264 @ 034ea800] kb/s:474.16

in reply to:  13 comment:14 by Carl Eugen Hoyos, 9 years ago

Replying to compn:

ffmpeg -i dvbsub-sample.ts -filter_complex "[0:v][0:s]overlay[v]" -map "[v]" -map 0:a out.mkv

does indeed fail to burn subs.
subs also do not appear in ffplay using 't' key.

They used to be shown (incorrectly!) with older versions of ffmpeg (?) and ffplay - it may make sense to bisect to know which change completely removed them.

Please consider using Code Blocks to make the console output slightly more readable and please avoid using external libraries if they are not needed to reproduce an issue - in many cases, this makes understanding the issues more difficult.

comment:15 by Michael Niedermayer, 9 years ago

Resolution: fixed
Status: openclosed

Fixed in 42aa02418e43802b4ebcca373d2413ab63a0307e
Note, still might be interresting to bisect

comment:16 by Michael Niedermayer, 9 years ago

Cc: Michael Niedermayer added

comment:17 by Carl Eugen Hoyos, 9 years ago

Note: See TracTickets for help on using tickets.