Monday, November 16, 2020

Windows 10 webcam remote view from another PC

Because of the COVID-19, lot of software programmer like me chose WFH. For my work, we have development platform connected with monitor, and sometimes I need visually check what is displayed. There is no VNC or remote desktop available on the development board, so I will use a webcam either built-in of a host PC or connect to USB of host PC.

It is a simple task, I just want to stream a webcam view from a lab PC, so I can remotely see what happening there. Two sides both need some setting/configuration to get it work: on the lab PC, need to start a stream server and use the webcam as feed. On my home PC, I need to have a software which can open the streamed video. I have done this on Android, with two popular free app, tinyCam and IP camera viewer: one provides the streaming service, the other provides the viewer on another Android setup.

To get it done on Windows 10, will need install some software on both host side and client side. There is many choice, one easy approach is installing the popular free and open source cross-platform multimedia player, VLC, from https://www.videolan.org/vlc/.

For the host PC, start VLC and select 'Open Capture Device':

Then select Video source from next dialog:

 

And select Stream from the drop list beside the bottom 'Play' button:

 

For  the "Source' dialog, just leave it to the default 'dshow'.

 

For destination setup, select 'HTTP' and make sure click the 'Add' button:

 

The default port would be 8080, and HTTP path would be the root '/', change to proper setting, or leave with the default setting:

 

Click 'next' for all other dialog with default setting, and click 'Stream' in the last dialog to start the stream. It will start the streaming. Grant permission if Windows pop up dialog for permission.

Also, will very likely need to open the port from windows firewall setting to allow external client to access this stream services. This can be done from Control Panel -> Windows Defender Firewall, or search "Windows Firewall" from Windows 10 search box. Then go to "Advanced Settings", select "Inbound rules", scroll to right (better enlarge the window) to see the "Local Port" column and sort the rules. Make sure the port such as the default 8080 is opened. If not, click "New Rule..." from Actions panel on the right to create a new Inbound rule:

  Select TCP and fill in the port:

 

Select 'next' for all other dialog, or uncheck 'Public' for 'When does this rule apply' to make it more secure. And give the new rule a meaningful name and click 'finish' to complete the setting.

 On client side, open VLC and select 'Open Network Stream':

 

Fill in the remote host PC's url with the port number (like below http://lab_pc_r3s4:8080):

 

The protocol 'http' is a must. That's it. The streaming will have some latency, from 10 to 30 seconds, depends on the bandwidth and traffic.

 It is possible to stream with other format, such as WebM, Ogg with which FireFox has built-in support, i.e. the stream can be opened directly inside FireFox (refer to FireFox KB) or Chrome web browser. But keep in mind, this will need a lot of horse power, meaning the host CPU will spend a lot of MIPs for doing the trans-coding, which might be a waste as the streaming may run 24X7.

0 Comments:

Post a Comment