Search code examples
raspberry-pivlcaudio-streaminglibvlc

VLC: How to stream a wave via HTTP


I want to stream from my rapsberry the microphone via HTTP with VLC.

This command works fine:

vlc -vvv alsa://hw:1,0 --sout '#transcode{vcodec=none,acodec=mpga,ab=128,channels=2,samplerate=44100}:standard{access=http,mux=mp3,dst=192.168.178.30:8080}'

But when changing the code to s16l and mux to wav I can't hear anything in the VLC.

This is the command I've tried:

vlc -vvv alsa://hw:1,0 --sout '#transcode{vcodec=none,acodec=s16l,channels=1,samplerate=16000,scodec=none}:standard{access=http,mux=wav,dst=192.168.178.30:8080}' 

Bu the same codec using RTP works:

vlc -vvv alsa://hw:1,0 --sout '#transcode{vcodec=none,acodec=s16l,channels=1,samplerate=16000,scodec=none}:rtp{dst=192.168.178.30,port=1234,sdp=rtsp://192.168.178.30:8080/test.sdp}'

Some logs: https://gist.github.com/timaschew/9e7e027cd1b371b01b0f186f23b47068


Solution

  • Not all codecs can be muxed, check VLC documentation.

    Currently PCM(wave) can be muxed only in RTP.

    mux is the encapsulation method required for streaming. wav in VLC is a container intended for storing.