Streaming command line arguments for v4l2 with webcam

About encoding, codec settings, muxers and filter usage
Papageno
New Cone
New Cone
Posts: 8
Joined: 02 Jan 2010 16:00

Streaming command line arguments for v4l2 with webcam

Postby Papageno » 02 Jan 2010 23:50

Hi,
I am a little bit (more than) confused about the syntax for command line with linux. Can someone clear this, please.
In some postings, manuals and wiki entries there is for audio access mentioned:

Code: Select all

input-slave=alsa// or v4l2-adev=alsa:// with follow up by /\"hw:x,y\" or /dev/dspx
How can I detect which device my webcam-microphone (or others) is? I know only play -l as infopoint. I am using Ubuntu 9.10. And what is the correct syntax?

Thanks for any reply

Hans

P.S If anyone is interested in. I use the follwing scripts to send and receive in my LAN. It's working over VPN as well.

send.sh

Code: Select all

#/bin/sh #Sound not working cvlc -vvv v4l2:///dev/video0:v4l2-adev=alsa:///\"hw:0,2\" :sout="#transcode{vcodec=mp2v,vb=800,scale=1,acodec=mpga,ab=128,channels=2,samplerate=44100} :duplicate{dst=std{access=udp,mux=ts{ttl=12},dst=239.155.1.1:1234},dst=display}
"

receive.sh

Code: Select all

#/bin/sh cvlc udp://@239.155.1.1:1234

Papageno
New Cone
New Cone
Posts: 8
Joined: 02 Jan 2010 16:00

Re: Streaming command line arguments for v4l2 with webcam

Postby Papageno » 04 Jan 2010 09:05

Is there really nobody who knows the correct syntax?
I found that input-slave is the Alsa and OSS audio capture has been removed from the v4l and v4l2 accesses and input-slave alsa:// should be used instead. This is for versions > 1.0.0 But there is nowhere any sentence about the parameters to access a specified input. And the Streaming-Howto and Documentation is outdated. Please, can someone provide me with the correct stuff or valid links?

Thanks again
Hans

Papageno
New Cone
New Cone
Posts: 8
Joined: 02 Jan 2010 16:00

Re: Streaming command line arguments for v4l2 with webcam

Postby Papageno » 04 Jan 2010 20:46

Okay I am a little bit further. Using just hw:2,0 in the settings of Audio-Device (Streaming Wizard) then I am able to record audio and video using Coding Video - DIV3 + MP3 (ASF) and save it to a file. (this is just for testing, I want still stream to another computer). I am using Ubuntustudio 9.10.
But inside the script it doesn't work. Again my question: Any idea?
The command line:

Code: Select all

cvlc -vvv v4l2:///dev/video0:input-slave=alsa:///\"hw:2,0\" :sout= '#transcode{vcodec=DIV3,vb=800,scale=1,acodec=mp3,ab=128,channels=2,samplerate=44100}:duplicate{dst=std{access=file,mux=asf,dst=/home/papageno/direkt.mpg},dst=display}'
I am still not sure if input-slave=alsa:///\"hw:2,0\" is the correct syntax, but there are no more error messages.

ribbles
New Cone
New Cone
Posts: 1
Joined: 20 Mar 2020 06:20

Re: Streaming command line arguments for v4l2 with webcam

Postby ribbles » 20 Mar 2020 06:28

Sadly, 10 years later, I have a solution. This works for the C920.

Code: Select all

cvlc -vvv v4l2:///dev/video0:chroma=H264 --no-sout-all --sout-keep --sout '#rtp{sdp=rtsp://:8554/}'
The chroma=H264 tells the device (via the v4l2 interface) what format to use. A list of the formats can be found using the commands v4l2-ctl --list-formats and v4l2-ctl --list-formats-ext


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 16 guests