Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#5041 closed defect (worksforme)

ffmpeg hangs up during analyzing flv stream

Reported by: maxvgi Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: http flv
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

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@entry=0x7fffffffdb00, nfds=nfds@entry=1, timeout=<optimized out>, timeout@entry=100) at ../sysdeps/unix/sysv/linux/poll.c:83
#1  0x000000000067d15c in ff_network_wait_fd (fd=fd@entry=8, write=write@entry=0) at libavformat/network.c:78
#2  0x000000000067d1ba in ff_network_wait_fd_timeout (fd=8, write=write@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@entry=0x1d97cb0 "\t", size=32768) at libavformat/avio.c:357
#6  0x000000000060d9ae in http_buf_read (h=h@entry=0x1d8dcc0, buf=buf@entry=0x1d97cb0 "\t", size=size@entry=32768) at libavformat/http.c:1162
#7  0x0000000000610b64 in http_read_stream (h=h@entry=0x1d8dcc0, buf=buf@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@entry=0x1d8d3a0, pkt=pkt@entry=0x7fffffffe010) at libavformat/utils.c:681
#15 0x00000000006dee24 in read_frame_internal (s=s@entry=0x1d8d3a0, pkt=pkt@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@entry=0x7fffffffe490, filename=<optimized out>) at ffmpeg_opt.c:970
#18 0x00000000004ce510 in open_files (inout=inout@entry=0x10fd106 "input", open_file=open_file@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@entry=7, argv=argv@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

Change History (10)

comment:1 follow-up: Changed 3 years ago by Cigaes

Does this happen if you remove -an?

comment:2 Changed 3 years ago by cehoyos

  • Keywords hang max_analyze_duration removed
  • Resolution set to worksforme
  • Status changed from new to closed

I get the same behaviour and console output with current and older FFmpeg (2.7):

$ ffplay http://admin:123890@91.202.204.9:89/h264.flv
ffplay version N-76851-ga330430 Copyright (c) 2003-2015 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  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
[flv @ 0x7f3680000920] Could not find codec parameters for stream 1 (Audio: none, 0 channels, 176 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, flv, from 'http://admin:123890@91.202.204.9:89/h264.flv':
  Duration: N/A, start: 0.000000, bitrate: 176 kb/s
    Stream #0:0: Video: h264 (Baseline), yuv420p, 640x480, 0 kb/s, 30.30 fps, 30 tbr, 1k tbn, 60 tbc
    Stream #0:1: Audio: none, 0 channels, 176 kb/s
  56.63 M-V:  0.000 fd=   0 aq=    0KB vq=   59KB sq=    0B f=0/0

If you don't want to wait, you can use -analyzeduration 1 -probesize 1000 or similar.

Afaict, no audio packets are transmitted.

comment:3 in reply to: ↑ 1 ; follow-ups: Changed 3 years ago by maxvgi

Replying to Cigaes:

Does this happen if you remove -an?

Yes, then it works. But what shall I do if I don't know beforehand if there will be audio stream packets or no?

The option -an works correct with all my streams except this one. Some time ago it worked with all streams without exception.

Can I save just video stream, ignoring audio data?
-analyzeduration 1 -probesize 1000 -an does not help.

Last edited 3 years ago by maxvgi (previous) (diff)

comment:4 in reply to: ↑ 3 ; follow-up: Changed 3 years ago by cehoyos

Replying to maxvgi:

-analyzeduration 1 -probesize 1000 -an does not help.

Command line and complete, uncut console output missing.

comment:5 in reply to: ↑ 4 Changed 3 years ago by maxvgi

Replying to cehoyos:

Command line and complete, uncut console output missing.

They were in the first message of the ticket, the situation did not change in any way.

$ ffmpeg -i http://admin:123890@91.202.204.9:89/h264.flv -v 9 -loglevel 99 -probesize 1000 -analyzeduration 1 -vcodec copy -an 1.mp4
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 '-i' ... matched as input file with argument 'http://admin:123890@91.202.204.9:89/h264.flv'.
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 '-probesize' ... matched as AVOption 'probesize' with argument '1000'.
Reading option '-analyzeduration' ... matched as AVOption 'analyzeduration' with argument '1'.
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 @ 0x282adc0] 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 @ 0x282adc0] header='HTTP/1.0 401 Authorization Required'
[http @ 0x282adc0] http_code=401
[http @ 0x282adc0] header='Server: alphapd'
[http @ 0x282adc0] header='Date: Fri Nov 27 13:17:13 2015'
[http @ 0x282adc0] header='Pragma: no-cache'
[http @ 0x282adc0] header='Cache-Control: no-cache'
[http @ 0x282adc0] header='Content-type: text/html'
[http @ 0x282adc0] header='WWW-Authenticate: Basic realm="DCS-931L"'
[http @ 0x282adc0] header=''
[http @ 0x282adc0] 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 @ 0x282adc0] header='HTTP/1.0 200 OK'
[http @ 0x282adc0] http_code=200
[http @ 0x282adc0] header='Server: alphapd'
[http @ 0x282adc0] header='Date: Fri Nov 27 13:17:13 2015'
[http @ 0x282adc0] header='Pragma: no-cache'
[http @ 0x282adc0] header='Cache-Control: no-cache'
[http @ 0x282adc0] header='Content-type: video/x-flv'
[http @ 0x282adc0] header=''
Probing aac score:1 size:2048
Probing flv score:100 size:2048
Probing mp3 score:1 size:2048
[flv @ 0x282a480] Format flv probed with size=2048 and score=100
[flv @ 0x282a480] Before avformat_find_stream_info() pos: 13 bytes read:2575 seeks:0
[flv @ 0x282a480] type:18, size:268, last:-1, dts:0 pos:21
[flv @ 0x282a480] type:9, size:39, last:-1, dts:0 pos:304
[flv @ 0x282a480] 0 17 0 
[flv @ 0x282a480] type:9, size:11157, last:-1, dts:0 pos:358
[flv @ 0x282a480] 0 17 0 
[flv @ 0x282a480] type:9, size:725, last:-1, dts:33 pos:11530
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:1029, last:-1, dts:66 pos:12270
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:1013, last:-1, dts:100 pos:13314
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:1045, last:-1, dts:133 pos:14342
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:1125, last:-1, dts:166 pos:15402
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:1109, last:-1, dts:200 pos:16542
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:1157, last:-1, dts:233 pos:17666
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:1141, last:-1, dts:266 pos:18838
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:1157, last:-1, dts:300 pos:19994
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:11093, last:-1, dts:333 pos:21166
[flv @ 0x282a480] 0 17 0 
[flv @ 0x282a480] type:9, size:853, last:-1, dts:366 pos:32274
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:1061, last:-1, dts:400 pos:33142
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:997, last:-1, dts:433 pos:34218
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:1077, last:-1, dts:466 pos:35230
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:1141, last:-1, dts:500 pos:36322
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:1077, last:-1, dts:533 pos:37478
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:1157, last:-1, dts:566 pos:38570
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:1157, last:-1, dts:600 pos:39742
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:1189, last:-1, dts:633 pos:40914
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:11221, last:-1, dts:666 pos:42118
[flv @ 0x282a480] 0 17 0 
[flv @ 0x282a480] type:9, size:965, last:-1, dts:700 pos:53354
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:997, last:-1, dts:733 pos:54334
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:1045, last:-1, dts:766 pos:55346
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:1125, last:-1, dts:800 pos:56406
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:1077, last:-1, dts:833 pos:57546
[flv @ 0x282a480] 0 27 0 
[flv @ 0x282a480] type:9, size:1109, last:-1, dts:866 pos:58638
[flv @ 0x282a480] 0 27 0 
...

comment:6 follow-up: Changed 3 years ago by cehoyos

$ ffmpeg -i http://admin:123890@91.202.204.9:89/h264.flv -probesize 1000 -analyzeduration 1 -vcodec copy 1.mp4
ffmpeg version N-76858-g1e5dbb3 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  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
[flv @ 0x36c7460] Could not find codec parameters for stream 1 (Audio: none, 0 channels, 176 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, flv, from 'http://admin:123890@91.202.204.9:89/h264.flv':
  Duration: N/A, start: 0.000000, bitrate: 176 kb/s
    Stream #0:0: Video: h264 (Baseline), yuv420p, 640x480, 0 kb/s, 30.30 fps, 30 tbr, 1k tbn, 60 tbc
    Stream #0:1: Audio: none, 0 channels, 176 kb/s
[mp4 @ 0x3dd6580] Codec for stream 0 does not use global headers but container format requires global headers
Output #0, mp4, to '1.mp4':
  Metadata:
    encoder         : Lavf57.19.100
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 640x480, q=2-31, 0 kb/s, 30.30 fps, 30 tbr, 16k tbn, 1k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 2621 fps=157 q=-1.0 Lsize=    5423kB time=00:01:27.33 bitrate= 508.7kbits/s
video:5397kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.477501%

comment:7 in reply to: ↑ 6 ; follow-up: Changed 3 years ago by maxvgi

Replying to cehoyos:

$ ffmpeg -i http://admin:123890@91.202.204.9:89/h264.flv -probesize 1000 -analyzeduration 1 -vcodec copy 1.mp4

Yes, I got that it works if you ommit option -an.

But I have several dozens of different multimedia sources. Some of them have audio stream inside, others do not.

Is there any possibility to save just VIDEO stream from each of them using the same command line for them all, or it is nessessary to check several argument sets for ffmpeg each time multimedia source is created?

In the ffmpeg N-73635-gfd4c87f I used the following command line:

$ ffmpeg -i <URI> -vcodec copy -an 1.mp4

And all video streams were muxed to mp4, audio streams were ignored.

Then I tried to update ffmpeg to N-76851-ga330430. Everything works fine, but the only one stream http://admin:123890@91.202.204.9:89/h264.flv hangs up if the option -an is present in command line.

As you understand, I cannot ommit the option -an from this command line because I need to save only video from all other sources. (Furthermore, I cannot save some audio codecs to mp4 and have not enough CPU to transcode). Yes, it is possible to make several attempts to download each stream using with different command lines, but it is rather difficult to realize.

Is that a bug or feature? And the behaviour of which version of ffmpeg is correct?
Should I continue using old N-73635-gfd4c87f or ask you to fix the problem in the current version?

comment:8 in reply to: ↑ 3 ; follow-up: Changed 3 years ago by Cigaes

Replying to maxvgi:

Yes, then it works.


Then this is a known bug, there is already a fix on the mailing list and people bikeshedding it.

But what shall I do if I don't know beforehand if there will be audio stream packets or no?


I do not know, you did not explain why you put -an in the first place.

The option -an works correct with all my streams except this one. Some time ago it worked with all streams without exception.


Yes, this is a recent regression on the FLV demuxer.

comment:9 in reply to: ↑ 8 Changed 3 years ago by maxvgi

Replying to Cigaes:

Then this is a known bug, there is already a fix on the mailing list and people bikeshedding it.
Yes, this is a recent regression on the FLV demuxer.

Thank you very much!

comment:10 in reply to: ↑ 7 Changed 3 years ago by cehoyos

Replying to maxvgi:

Replying to cehoyos:

$ ffmpeg -i http://admin:123890@91.202.204.9:89/h264.flv -probesize 1000 -analyzeduration 1 -vcodec copy 1.mp4

Yes, I got that it works if you ommit option -an.

$ ffmpeg -i http://admin:123890@91.202.204.9:89/h264.flv -probesize 1000 -analyzeduration 1 -vcodec copy -an 1.mp4
ffmpeg version N-76858-g1e5dbb3 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --enable-libvpx
  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
[flv @ 0x2f5c480] Could not find codec parameters for stream 1 (Audio: none, 0 channels, 176 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, flv, from 'http://admin:123890@91.202.204.9:89/h264.flv':
  Duration: N/A, start: 0.000000, bitrate: 176 kb/s
    Stream #0:0: Video: h264 (Baseline), yuv420p, 640x480, 0 kb/s, 30.30 fps, 30 tbr, 1k tbn, 60 tbc
    Stream #0:1: Audio: none, 0 channels, 176 kb/s
[mp4 @ 0x3053000] Codec for stream 0 does not use global headers but container format requires global headers
Output #0, mp4, to '1.mp4':
  Metadata:
    encoder         : Lavf57.19.100
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 640x480, q=2-31, 0 kb/s, 30.30 fps, 30 tbr, 16k tbn, 1k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 4291 fps= 33 q=-1.0 Lsize=    9082kB time=00:02:23.00 bitrate= 520.3kbits/s
video:9040kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.461116%
Note: See TracTickets for help on using tickets.