Opened 8 years ago

Last modified 8 years ago

#5067 open defect

crash on Mapping Multicast TV Stream to HLS with "Exactly one WebVTT stream is needed" as message

Reported by: cloudclimber Owned by:
Priority: important Component: avformat
Version: git-master Keywords: webvtt hls crash SIGSEGV regression
Cc: Anshul, Michael Niedermayer Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
i want to map a multicast TV Stream as is to HLS.
Till ffmpeg 2.7.2 there was no Problem with the command line.
With ffmpeg 2.8.0 till now with ffmpeg 2.8.3 ffmpeg says now "Exactly one WebVTT stream is needed" and crashes.
The debug Output comes from ffmpeg 2.8.2, but with ffmpeg 2.8.3 it's the same Problem.

As should be:
The command line should run without Problems, even without WebVTT streams, and should map all subtitles as is.

How to reproduce:

root@ffmpegserver:~/ffmpeg-2.8.2-64bit-static# ./ffmpeg -i udp://@239.100.1.1:1234 -map 0 -probesize 100 -analyzeduration 100 -c copy -copy_unknown -f hls -hls_time 10 -hls_wrap 10 -hls_list_size 10 /var/www/test1_.m3u8 -loglevel debug
ffmpeg version 2.8.2-static http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2015 the FFmpeg developers
 built with gcc 5.2.1 (Debian 5.2.1-23) 20151028
 configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --disable-indev=sndio --disable-outdev=sndio --cc=gcc
 libavutil 54. 31.100 / 54. 31.100
 libavcodec 56. 60.100 / 56. 60.100
 libavformat 56. 40.101 / 56. 40.101
 libavdevice 56. 4.100 / 56. 4.100
 libavfilter 5. 40.101 / 5. 40.101
 libswscale 3. 1.101 / 3. 1.101
 libswresample 1. 2.101 / 1. 2.101
 libpostproc 53. 3.100 / 53. 3.100
Splitting the commandline.
Reading option '-i' ... matched as input file with argument 'udp://@239.100.1.1:1234'.
Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0'.
Reading option '-probesize' ... matched as AVOption 'probesize' with argument '100'.
Reading option '-analyzeduration' ... matched as AVOption 'analyzeduration' with argument '100'.
Reading option '-c' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option '-copy_unknown' ... matched as option 'copy_unknown' (Copy unknown stream types) with argument '1'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'hls'.
Reading option '-hls_time' ... matched as AVOption 'hls_time' with argument '10'.
Reading option '-hls_wrap' ... matched as AVOption 'hls_wrap' with argument '10'.
Reading option '-hls_list_size' ... matched as AVOption 'hls_list_size' with argument '10'.
Reading option '/var/www/test1_.m3u8' ... matched as output file.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option copy_unknown (Copy unknown stream types) with argument 1.
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file udp://@239.100.1.1:1234.
Successfully parsed a group of options.
Opening an input file: udp://@239.100.1.1:1234.
[udp @ 0x3c048c0] end receive buffer size reported is 131072
[mpegts @ 0x3c04080] Format mpegts probed with size=2048 and score=100
[mpegts @ 0x3c04080] stream=0 stream_type=3 pid=90 prog_reg_desc=
[mpegts @ 0x3c04080] stream=1 stream_type=6 pid=92 prog_reg_desc=
[mpegts @ 0x3c04080] stream=2 stream_type=2 pid=a8 prog_reg_desc=
[mpegts @ 0x3c04080] stream=3 stream_type=5 pid=585 prog_reg_desc=
[mpegts @ 0x3c04080] Before avformat_find_stream_info() pos: 0 bytes read:215824 seeks:0
[mpegts @ 0x3c04080] parser not found for codec dvb_teletext, packets or times may be invalid.
[mpegts @ 0x3c04080] parser not found for codec none, packets or times may be invalid.
[mpegts @ 0x3c04080] parser not found for codec dvb_teletext, packets or times may be invalid.
[mpeg2video @ 0x3c2a080] Invalid frame dimensions 0x0.
 Last message repeated 4 times
[mpegts @ 0x3c04080] max_analyze_duration 5000000 reached at 5000000 microseconds st:2
[mpegts @ 0x3c04080] Could not find codec parameters for stream 3 (Unknown: none ([5][0][0][0] / 0x0005)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x3c04080] After avformat_find_stream_info() pos: 2948780 bytes read:2949156 seeks:0 frames:469
Input #0, mpegts, from 'udp://@239.100.1.1:1234':
 Duration: N/A, start: 85846.772444, bitrate: N/A
 Program 3394
 Metadata:
 service_name : QVC PLUS
 service_provider: SES ASTRA
 Stream #0:0[0x90](ger), 208, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 128 kb/s
 Stream #0:1[0x92](ger), 131, 1/90000: Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
 Stream #0:2[0xa8], 130, 1/90000: Video: mpeg2video (Main), 1 reference frame ([2][0][0][0] / 0x0002), yuv420p(tv, left), 720x576 [SAR 64:45 DAR 16:9], 1/50, max. 15000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
 Stream #0:3[0x585], 0, 1/90000: Unknown: none ([5][0][0][0] / 0x0005)
Successfully opened the file.
Parsing a group of options: output file /var/www/test1_.m3u8.
Applying option map (set input stream mapping) with argument 0.
Applying option c (codec name) with argument copy.
Applying option f (force format) with argument hls.
Successfully parsed a group of options.
Opening an output file: /var/www/test1_.m3u8.
Successfully opened the file.
[webvtt @ 0x3fb80c0] Exactly one WebVTT stream is needed.
[mpegts @ 0x3fb7ae0] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt every 40 pkts
Segmentation fault (core dumped)
root@ffmpegserver:~/ffmpeg-2.8.2-64bit-static#

Attachments (3)

ffmpeg_20151206_valgrind.txt (106.6 KB ) - added by cloudclimber 8 years ago.
Valgrind Output
ffmpeg_20151206_gdb.txt (14.5 KB ) - added by cloudclimber 8 years ago.
gdb Output
sample.ts (2.0 MB ) - added by cloudclimber 8 years ago.
Example to reproduce

Change History (16)

comment:1 by Carl Eugen Hoyos, 8 years ago

Is the crash reproducible with current FFmpeg git head?

comment:2 by cloudclimber, 8 years ago

yes it is.
i ran it and it crashed the same way

comment:3 by Carl Eugen Hoyos, 8 years ago

Please provide backtrace etc. as explained on https://ffmpeg.org/bugreports.html

by cloudclimber, 8 years ago

Valgrind Output

by cloudclimber, 8 years ago

Attachment: ffmpeg_20151206_gdb.txt added

gdb Output

comment:4 by cloudclimber, 8 years ago

i hope i did the Outputs right

comment:5 by Carl Eugen Hoyos, 8 years ago

The output is unfortunately useless because it contains no debug information.
Is the issue only reproducible with udp input or also with file input? To test, you have to dump the udp stream to a file, if you don't know how to do this, please try (one of) the three possibilities:

  • mplayer -dumpstream
  • ffmpeg -f data -i udp://@239.100.1.1:1234 -map 0 -codec copy -f data out.ts
  • or use tools/aviocat but you would have to compile it and if you can compile, you can also provide a backtrace with debug information.

comment:6 by Carl Eugen Hoyos, 8 years ago

If the issue is reproducible with file input, please upload the file and I will provide the missing information.

by cloudclimber, 8 years ago

Attachment: sample.ts added

Example to reproduce

comment:7 by cloudclimber, 8 years ago

i uploaded a Sample file.
For a better and longer Sample i have to upload it somewher else because it would exceed the 2,5MB Filesize Limit

comment:8 by Carl Eugen Hoyos, 8 years ago

Component: undeterminedavformat
Keywords: crash SIGSEGV regression added
Reproduced by developer: set
Status: newopen
Version: 2.8.3git-master

Regression since 379ddc6a or b8423269 (depending on configure options)

(gdb) r -i sample.ts -c copy out.m3u8
Starting program: ffmpeg_g -i sample.ts -c copy out.m3u8
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
ffmpeg version N-77081-ga0a39ac Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      55. 10.100 / 55. 10.100
  libavcodec     57. 16.101 / 57. 16.101
  libavformat    57. 19.100 / 57. 19.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 20.100 /  6. 20.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[NULL @ 0x1cda700] start time for stream 4 is not set in estimate_timings_from_pts
[NULL @ 0x1cdb280] start time for stream 5 is not set in estimate_timings_from_pts
Input #0, mpegts, from 'sample.ts':
  Duration: 00:00:03.84, start: 72016.973667, bitrate: 4284 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], max. 7700 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x101]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0:2[0x102]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0:3[0x103](und): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #0:4[0x104]: Data: bin_data ([6][0][0][0] / 0x0006)
    Stream #0:5[0x105]: Data: bin_data ([6][0][0][0] / 0x0006)
[webvtt @ 0x1d07900] Exactly one WebVTT stream is needed.
Output #0, hls, to 'out.m3u8':
  Metadata:
    encoder         : Lavf57.19.100
    Stream #0:0: Video: mpeg2video ([2][0][0][0] / 0x0002), yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, max. 7700 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbc
    Stream #0:1: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, 192 kb/s
    Stream #0:2(und): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
  Stream #0:3 -> #0:2 (copy)
Press [q] to stop, [?] for help

Program received signal SIGSEGV, Segmentation fault.
compute_muxer_pkt_fields (s=s@entry=0x1d07900, st=0x1d09100, pkt=pkt@entry=0x7fffffffd260)
    at libavformat/mux.c:576
576         st->priv_pts->val = pkt->dts;
(gdb) bt
#0  compute_muxer_pkt_fields (s=s@entry=0x1d07900, st=0x1d09100,
    pkt=pkt@entry=0x7fffffffd260) at libavformat/mux.c:576
#1  0x00000000006237b8 in av_write_frame (s=s@entry=0x1d07900, pkt=pkt@entry=0x7fffffffd260)
    at libavformat/mux.c:786
#2  0x00000000006245b4 in ff_write_chained (dst=0x1d07900, dst_stream=0, pkt=0x7fffffffd3d0,
    src=0x1d02f80, interleave=0) at libavformat/mux.c:1133
#3  0x0000000000621fad in write_packet (s=s@entry=0x1d02f80, pkt=pkt@entry=0x7fffffffd3d0)
    at libavformat/mux.c:677
#4  0x00000000006240be in av_interleaved_write_frame (s=s@entry=0x1d02f80, pkt=0x0,
    pkt@entry=0x7fffffffd610) at libavformat/mux.c:1040
#5  0x00000000004913da in write_frame (s=0x1d02f80, pkt=pkt@entry=0x7fffffffd610,
    ost=ost@entry=0x1d05740) at ffmpeg.c:781
#6  0x0000000000495349 in do_streamcopy (ist=ist@entry=0x1cdbca0, ost=0x1d05740,
    pkt=pkt@entry=0x7fffffffda80) at ffmpeg.c:1911
#7  0x00000000004978a3 in process_input_packet (no_eof=0, pkt=0x7fffffffda80, ist=0x1cdbca0)
    at ffmpeg.c:2433
#8  process_input (file_index=30379808) at ffmpeg.c:3979
#9  transcode_step () at ffmpeg.c:4067
#10 transcode () at ffmpeg.c:4121
#11 0x0000000000479c2b in main (argc=<optimized out>, argv=0x7fffffffdd28) at ffmpeg.c:4314
(gdb) disass $pc-32,$pc+32
Dump of assembler code from 0x6221e0 to 0x622220:
   0x00000000006221e0 <compute_muxer_pkt_fields+288>:   rolb   (%rax,%rax,1)
   0x00000000006221e3 <compute_muxer_pkt_fields+291>:   add    %al,(%rcx)
   0x00000000006221e5 <compute_muxer_pkt_fields+293>:   jne    0x622760 <compute_muxer_pkt_fields+1696>
   0x00000000006221eb <compute_muxer_pkt_fields+299>:   mov    0x8(%rbx),%rdi
   0x00000000006221ef <compute_muxer_pkt_fields+303>:   mov    0x300(%rbx),%rsi
   0x00000000006221f6 <compute_muxer_pkt_fields+310>:   mov    %rcx,0xf0(%rbx)
   0x00000000006221fd <compute_muxer_pkt_fields+317>:   mov    0xc(%rdi),%eax
=> 0x0000000000622200 <compute_muxer_pkt_fields+320>:   mov    %rcx,(%rsi)
   0x0000000000622203 <compute_muxer_pkt_fields+323>:   test   %eax,%eax
   0x0000000000622205 <compute_muxer_pkt_fields+325>:   jne    0x622248 <compute_muxer_pkt_fields+392>
   0x0000000000622207 <compute_muxer_pkt_fields+327>:   movslq 0x8c(%rdi),%rdx
   0x000000000062220e <compute_muxer_pkt_fields+334>:   movslq 0x34(%rbx),%rax
   0x0000000000622212 <compute_muxer_pkt_fields+338>:   mov    0x10(%rsi),%rdi
   0x0000000000622216 <compute_muxer_pkt_fields+342>:   imul   %rdx,%rax
   0x000000000062221a <compute_muxer_pkt_fields+346>:   add    0x8(%rsi),%rax
   0x000000000062221e <compute_muxer_pkt_fields+350>:   js     0x6228e0 <compute_muxer_pkt_fields+2080>
End of assembler dump.
(gdb) info register
rax            0x3      3
rbx            0x1d09100        30445824
rcx            0x0      0
rdx            0x8000000000000000       -9223372036854775808
rsi            0x0      0
rdi            0x1d09560        30446944
rbp            0x7fffffffd260   0x7fffffffd260
rsp            0x7fffffffd090   0x7fffffffd090
r8             0x0      0
r9             0x7fffffffd260   140737488343648
r10            0x0      0
r11            0x8000000000000001       -9223372036854775807
r12            0x8000000000000000       -9223372036854775808
r13            0x1d02f80        30420864
r14            0x1d07900        30439680
r15            0x1d05de0        30432736
rip            0x622200 0x622200 <compute_muxer_pkt_fields+320>
eflags         0x10246  [ PF ZF IF RF ]
cs             0x33     51
ss             0x2b     43
ds             0x0      0
es             0x0      0
fs             0x0      0
gs             0x0      0

comment:9 by Michael Niedermayer, 8 years ago

Cc: Anshul added

Segfault fixed in c62d1780fff8a1997dd1707bbc557efc8fe41e3c
not sure if this completly fixes this issue or if hls/webvvt should/could do better and not fail in this case)
Maybe anshul (in CC could comment?)

comment:10 by Michael Niedermayer, 8 years ago

Cc: Michael Niedermayer added

comment:11 by Carl Eugen Hoyos, 8 years ago

Looks like a duplicate of ticket #4957.

comment:12 by Michael Niedermayer, 8 years ago

is this actually a regression ? where the output files previously correct ?

comment:13 by Carl Eugen Hoyos, 8 years ago

Works fine here:

$ ffmpeg -i sample.ts -codec copy out.m3u8
ffmpeg version N-74027-gec7f04c Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      54. 29.100 / 54. 29.100
  libavcodec     56. 55.100 / 56. 55.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 29.100 /  5. 29.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
[NULL @ 0x3671d60] start time for stream 4 is not set in estimate_timings_from_pts
[NULL @ 0x36728e0] start time for stream 5 is not set in estimate_timings_from_pts
Input #0, mpegts, from 'sample.ts':
  Duration: 00:00:03.84, start: 72016.973667, bitrate: 4284 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], max. 7700 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x101]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0:2[0x102]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0:3[0x103](und): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #0:4[0x104]: Data: bin_data ([6][0][0][0] / 0x0006)
    Stream #0:5[0x105]: Data: bin_data ([6][0][0][0] / 0x0006)
Output #0, hls, to 'out.m3u8':
  Metadata:
    encoder         : Lavf56.40.101
    Stream #0:0: Video: mpeg2video ([2][0][0][0] / 0x0002), yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, max. 7700 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbc
    Stream #0:1: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, 192 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=   81 fps=0.0 q=-1.0 Lsize=N/A time=00:00:03.22 bitrate=N/A
video:1587kB audio:73kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Note: See TracTickets for help on using tickets.