Page 1 of 1

How to stream webcam only when client ready?

Posted: 27 Jan 2011 04:35
by jsrober
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

Re: How to stream webcam only when client ready?

Posted: 30 Jan 2011 02:50
by my2sense
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.

Re: How to stream webcam only when client ready?

Posted: 02 Feb 2011 02:00
by jsrober
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