[FFmpeg-trac] #5041(undetermined:new): ffmpeg hangs up during analyzing flv stream

FFmpeg trac at avcodec.org
Thu Nov 26 15:17:27 CET 2015


#5041: ffmpeg hangs up during analyzing flv stream
-------------------------------------+-------------------------------------
             Reporter:  maxvgi       |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:  git-
  undetermined                       |  master
             Keywords:  hang         |               Blocked By:
  max_analyze_duration http flv      |  Reproduced by developer:  0
             Blocking:               |
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 I am trying to save stream from IP-camera with the following command:

 {{{ffmpeg -i http://admin:123890@91.202.204.9:89/h264.flv -vcodec copy -an
 1.mp4}}}

 ffmpeg hangs up even before starting to save stream. It seems that it
 waits for a long time to determine stream format, ignoring the
 max_analyze_duration parameter.

 The problem dissapears if I save part of the stream to a local file with
 wget and only then try to transcode with ffmpeg.


 Console output:
 {{{
 ffmpeg version N-76851-ga330430 Copyright (c) 2000-2015 the FFmpeg
 developers
   built with gcc 4.7 (Debian 4.7.2-5)
   configuration: --enable-gpl --enable-libmp3lame --enable-libtheora
 --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc
 --enable-version3 --enable-pic --enable-libvpx --enable-libfdk-aac
 --extra-cflags='-I/usr/ffmpeg-2015-11-26/include -fPIC' --extra-
 ldflags=-I/usr/ffmpeg-2015-11-26/lib --prefix=/usr/ffmpeg-2015-11-26
   libavutil      55.  9.100 / 55.  9.100
   libavcodec     57. 16.100 / 57. 16.100
   libavformat    57. 19.100 / 57. 19.100
   libavdevice    57.  0.100 / 57.  0.100
   libavfilter     6. 15.100 /  6. 15.100
   libswscale      4.  0.100 /  4.  0.100
   libswresample   2.  0.101 /  2.  0.101
   libpostproc    54.  0.100 / 54.  0.100
 Splitting the commandline.
 Reading option '-v' ... matched as option 'v' (set logging level) with
 argument '9'.
 Reading option '-loglevel' ... matched as option 'loglevel' (set logging
 level) with argument '99'.
 Reading option '-i' ... matched as input file with argument
 'http://admin:123890@91.202.204.9:89/h264.flv'.
 Reading option '-vcodec' ... matched as option 'vcodec' (force video codec
 ('copy' to copy stream)) with argument 'copy'.
 Reading option '-an' ... matched as option 'an' (disable audio) with
 argument '1'.
 Reading option '1.mp4' ... matched as output file.
 Finished splitting the commandline.
 Parsing a group of options: global .
 Applying option v (set logging level) with argument 9.
 Successfully parsed a group of options.
 Parsing a group of options: input file
 http://admin:123890@91.202.204.9:89/h264.flv.
 Successfully parsed a group of options.
 Opening an input file: http://admin:123890@91.202.204.9:89/h264.flv.
 [http @ 0x24b8d00] request: GET /h264.flv HTTP/1.1
 User-Agent: Lavf/57.19.100
 Accept: */*
 Range: bytes=0-
 Connection: close
 Host: 91.202.204.9:89
 Icy-MetaData: 1


 [http @ 0x24b8d00] header='HTTP/1.0 401 Authorization Required'
 [http @ 0x24b8d00] http_code=401
 [http @ 0x24b8d00] header='Server: alphapd'
 [http @ 0x24b8d00] header='Date: Thu Nov 26 17:00:17 2015'
 [http @ 0x24b8d00] header='Pragma: no-cache'
 [http @ 0x24b8d00] header='Cache-Control: no-cache'
 [http @ 0x24b8d00] header='Content-type: text/html'
 [http @ 0x24b8d00] header='WWW-Authenticate: Basic realm="DCS-931L"'
 [http @ 0x24b8d00] header=''
 [http @ 0x24b8d00] request: GET /h264.flv HTTP/1.1
 User-Agent: Lavf/57.19.100
 Accept: */*
 Range: bytes=0-
 Connection: close
 Host: 91.202.204.9:89
 Icy-MetaData: 1
 Authorization: Basic YWRtaW46MTIzODkw


 [http @ 0x24b8d00] header='HTTP/1.0 200 OK'
 [http @ 0x24b8d00] http_code=200
 [http @ 0x24b8d00] header='Server: alphapd'
 [http @ 0x24b8d00] header='Date: Thu Nov 26 17:00:18 2015'
 [http @ 0x24b8d00] header='Pragma: no-cache'
 [http @ 0x24b8d00] header='Cache-Control: no-cache'
 [http @ 0x24b8d00] header='Content-type: video/x-flv'
 [http @ 0x24b8d00] header=''
 Probing aac score:1 size:2048
 Probing flv score:100 size:2048
 Probing mp3 score:1 size:2048
 [flv @ 0x24b83e0] Format flv probed with size=2048 and score=100
 [flv @ 0x24b83e0] Before avformat_find_stream_info() pos: 13 bytes
 read:2992 seeks:0
 [flv @ 0x24b83e0] type:18, size:268, last:-1, dts:0 pos:21
 [flv @ 0x24b83e0] type:9, size:39, last:-1, dts:0 pos:304
 [flv @ 0x24b83e0] 0 17 0
 [flv @ 0x24b83e0] type:9, size:11221, last:-1, dts:0 pos:358
 [flv @ 0x24b83e0] 0 17 0
 [flv @ 0x24b83e0] type:9, size:965, last:-1, dts:33 pos:11594
 [flv @ 0x24b83e0] 0 27 0
 [flv @ 0x24b83e0] type:9, size:981, last:-1, dts:66 pos:12574
 [flv @ 0x24b83e0] 0 27 0
 [flv @ 0x24b83e0] type:9, size:997, last:-1, dts:100 pos:13570
 [flv @ 0x24b83e0] 0 27 0
 [flv @ 0x24b83e0] type:9, size:1125, last:-1, dts:133 pos:14582
 [flv @ 0x24b83e0] 0 27 0
 [flv @ 0x24b83e0] type:9, size:1061, last:-1, dts:166 pos:15722
 [flv @ 0x24b83e0] 0 27 0
 [flv @ 0x24b83e0] type:9, size:1077, last:-1, dts:200 pos:16798
 [flv @ 0x24b83e0] 0 27 0
 [flv @ 0x24b83e0] type:9, size:1157, last:-1, dts:233 pos:17890
 [flv @ 0x24b83e0] 0 27 0
 [flv @ 0x24b83e0] type:9, size:1141, last:-1, dts:266 pos:19062
 [flv @ 0x24b83e0] 0 27 0
 [flv @ 0x24b83e0] type:9, size:1173, last:-1, dts:300 pos:20218
 [flv @ 0x24b83e0] 0 27 0
 [flv @ 0x24b83e0] type:9, size:11221, last:-1, dts:333 pos:21406
 [flv @ 0x24b83e0] 0 17 0
 [flv @ 0x24b83e0] type:9, size:965, last:-1, dts:366 pos:32642
 [flv @ 0x24b83e0] 0 27 0
 [flv @ 0x24b83e0] type:9, size:1013, last:-1, dts:400 pos:33622
 [flv @ 0x24b83e0] 0 27 0
 [flv @ 0x24b83e0] type:9, size:997, last:-1, dts:433 pos:34650
 [flv @ 0x24b83e0] 0 27 0
 [flv @ 0x24b83e0] type:9, size:1109, last:-1, dts:466 pos:35662
 [flv @ 0x24b83e0] 0 27 0
 [flv @ 0x24b83e0] type:9, size:1061, last:-1, dts:500 pos:36786
 [flv @ 0x24b83e0] 0 27 0
 [flv @ 0x24b83e0] type:9, size:1061, last:-1, dts:533 pos:37862
 [flv @ 0x24b83e0] 0 27 0
 [flv @ 0x24b83e0] type:9, size:1173, last:-1, dts:566 pos:38938
 [flv @ 0x24b83e0] 0 27 0
 [flv @ 0x24b83e0] type:9, size:1125, last:-1, dts:600 pos:40126
 [flv @ 0x24b83e0] 0 27 0
 ......
 }}}


 gdb backtrace:
 {{{
 #0  0x00007ffff5e56cd8 in *__GI___poll (fds=fds at entry=0x7fffffffdb00,
 nfds=nfds at entry=1, timeout=<optimized out>, timeout at entry=100) at
 ../sysdeps/unix/sysv/linux/poll.c:83
 #1  0x000000000067d15c in ff_network_wait_fd (fd=fd at entry=8,
 write=write at entry=0) at libavformat/network.c:78
 #2  0x000000000067d1ba in ff_network_wait_fd_timeout (fd=8,
 write=write at entry=0, timeout=0, int_cb=0x1d8f9f0) at
 libavformat/network.c:90
 #3  0x00000000006d1df5 in tcp_read (h=<optimized out>, buf=0x1d97cb0 "\t",
 size=32768) at libavformat/tcp.c:194
 #4  0x00000000005d8398 in retry_transfer_wrapper (transfer_func=0x6d1dc0
 <tcp_read>, size_min=1, size=32768, buf=0x1d97cb0 "\t", h=0x1d8f9c0) at
 libavformat/avio.c:326
 #5  ffurl_read (h=0x1d8f9c0, buf=buf at entry=0x1d97cb0 "\t", size=32768) at
 libavformat/avio.c:357
 #6  0x000000000060d9ae in http_buf_read (h=h at entry=0x1d8dcc0,
 buf=buf at entry=0x1d97cb0 "\t", size=size at entry=32768) at
 libavformat/http.c:1162
 #7  0x0000000000610b64 in http_read_stream (h=h at entry=0x1d8dcc0,
 buf=buf at entry=0x1d97cb0 "\t", size=32768) at libavformat/http.c:1252
 #8  0x0000000000611051 in http_read (h=0x1d8dcc0, buf=0x1d97cb0 "\t",
 size=<optimized out>) at libavformat/http.c:1363
 #9  0x00000000005d8398 in retry_transfer_wrapper (transfer_func=0x611010
 <http_read>, size_min=1, size=32768, buf=0x1d97cb0 "\t", h=0x1d8dcc0) at
 libavformat/avio.c:326
 #10 ffurl_read (h=0x1d8dcc0, buf=0x1d97cb0 "\t", size=32768) at
 libavformat/avio.c:357
 #11 0x00000000005d9b50 in fill_buffer (s=0x1d8f7a0) at
 libavformat/aviobuf.c:481
 #12 0x00000000005d9cb5 in avio_r8 (s=0x1d8f7a0) at
 libavformat/aviobuf.c:533
 #13 0x00000000005f8272 in flv_read_packet (s=0x1d8d3a0,
 pkt=0x7fffffffe010) at libavformat/flvdec.c:857
 #14 0x00000000006de4cc in ff_read_packet (s=s at entry=0x1d8d3a0,
 pkt=pkt at entry=0x7fffffffe010) at libavformat/utils.c:681
 #15 0x00000000006dee24 in read_frame_internal (s=s at entry=0x1d8d3a0,
 pkt=pkt at entry=0x7fffffffe1b0) at libavformat/utils.c:1338
 #16 0x00000000006e09fe in avformat_find_stream_info (ic=0x1d8d3a0,
 options=0x1d8f6c0) at libavformat/utils.c:3270
 #17 0x00000000004d4bca in open_input_file (o=o at entry=0x7fffffffe490,
 filename=<optimized out>) at ffmpeg_opt.c:970
 #18 0x00000000004ce510 in open_files (inout=inout at entry=0x10fd106 "input",
 open_file=open_file at entry=0x4d45c0 <open_input_file>, l=<error reading
 variable: Unhandled dwarf expression opcode 0xfa>,
     l=<error reading variable: Unhandled dwarf expression opcode 0xfa>) at
 ffmpeg_opt.c:2939
 #19 0x00000000004d654c in ffmpeg_parse_options (argc=argc at entry=7,
 argv=argv at entry=0x7fffffffeaf8) at ffmpeg_opt.c:2976
 #20 0x00000000004c6d4b in main (argc=7, argv=0x7fffffffeaf8) at
 ffmpeg.c:4273
 }}}


 ffmpeg was just built. Its version is in console output.
 IP-camera is D-Link DSC-931L. The stream uri
 {{{http://admin:123890@91.202.204.9:89/h264.flv}}} is accessible from the
 internet for tests.

 The bug was not present in {{{ffmpeg N-73635-gfd4c87f}}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/5041>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list