Change codec of WAV file

3

1

Is there a way to change the codec/format of WAV file? Can I use ffmpegor anything else?

From

RIFF (little-endian) data, WAVE audio, Microsoft PCM, 8 bit, mono 8000 Hz

to

RIFF (little-endian) data, WAVE audio, ITU G.711 u-law, mono 8000 Hz

UPDATE

root]# ffmpeg -codecs
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-shared --disable-static --enable-amr_nb
libavutil version: 49.3.0
libavcodec version: 51.38.0
libavformat version: 51.10.0
built on Dec  7 2007 16:31:16, gcc: 3.2.3 20030502 (Red Hat Linux 3.2.3-24)
ffmpeg: missing argument for option '-codecs'

UPDATE2: And here is what happen when I try

root]#ffmpeg -i 110.wav -c:a pcm_mulaw new.wav
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-shared --disable-static --enable-amr_nb
libavutil version: 49.3.0
libavcodec version: 51.38.0
libavformat version: 51.10.0
built on Dec  7 2007 16:31:16, gcc: 3.2.3 20030502 (Red Hat Linux 3.2.3-24)
Input #0, wav, from '110.wav':
Duration: 00:00:06.8, start: 0.000000, bitrate: 64 kb/s
Stream #0.0: Audio: pcm_u8, 8000 Hz, mono, 64 kb/s
ffmpeg: unrecognized option '-c:a'

S.I.

Posted 2014-10-09T13:04:08.483

Reputation: 133

Dude, why is your version of ffmpeg from 2007? – MarcusJ – 2016-08-10T16:19:58.847

Answers

2

It's pretty simple:

ffmpeg -i input.wav -c:a pcm_mulaw output.wav

Check ffmpeg -codecs for a list of supported codecs. An E in the listing means encoding support.

slhck

Posted 2014-10-09T13:04:08.483

Reputation: 182 472

Hm.. it's seems that there is no codecs on the system. Please check my updated question. – S.I. – 2014-10-10T10:00:52.737

Well, you're running a version from 2007 (that's seven years old!), so head to http://ffmpeg.org/download.html and download a new static build.

– slhck – 2014-10-10T10:20:45.680

Yeah .. the linux distribution on this machine is also from the prehistoric but I can't 'refreshing' it at this time. I'll try to update ffmpeg at least and will let you know if it's work the conversion – S.I. – 2014-10-10T10:30:06.360

Ok, I've tried ot virtual box under Ubuntu. The output file is RIFF (little-endian) data, WAVE audio, ITU G.711 mu-law, mono 8000 Hz which is good OK but is there a differents between ITU G.711 mu-law and ITU G.711 u-law? What is this m in mu-law? – S.I. – 2014-10-10T11:24:16.503

Also I don't see codec just for u-law so is mu-law same as u-law? – S.I. – 2014-10-10T11:38:36.893

The Greek µ is also written as "mu", and if you only have ASCII, then you'd use a u, so it's the same :) – slhck – 2014-10-10T12:41:47.170