VLC can't reproduce mono G.711 (pcm mulaw)
Posted: 10 Mar 2015 13:48
Hello,
VLC is a superb tool, however, it seems to fail in quite a simple and elementary task in the context of pcm mu-law audio..!
I want to reproduce pcm mu-law (aka "G.711") mono sample. Such audio sample is sampled at 8KHz, with one byte per sample.
For comparison, "avplay" (i.e. "ffplay") works like a charm, with the following command:
avplay -nodisp -f mulaw -ar 8k -ac 1 FILENAME
Where file FILENAME contains a *mono* mulaw sample.
Giving the following command with VLC, produces nasty cracking and popping and no audible sound at all:
vlc -vvv --codec ulaw --demux rawaud,none --rawaud-samplerate 8000 --rawaud-channels 1 FILENAME
Looking at the output, I find the following line:
"rawaud demux debug: format initialized: channels=1 , samplerate=8000 Hz, fourcc=s16l, bits per sample = 16, bitrate = 128000 bit/s"
Pcm u-law mono is, by definition, 8 bits per sample (64000 bits/s). There is no way to convince VLC to get 8 bits per sample, as it insists in "s16l"..!
Slightly different kind of useless noise is reproduced by:
vlc -vvv --demux avformat,none --avformat-format mulaw --avformat-options "{ar=8000,ac=1}" FILENAME
Question: Any ideas how to fix this? Should I file a bug report?
Bonus Question: Once the previous problem has been addressed, is there any way to avoid using VLC's broken libsamplerate dependency and the "ugly" (indeed) resampler? If I have understood correctly, mulaw can be fed directly to the ALSA sound system (with no need for resampling by VLC).
Kind Regards,
Sampsa
P. S. A follow-up. Even more stranger behaviour. I tried:
vlc -vvv --demux rawaud,none --rawaud-samplerate 8000 --rawaud-channels 1 --rawaud-fourcc 'ulaw'
gives in the output:
"rawaud demux error: unknown fourcc format mlaw"
i.e., I have used the string 'ulaw' for the fourcc, but VLC changes this to 'mlaw' and tells me it's not available..!
VLC is a superb tool, however, it seems to fail in quite a simple and elementary task in the context of pcm mu-law audio..!
I want to reproduce pcm mu-law (aka "G.711") mono sample. Such audio sample is sampled at 8KHz, with one byte per sample.
For comparison, "avplay" (i.e. "ffplay") works like a charm, with the following command:
avplay -nodisp -f mulaw -ar 8k -ac 1 FILENAME
Where file FILENAME contains a *mono* mulaw sample.
Giving the following command with VLC, produces nasty cracking and popping and no audible sound at all:
vlc -vvv --codec ulaw --demux rawaud,none --rawaud-samplerate 8000 --rawaud-channels 1 FILENAME
Looking at the output, I find the following line:
"rawaud demux debug: format initialized: channels=1 , samplerate=8000 Hz, fourcc=s16l, bits per sample = 16, bitrate = 128000 bit/s"
Pcm u-law mono is, by definition, 8 bits per sample (64000 bits/s). There is no way to convince VLC to get 8 bits per sample, as it insists in "s16l"..!
Slightly different kind of useless noise is reproduced by:
vlc -vvv --demux avformat,none --avformat-format mulaw --avformat-options "{ar=8000,ac=1}" FILENAME
Question: Any ideas how to fix this? Should I file a bug report?
Bonus Question: Once the previous problem has been addressed, is there any way to avoid using VLC's broken libsamplerate dependency and the "ugly" (indeed) resampler? If I have understood correctly, mulaw can be fed directly to the ALSA sound system (with no need for resampling by VLC).
Kind Regards,
Sampsa
P. S. A follow-up. Even more stranger behaviour. I tried:
vlc -vvv --demux rawaud,none --rawaud-samplerate 8000 --rawaud-channels 1 --rawaud-fourcc 'ulaw'
gives in the output:
"rawaud demux error: unknown fourcc format mlaw"
i.e., I have used the string 'ulaw' for the fourcc, but VLC changes this to 'mlaw' and tells me it's not available..!