Opened 22 months ago

Closed 22 months ago

Last modified 22 months ago

#5965 closed defect (invalid)

Stretching wav file with Rubberband generates invalid audio format

Reported by: michael.heuberger Owned by:
Priority: minor Component: undetermined
Version: unspecified Keywords:
Cc: michael.heuberger@binarykitchen.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
When I run the ffmpeg command below to stretch a WAV file and then parse it with another tool to calculate its duration (see https://github.com/rackfx/Node-WAV-File-Info/issues/11) it says the audio format is invalid.

How to reproduce:

% ffmpeg -thread_queue_size 2048 -i /home/michael-heuberger/binarykitchen/code/videomail.io/var/local/tmp/clients/videomail.io/11e6-aebd-f5430180-84c7-074d5706928b/videomail_preview.wav -y -acodec libvorbis -ac 1 -filter:a rubberband=tempo=1.454366279637038 -loglevel warning /home/michael-heuberger/binarykitchen/code/videomail.io/var/local/tmp/clients/videomail.io/11e6-aebd-f5430180-84c7-074d5706928b/videomail_preview_for_webm_stretched.wav

ffmpeg version

ffmpeg version 3.0.2-1ubuntu3 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 6.1.1 (Ubuntu 6.1.1-11ubuntu12) 20160805
  configuration: --prefix=/usr --extra-version=1ubuntu3 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-chromaprint --enable-libx264
  libavutil      55. 17.103 / 55. 17.103
  libavcodec     57. 24.102 / 57. 24.102
  libavformat    57. 25.100 / 57. 25.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 31.100 /  6. 31.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Hyper fast Audio and Video encoder

Change History (7)

comment:1 Changed 22 months ago by michael.heuberger

  • Cc michael.heuberger@binarykitchen.com added

comment:2 Changed 22 months ago by michael.heuberger

and for reference, here the full ffmpeg output in debug mode

built with gcc 6.1.1 (Ubuntu 6.1.1-11ubuntu12) 20160805
configuration: --prefix=/usr --extra-version=1ubuntu3 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-chromaprint --enable-libx264
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libavresample 3. 0. 0 / 3. 0. 0
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 '-thread_queue_size' ... matched as option 'thread_queue_size' (set the maximum number of queued packets from the demuxer) with argument '2048'.
Reading option '-i' ... matched as input file with argument '/home/michael-heuberger/binarykitchen/code/videomail.io/var/local/tmp/clients/videomail.io/11e6-aebf-b232a970-9f2a-a75d3836b2e7/videomail_preview.wav'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'libvorbis'.
Reading option '-ac' ... matched as option 'ac' (set number of audio channels) with argument '1'.
Reading option '-filter:a' ... matched as option 'filter' (set stream filtergraph) with argument 'rubberband=tempo=1.239223338862328'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '/home/michael-heuberger/binarykitchen/code/videomail.io/var/local/tmp/clients/videomail.io/11e6-aebf-b232a970-9f2a-a75d3836b2e7/videomail_preview_for_webm_stretched.wav' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option y (overwrite output files) 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 /home/michael-heuberger/binarykitchen/code/videomail.io/var/local/tmp/clients/videomail.io/11e6-aebf-b232a970-9f2a-a75d3836b2e7/videomail_preview.wav.
Applying option thread_queue_size (set the maximum number of queued packets from the demuxer) with argument 2048.
Successfully parsed a group of options.
Opening an input file: /home/michael-heuberger/binarykitchen/code/videomail.io/var/local/tmp/clients/videomail.io/11e6-aebf-b232a970-9f2a-a75d3836b2e7/videomail_preview.wav.
[file @ 0x56386702e0e0] Setting default whitelist 'file,crypto'
[wav @ 0x56386702d880] Format wav probed with size=2048 and score=99
[wav @ 0x56386702d880] Before avformat_find_stream_info() pos: 44 bytes read:32768 seeks:0
[wav @ 0x56386702d880] probing stream 0 pp:32
[wav @ 0x56386702d880] probing stream 0 pp:31
[wav @ 0x56386702d880] probing stream 0 pp:30
[wav @ 0x56386702d880] probing stream 0 pp:29
[wav @ 0x56386702d880] probing stream 0 pp:28
[wav @ 0x56386702d880] probing stream 0 pp:27
[wav @ 0x56386702d880] probing stream 0 pp:26
[wav @ 0x56386702d880] probing stream 0 pp:25
[wav @ 0x56386702d880] probing stream 0 pp:24
[wav @ 0x56386702d880] probing stream 0 pp:23
[wav @ 0x56386702d880] probing stream 0 pp:22
[wav @ 0x56386702d880] probed stream 0
[wav @ 0x56386702d880] parser not found for codec pcm_s16le, packets or times may be invalid.
[wav @ 0x56386702d880] After avformat_find_stream_info() pos: 41004 bytes read:41004 seeks:0 frames:10
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, wav, from '/home/michael-heuberger/binarykitchen/code/videomail.io/var/local/tmp/clients/videomail.io/11e6-aebf-b232a970-9f2a-a75d3836b2e7/videomail_preview.wav':

Duration: 00:00:00.46, bitrate: 706 kb/s

Stream #0:0, 10, 1/44100: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 1 channels, s16, 705 kb/s

Successfully opened the file.
Parsing a group of options: output file /home/michael-heuberger/binarykitchen/code/videomail.io/var/local/tmp/clients/videomail.io/11e6-aebf-b232a970-9f2a-a75d3836b2e7/videomail_preview_for_webm_stretched.wav.
Applying option acodec (force audio codec ('copy' to copy stream)) with argument libvorbis.
Applying option ac (set number of audio channels) with argument 1.
Applying option filter:a (set stream filtergraph) with argument rubberband=tempo=1.239223338862328.
Successfully parsed a group of options.
Opening an output file: /home/michael-heuberger/binarykitchen/code/videomail.io/var/local/tmp/clients/videomail.io/11e6-aebf-b232a970-9f2a-a75d3836b2e7/videomail_preview_for_webm_stretched.wav.
[file @ 0x5638670439a0] Setting default whitelist 'file,crypto'
Successfully opened the file.
detected 8 logical cores
[Parsed_rubberband_0 @ 0x56386704ddc0] Setting 'tempo' to value '1.239223338862328'
[graph 0 input from stream 0:0 @ 0x563867033bc0] Setting 'time_base' to value '1/44100'
[graph 0 input from stream 0:0 @ 0x563867033bc0] Setting 'sample_rate' to value '44100'
[graph 0 input from stream 0:0 @ 0x563867033bc0] Setting 'sample_fmt' to value 's16'
[graph 0 input from stream 0:0 @ 0x563867033bc0] Setting 'channel_layout' to value '0x4'
[graph 0 input from stream 0:0 @ 0x563867033bc0] tb:1/44100 samplefmt:s16 samplerate:44100 chlayout:0x4
[audio format for output stream 0:0 @ 0x56386704e4c0] Setting 'sample_fmts' to value 'fltp'
[audio format for output stream 0:0 @ 0x56386704e4c0] Setting 'channel_layouts' to value '0x4'
[Parsed_rubberband_0 @ 0x56386704ddc0] auto-inserting filter 'auto-inserted resampler 0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_rubberband_0'
[AVFilterGraph @ 0x5638670437c0] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
[auto-inserted resampler 0 @ 0x56386704fb60] [SWR @ 0x56386704ff40] Using s16p internally between filters
[auto-inserted resampler 0 @ 0x56386704fb60] ch:1 chl:mono fmt:s16 r:44100Hz -> ch:1 chl:mono fmt:fltp r:44100Hz
Output #0, wav, to '/home/michael-heuberger/binarykitchen/code/videomail.io/var/local/tmp/clients/videomail.io/11e6-aebf-b232a970-9f2a-a75d3836b2e7/videomail_preview_for_webm_stretched.wav':

Metadata:

ISFT : Lavf57.25.100
Stream #0:0, 0, 1/44100: Audio: vorbis (libvorbis) (oV[0][0] / 0x566F), 44100 Hz, mono, fltp
Metadata:

encoder : Lavc57.24.102 libvorbis

Stream mapping:

Stream #0:0 -> #0:0 (pcm_s16le (native) -> vorbis (libvorbis))

Press [q] to stop, ? for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)

Last message repeated 2 times

[Parsed_rubberband_0 @ 0x56386704ddc0] nb_samples_in 20480 nb_samples_out 13788
[output stream 0:0 @ 0x56386704e260] EOF on sink link output stream 0:0:default.
No more output streams to write to, finishing.
[libvorbis @ 0x563867043100] Trying to remove 100 more samples than there are in the queue
size= 6kB time=00:00:00.29 bitrate= 161.0kbits/s speed=9.96x
video:0kB audio:2kB subtitle:0kB other streams:0kB global headers:3kB muxing overhead: 136.203445%
Input file #0 (/home/michael-heuberger/binarykitchen/code/videomail.io/var/local/tmp/clients/videomail.io/11e6-aebf-b232a970-9f2a-a75d3836b2e7/videomail_preview.wav):

Input stream #0:0 (audio): 10 packets read (40960 bytes); 10 frames decoded (20480 samples);
Total: 10 packets (40960 bytes) demuxed

Output file #0 (/home/michael-heuberger/binarykitchen/code/videomail.io/var/local/tmp/clients/videomail.io/11e6-aebf-b232a970-9f2a-a75d3836b2e7/videomail_preview_for_webm_stretched.wav):

Output stream #0:0 (audio): 216 frames encoded (13788 samples); 15 packets muxed (2497 bytes);
Total: 15 packets (2497 bytes) muxed

10 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x56386702e640] Statistics: 6 seeks, 20 writeouts
[AVIOContext @ 0x563867036360] Statistics: 41004 bytes read, 0 seeks

comment:3 Changed 22 months ago by llogan

  • Resolution set to invalid
  • Status changed from new to closed

Isn't this an issue with the tool you referred to rather than ffmpeg? Vorbis in WAV? I doubt whatever tool you referred to can handle that. If you want Vorbis use .oga. If you want WAV then remove -c:a libvorbis.

comment:4 Changed 22 months ago by michael.heuberger

ah of course, silly me, thanks!

comment:5 Changed 22 months ago by llogan

For future reference please:

  • Omit -loglevel debug unless it is requested.
  • Always test the most minimal command that still shows this issue (no filtering and extraneous options).
  • Attempt to reproduce issue with a native encoder if possible (no encoder named lib*).
  • Test with a build from the current git master branch if you can.
  • Format commands and outputs using the "code block" button.

These steps will make things easier to debug.

comment:6 Changed 22 months ago by michael.heuberger

noted, thanks

comment:7 Changed 22 months ago by cehoyos

  • Keywords wav rubberband removed
Note: See TracTickets for help on using tickets.