VLC can't reproduce mono G.711 (pcm mulaw)

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
sampsa
Blank Cone
Blank Cone
Posts: 42
Joined: 16 Dec 2014 13:54

VLC can't reproduce mono G.711 (pcm mulaw)

Postby sampsa » 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..!

Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: VLC can't reproduce mono G.711 (pcm mulaw)

Postby Rémi Denis-Courmont » 10 Mar 2015 14:26

I have no problems playing G.711, either law. Just use a proper file format; WAV is probably the simplest here. And no, the raw audio demuxer does not support G.711 so far, only raw (linear PCM) audio.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

sampsa
Blank Cone
Blank Cone
Posts: 42
Joined: 16 Dec 2014 13:54

Re: VLC can't reproduce mono G.711 (pcm mulaw)

Postby sampsa » 10 Mar 2015 14:30

Thanks Remi,

However.. I asked this question because finally, I would like to read raw, mono G.711 from a udp port.

So I guess that's not possible then..

Regards,

Sampsa

Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: VLC can't reproduce mono G.711 (pcm mulaw)

Postby Rémi Denis-Courmont » 10 Mar 2015 17:18

Of course it is possible - with RTP.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 31 guests