[FFmpeg-trac] #7002(avformat:new): reading wav file from a pipe does not obey the probesize setting

FFmpeg trac at avcodec.org
Mon Feb 5 16:32:03 EET 2018


#7002: reading wav file from a pipe does not obey the probesize setting
-------------------------------------+------------------------------------
             Reporter:  akantor      |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:  avformat
              Version:  unspecified  |               Resolution:
             Keywords:  wav          |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+------------------------------------

Comment (by akantor):

 Hi,

 I confirm the same behavior in the current git head (see the headers of
 the logs below).


 ----------

 Using mp3 codec in .wav container still seems to give a large delay before
 probe finishes, but less of one than for pcm_s16le.  mulaw codec in .wav
 container gives the same delay when measured in bytes (and twice as long
 when measured in audio duration).
 {{{
 $ file mp3InWav.wav mulawInWav.wav
 mp3InWav.wav:   RIFF (little-endian) data, WAVE audio, MPEG Layer 3,
 stereo 16000 Hz
 mulawInWav.wav: RIFF (little-endian) data, WAVE audio, ITU G.711 mu-law,
 stereo 16000 Hz



 (pv -f  -c -L 3200 mp3InWav.wav | ~/ffmpeg_sources/ffmpeg/ffmpeg -v 9
 -loglevel 99 -i -  -analyzeduration 200 -probesize 200
 countToTwelve.flac) |& tr '\r' '\n'
 ffmpeg version N-89955-g118e1b0 Copyright (c) 2000-2018 the FFmpeg
 developers
   built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.6) 20160609
   configuration: --prefix=/home/akantor/ffmpeg_build --pkg-config-
 flags=--static --extra-cflags=-I/home/akantor/ffmpeg_build/include
 --extra-ldflags=-L/home/akantor/ffmpeg_build/lib --extra-libs='-lpthread
 -lm' --bindir=/home/akantor/bin --enable-gpl --enable-libass --enable-
 libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-nonfree
   libavutil      56.  7.100 / 56.  7.100
   libavcodec     58.  9.100 / 58.  9.100
   libavformat    58.  7.100 / 58.  7.100
   libavdevice    58.  0.101 / 58.  0.101
   libavfilter     7. 11.101 /  7. 11.101
   libswscale      5.  0.101 /  5.  0.101
   libswresample   3.  0.101 /  3.  0.101
   libpostproc    55.  0.100 / 55.  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 url with argument '-'.
 Reading option '-analyzeduration' ... matched as AVOption
 'analyzeduration' with argument '200'.
 Reading option '-probesize' ... matched as AVOption 'probesize' with
 argument '200'.
 Reading option 'countToTwelve.flac' ... matched as output url.
 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 url -.
 Successfully parsed a group of options.
 Opening an input file: -.
 [NULL @ 0x253cb00] Opening 'pipe:' for reading
 [pipe @ 0x253d400] Setting default whitelist 'crypto'
 Probing mp3 score:25 size:2048
 Probing wav score:99 size:2048
 [wav @ 0x253cb00] Format wav probed with size=2048 and score=99
 [wav @ 0x253cb00] Before avformat_find_stream_info() pos: 104 bytes
 read:2240 seeks:0 nb_streams:1
 3.12KiB 0:00:01 [2.88KiB/s] [>                                 ]  4% ETA
 0:00:19
 6.25KiB 0:00:02 [3.14KiB/s] [==>                               ]  9% ETA
 0:00:18
 9.38KiB 0:00:03 [3.14KiB/s] [===>                              ] 14% ETA
 0:00:17
 [wav @ 0x253cb00] All info found
 [wav @ 0x253cb00] stream 0: start_time: -576460752303423.500 duration:
 10.952
 [wav @ 0x253cb00] format: start_time: -9223372036854.775 duration: 10.952
 bitrate=0 kb/s
 [wav @ 0x253cb00] After avformat_find_stream_info() pos: 12200 bytes
 read:12480 seeks:0 frames:50
 Input #0, wav, from 'pipe:':
   Metadata:
     encoder         : Lavf58.7.100
   Duration: 00:00:10.95, bitrate: N/A
     Stream #0:0, 50, 1/16000: Audio: mp3 (U[0][0][0] / 0x0055), 16000 Hz,
 stereo, s16p, 48 kb/s
 Successfully opened the file.
 Parsing a group of options: output url countToTwelve.flac.
 Successfully parsed a group of options.
 Opening an output file: countToTwelve.flac.
 [file @ 0x2546700] Setting default whitelist 'file,crypto'
 Successfully opened the file.
 Stream mapping:
   Stream #0:0 -> #0:0 (mp3 (native) -> flac (native))
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)

 .....



 (pv -f  -c -L 16000 mulawInWav.wav | ~/ffmpeg_sources/ffmpeg/ffmpeg -v 9
 -loglevel 99 -i -  -analyzeduration 200 -probesize 200
 countToTwelve.flac) |& tr '\r' '\n'
 ffmpeg version N-89955-g118e1b0 Copyright (c) 2000-2018 the FFmpeg
 developers
   built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.6) 20160609
   configuration: --prefix=/home/akantor/ffmpeg_build --pkg-config-
 flags=--static --extra-cflags=-I/home/akantor/ffmpeg_build/include
 --extra-ldflags=-L/home/akantor/ffmpeg_build/lib --extra-libs='-lpthread
 -lm' --bindir=/home/akantor/bin --enable-gpl --enable-libass --enable-
 libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-nonfree
   libavutil      56.  7.100 / 56.  7.100
   libavcodec     58.  9.100 / 58.  9.100
   libavformat    58.  7.100 / 58.  7.100
   libavdevice    58.  0.101 / 58.  0.101
   libavfilter     7. 11.101 /  7. 11.101
   libswscale      5.  0.101 /  5.  0.101
   libswresample   3.  0.101 /  3.  0.101
   libpostproc    55.  0.100 / 55.  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 url with argument '-'.
 Reading option '-analyzeduration' ... matched as AVOption
 'analyzeduration' with argument '200'.
 Reading option '-probesize' ... matched as AVOption 'probesize' with
 argument '200'.
 Reading option 'countToTwelve.flac' ... matched as output url.
 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 url -.
 Successfully parsed a group of options.
 Opening an input file: -.
 [NULL @ 0x229ab00] Opening 'pipe:' for reading
 [pipe @ 0x229b400] Setting default whitelist 'crypto'
 Probing mp3 score:1 size:2048
 Probing wav score:99 size:2048
 [wav @ 0x229ab00] Format wav probed with size=2048 and score=99
 [wav @ 0x229ab00] Before avformat_find_stream_info() pos: 92 bytes
 read:3200 seeks:0 nb_streams:1
 [wav @ 0x229ab00] parser not found for codec pcm_mulaw, packets or times
 may be invalid.
 15.6KiB 0:00:01 [14.4KiB/s] [>                                 ]  4% ETA
 0:00:20
 31.2KiB 0:00:02 [15.7KiB/s] [==>                               ]  9% ETA
 0:00:19
 46.9KiB 0:00:03 [15.7KiB/s] [===>                              ] 13% ETA
 0:00:18
 62.5KiB 0:00:04 [15.7KiB/s] [=====>                            ] 18% ETA
 0:00:17
 78.1KiB 0:00:05 [15.7KiB/s] [======>                           ] 22% ETA
 0:00:16
 93.8KiB 0:00:06 [15.7KiB/s] [========>                         ] 27% ETA
 0:00:15
  109KiB 0:00:07 [15.7KiB/s] [=========>                        ] 31% ETA
 0:00:14
  125KiB 0:00:08 [15.7KiB/s] [===========>                      ] 36% ETA
 0:00:13
  140KiB 0:00:09 [15.7KiB/s] [============>                     ] 40% ETA
 0:00:12
  156KiB 0:00:10 [15.7KiB/s] [==============>                   ] 45% ETA
 0:00:11
  171KiB 0:00:11 [15.7KiB/s] [================>                 ] 50% ETA
 0:00:10
     Last message repeated 1 times
 [wav @ 0x229ab00] max_analyze_duration 5000000 reached at 5120000
 microseconds st:0
 [wav @ 0x229ab00] stream 0: start_time: -576460752303423.500 duration:
 10.980
 [wav @ 0x229ab00] format: start_time: -9223372036854.775 duration: 10.980
 bitrate=0 kb/s
 [wav @ 0x229ab00] After avformat_find_stream_info() pos: 176220 bytes
 read:177600 seeks:0 frames:42
 Guessed Channel Layout for Input Stream #0.0 : stereo
 Input #0, wav, from 'pipe:':
   Metadata:
     encoder         : Lavf58.7.100
   Duration: 00:00:10.98, bitrate: N/A
     Stream #0:0, 42, 1/16000: Audio: pcm_mulaw ([7][0][0][0] / 0x0007),
 16000 Hz, stereo, s16, 256 kb/s
 Successfully opened the file.
 Parsing a group of options: output url countToTwelve.flac.
 Successfully parsed a group of options.
 Opening an output file: countToTwelve.flac.
 [file @ 0x22d8e80] Setting default whitelist 'file,crypto'
 Successfully opened the file.
 Stream mapping:
   Stream #0:0 -> #0:0 (pcm_mulaw (native) -> flac (native))
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)


 }}}

 ----------

 The same behavior is there even with `--disable-demuxer=spdif` .
 {{{
 (pv -f  -c -L 32000 countToTwelve.wav | ./ffmpeg -v 9 -loglevel 99 -i -
 -analyzeduration 200 -probesize 200  countToTwelve.flac) |& tr '\r' '\n'
 ffmpeg version N-89955-g118e1b0 Copyright (c) 2000-2018 the FFmpeg
 developers
   built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.6) 20160609
   configuration: --prefix=/home/akantor/ffmpeg_build --pkg-config-
 flags=--static --extra-cflags=-I/home/akantor/ffmpeg_build/include
 --extra-ldflags=-L/home/akantor/ffmpeg_build/lib --extra-libs='-lpthread
 -lm' --bindir=/home/akantor/bin --enable-gpl --enable-libass --enable-
 libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus
 --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264
 --disable-demuxer=spdif --enable-nonfree
   libavutil      56.  7.100 / 56.  7.100
   libavcodec     58.  9.100 / 58.  9.100
   libavformat    58.  7.100 / 58.  7.100
   libavdevice    58.  0.101 / 58.  0.101
   libavfilter     7. 11.101 /  7. 11.101
   libswscale      5.  0.101 /  5.  0.101
   libswresample   3.  0.101 /  3.  0.101
   libpostproc    55.  0.100 / 55.  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 url with argument '-'.
 Reading option '-analyzeduration' ... matched as AVOption
 'analyzeduration' with argument '200'.
 Reading option '-probesize' ... matched as AVOption 'probesize' with
 argument '200'.
 Reading option 'countToTwelve.flac' ... matched as output url.
 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 url -.
 Successfully parsed a group of options.
 Opening an input file: -.
 [NULL @ 0x31d5b00] Opening 'pipe:' for reading
 [pipe @ 0x31d6400] Setting default whitelist 'crypto'
 Probing wav score:99 size:2048
 [wav @ 0x31d5b00] Format wav probed with size=2048 and score=99
 [wav @ 0x31d5b00] Before avformat_find_stream_info() pos: 44 bytes
 read:3200 seeks:0 nb_streams:1
 [wav @ 0x31d5b00] probing stream 0 pp:32
 [wav @ 0x31d5b00] probing stream 0 pp:31
 Probing mp3 score:1 size:8192
 [wav @ 0x31d5b00] Probe with size=8192, packets=2470 detected mp3 with
 score=1
 [wav @ 0x31d5b00] probing stream 0 pp:30
 [wav @ 0x31d5b00] probing stream 0 pp:29
 Probing mp3 score:1 size:16384
 [wav @ 0x31d5b00] Probe with size=16384, packets=2472 detected mp3 with
 score=1
 [wav @ 0x31d5b00] probing stream 0 pp:28
 [wav @ 0x31d5b00] probing stream 0 pp:27
 [wav @ 0x31d5b00] probing stream 0 pp:26
 31.2KiB 0:00:01 [28.8KiB/s] [>                                 ]  4% ETA
 0:00:20
 [wav @ 0x31d5b00] probing stream 0 pp:25
 [wav @ 0x31d5b00] probing stream 0 pp:24
 [wav @ 0x31d5b00] probing stream 0 pp:23
 [wav @ 0x31d5b00] probing stream 0 pp:22
 [wav @ 0x31d5b00] probing stream 0 pp:21
 [wav @ 0x31d5b00] probing stream 0 pp:20
 [wav @ 0x31d5b00] probing stream 0 pp:19
 [wav @ 0x31d5b00] probing stream 0 pp:18
 62.5KiB 0:00:02 [31.4KiB/s] [==>                               ]  9% ETA
 0:00:19
 [wav @ 0x31d5b00] probing stream 0 pp:17
 [wav @ 0x31d5b00] probing stream 0 pp:16
 [wav @ 0x31d5b00] probing stream 0 pp:15
 [wav @ 0x31d5b00] probing stream 0 pp:14
 [wav @ 0x31d5b00] probing stream 0 pp:13
 [wav @ 0x31d5b00] probing stream 0 pp:12
 [wav @ 0x31d5b00] probing stream 0 pp:11
 [wav @ 0x31d5b00] probing stream 0 pp:10
 93.8KiB 0:00:03 [31.4KiB/s] [===>                              ] 13% ETA
 0:00:18
 [wav @ 0x31d5b00] probing stream 0 pp:9
 [wav @ 0x31d5b00] probing stream 0 pp:8
 [wav @ 0x31d5b00] probing stream 0 pp:7
 [wav @ 0x31d5b00] probing stream 0 pp:6
 [wav @ 0x31d5b00] probing stream 0 pp:5
 [wav @ 0x31d5b00] probing stream 0 pp:4
 [wav @ 0x31d5b00] probing stream 0 pp:3
 [wav @ 0x31d5b00] probing stream 0 pp:2
  125KiB 0:00:04 [31.4KiB/s] [=====>                            ] 18% ETA
 0:00:17
 [wav @ 0x31d5b00] probing stream 0 pp:1
 [wav @ 0x31d5b00] probed stream 0
 [wav @ 0x31d5b00] parser not found for codec pcm_s16le, packets or times
 may be invalid.
  156KiB 0:00:05 [31.4KiB/s] [======>                           ] 22% ETA
 0:00:16
  187KiB 0:00:06 [31.4KiB/s] [========>                         ] 27% ETA
 0:00:15
 [wav @ 0x31d5b00] All info found
 [wav @ 0x31d5b00] stream 0: start_time: -576460752303423.500 duration:
 -576460752303423.500
 [wav @ 0x31d5b00] format: start_time: -9223372036854.775 duration:
 -9223372036854.775 bitrate=512 kb/s
 [wav @ 0x31d5b00] After avformat_find_stream_info() pos: 204844 bytes
 read:208000 seeks:0 frames:50
 Guessed Channel Layout for Input Stream #0.0 : stereo
 Input #0, wav, from 'pipe:':
   Duration: N/A, bitrate: 512 kb/s
     Stream #0:0, 50, 1/16000: Audio: pcm_s16le ([1][0][0][0] / 0x0001),
 16000 Hz, stereo, s16, 512 kb/s
 Successfully opened the file.
 Parsing a group of options: output url countToTwelve.flac.
 Successfully parsed a group of options.
 Opening an output file: countToTwelve.flac.
 [file @ 0x321ba40] Setting default whitelist 'file,crypto'
 Successfully opened the file.
 Stream mapping:
   Stream #0:0 -> #0:0 (pcm_s16le (native) -> flac (native))
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)


 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/7002#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list