I'm trying to generate audio waveform from an mp4 file as described here: https://github.com/bbc/audiowaveform.
My mp4 file looks like
<?xml version="1.0" encoding="UTF-8"?>
http://www.w3.org/2001/XMLSchema-instance'>
<format filename="/cache/1268.mp4" nb_streams="4" nb_programs="0" format_name="mov,mp4,m4a,3gp,3g2,mj2" format_long_name="QuickTime / MOV" start_time="0.000000" duration="40.112000" size="10610125" bit_rate="2116099" probe_score="100">
<tag key="major_brand" value="isom"/>
<tag key="minor_version" value="512"/>
<tag key="compatible_brands" value="isomiso2avc1mp41"/>
<tag key="encoder" value="Lavf58.20.100"/>
</format>
I wrote this command line: /ffmpeg-4.1.1/ffmpeg -i /cache/1268.mp4 -map 0:1 -f wav - | /opt/audiowaveform/audiowaveform --input-format wav --pixels-per-second 25 -b 16
But it fails with the folliwing error: Could not write header for output file #0 (incorrect codec parameters ?): Broken pipe Error initializing output stream 0:0 -- Conversion failed!
Complete log is:
ffmpeg version 4.2.2-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Error: unrecognised option '--input-format'
See '/opt/audiowaveform/audiowaveform --help' for available options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/cache/1268.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
title : Big Buck Bunny - test 8
encoder : Lavf57.72.101
comment : Matroska Validation File 8, secondary audio commentary track, misc subtitle tracks
Duration: 00:00:46.07, start: 0.000000, bitrate: 2111 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1024x576 [SAR 1:1 DAR 16:9], 1908 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream #0:2(eng): Audio: aac (LC) (mp4a / 0x6134706D), 22050 Hz, mono, fltp, 67 kb/s
Metadata:
handler_name : SoundHandler
Stream mapping:
Stream #0:1 -> #0:0 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Could not write header for output file #0 (incorrect codec parameters ?): Broken pipe
Error initializing output stream 0:0 --
Conversion failed!
Can anyone help me?
Note: I read the answer here ffmpeg Could not write header for output file #0 but I need to preserve audio codec.