I have some video files in .MOV format and I want to extract the audio from them to .WAV files. I cannot use MP3 files as I'm trying to feed the sound into a sonographic analysis program (WASP) that takes WAV files and only WAV files.
I'm sure I've done this before using mpg123, but I haven't done it for a while.
When I tried the command
mpg123 -w '2Jun2019 Dawn Chorus 1.wav' MVI_1145.MOV
I got this:
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
version 1.22.4; written and copyright by Michael Hipp and others
free software (LGPL) without any warranty but with best wishes
Playing MPEG stream 1 of 1: MVI_1145.MOV ...
MPEG 1.0 layer I, 11 kbit/s (free format), 44100 Hz stereo
[layer1.c:30] error: Illegal bit allocation value.
[layer1.c:171] error: Aborting layer I decoding after step one.
[layer1.c:30] error: Illegal bit allocation value.
[layer1.c:171] error: Aborting layer I decoding after step one.
[layer1.c:30] error: Illegal bit allocation value.
[layer1.c:171] error: Aborting layer I decoding after step one.
Note: Illegal Audio-MPEG-Header 0x00000000 at offset 1330.
Note: Trying to resync...
Note: Skipped 1024 bytes in input.
[parse.c:1249] error: Giving up resync after 1024 bytes - your stream is not nice... (maybe increasing resync limit could help).
[mpg123.c:695] error: ...in decoding next frame: Failed to find valid MPEG data within limit on resync. (code 28)
[0:00] Decoding of MVI_1145.MOV finished.
and a 6.2 kb file titled 2Jun2019 Dawn Chorus 1.wav
with nothing in it - when I tried to play it it came up in the player as 00 seconds long.
Please can somebody tell me what's the matter with the thing? Somebody in the chat suggested I should say what the encoding is, but I'm afraid I don't know the answer; it's not in Properties and I don't know how else to find out.
Edit: @Hermann asked what happened if I typed ffprobe MVI_1145.MOV
. Here's the result, as it's much too long to put in a comment.
ffprobe version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2007-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --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-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-libx264 --enable-libopencv
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'MVI_1145.MOV':
Metadata:
major_brand : qt
minor_version : 537331968
compatible_brands: qt CAEP
creation_time : 2019-06-02 02:56:02
Duration: 00:00:31.80, start: 0.000000, bitrate: 15023 kb/s
Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuvj420p(pc, bt709), 1280x720, 13140 kb/s, 25 fps, 25 tbr, 25k tbn, 50k tbc (default)
Metadata:
creation_time : 2019-06-02 02:56:02
Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
Metadata:
creation_time : 2019-06-02 02:56:02
lame -h -b 320 "file.wav" "file.mp3"
. Ffmpeg also has the capability to convert to other video formats, if that's what you want. Note that conversions can reduce the quality from source in certain cases.