How to stream webcam only when client ready?

About encoding, codec settings, muxers and filter usage
jsrober
New Cone
New Cone
Posts: 8
Joined: 27 Jan 2011 04:28

How to stream webcam only when client ready?

Postby jsrober » 27 Jan 2011 04:35

Hi,

I have a webcam connected to my laptop. I'm using RTSP H.264/AAC (TS) to stream to my Android phone. VLC uses lots of CPU to stream. I assume it's constantly encoding the webcam video to H.264.

I want the encoding to only start when my client (phone) connects. I don't want it otherwise encoding 24x7.

Is this possible? If so, how?

Thanks,
John

my2sense
New Cone
New Cone
Posts: 5
Joined: 28 Jan 2011 15:13

Re: How to stream webcam only when client ready?

Postby my2sense » 30 Jan 2011 02:50

You need to set up your webcam as Video on Demand instead of broadcast. I'm using Windows so:

Here's how I did mine (I'm using the HTTPd interface):

Code: Select all

vlc.exe --ttl 12 -vvv --color -I http --rtsp-host 0.0.0.0:554
and used the following VLM commands:

Code: Select all

new cam vod enabled setup cam input "dshow://" setup cam output #transcode{vcodec=mp4v,vb=230,fps=24,width=160,acodec=mp4a,ab=32,channels=1,samplerate=32000} setup cam option dshow-vdev="QuickCam Pro"
Set dshow-vdev to whatever your camera id is. You might also need to replace the transcode options for your phone.

Using these settings, VLC will only start my cam when I connect to it from my phone (rtsp://xxx.xxx.xxx.xxx:554/cam) which I think is exactly what you're looking for. Hope that helps and good luck.

jsrober
New Cone
New Cone
Posts: 8
Joined: 27 Jan 2011 04:28

Re: How to stream webcam only when client ready?

Postby jsrober » 02 Feb 2011 02:00

Thank you so much!!! You are so kind for responding. This is exactly what I want to do. It will take some time for me to get this working, but I'll figure it out.

THANK YOU!

John


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 9 guests