webcam cannot be accessed by WSL - webcam

I'm very new to WSL. I want to run a python code on ubuntu shell on my win10 PC. This code needs access to webcam, but it seems that the webcam is not opened properly..I have checked online and I found several posts 1-2 years ago which said that the integrated webcam cannot be accessed by WSL..Is there any update or trick that can use webcam on WSL?
Many thanks!

You can't still access the webcam in WSL but there are several ways to access the video stream in WSL. The most obvious one is converting your webcam to a web-based streaming protocol like RTSP, MPEG, FFMPEG streams (example) where you get almost similar experiences.
Also, there are many applications where you can make your webcam as an IPcam stream then use the stream URL instead of using the camera index in OpenCV or any other application.

Related

Gems/packages/APIs for generating virtual webcam to stream a video file to

Goal: Create a testing framework for using a file that will mimic folks streaming their webcam video to our server
Thoughts so far: The two thoughts I'm trying to locate is to generate my own virtual webcam package or finding a way to inject a video file as a livestream to the webcam.
Anyone got any suggestions? I'm trying to find options for Ruby, C#, or Python
So the only easy solution I found for this in the end is only in the ChromeDriver. You can pass in the following options to ChromeDriver when launched:
--use-file-for-fake-video-capture=<filename>
--use-file-for-fake-audio-capture=<filename>
--use-fake-ui-for-media-stream
--use-fake-device-for-media-stream
This will let you send in an audio & a video stream in as the default fake audio/video devices for the browser.

How to turn webcam to rtsp

I have a product that can analyze video after inputting an rtsp url.
I would like to use a webcam to stream and feed my product the webcam rtsp.
How can I do that?
It will depend on the webcam you are using - most support RTSP but many do not publish the interface to access the stream as they are designed to be used with the webcam's own companion app.
There are some web resources which provide the RTSP urls for common web cams - you may find it hard to find a match as new versions of webcams roll out but it should give you a feel how to try accessing a vendors camera if you have a specific web cam you are testing against. Some examples (at the time of writing):
https://www.getscw.com/decoding/rtsp
https://soleratec.com/get-support/rtsp/
If you can't find the info for the camera you are using, and you have the companion app, you can also use a network sniffer tool like Wireshark (https://www.wireshark.org) and try to search the traffic for 'rtsp://' pattern.
If you just need to test your app and have access to a raspberry pi with a camera module you can also use this to generate an RTSP stream - there are several approaches for this but one I have found reliable is the v4l2rtspserver server:
https://github.com/mpromonet/v4l2rtspserver
There are specific instructions for setting it up on PI (https://github.com/mpromonet/v4l2rtspserver/wiki/Setup-on-Pi) and you can also verify it is working using VLC player on a laptop etc before testing in your specific application.
There are also a small number of test RTSP urls available on the web - the most reliable seem to be the one at this link provided by Wowza (again, link valid at time of writing):
https://www.wowza.com/html/mobile.html

Streaming not possible in internet explorer

I have an application that broadcast my screen over the network. in other browser it is working correctly but in internet explorer its not working and always shows to download a file instant of playing streaming.
in other browser like chrome
but in internet explorer its not working ....
i have installed many plugin like quick time active x, java etc.
This is difficult to answer without knowing the media type of the streaming.
But I would suggest try installing VLC or the latest media player with updated codecs. Also try disabling any download manager that you might be having.
Note: You can also try the streaming option of VLC as it has a VLC server as well.
Hope that helps.
Also suggested: Buy an authenticated version of Windows or Activate your copy of Windows :P

Convert RTSP stream to virtual web camera

I am trying to use a RTSP stream from an IP camera as video input source for various applications on Windows (eg. Skype, Zoom, Microsoft Teams, etc.).
The only solution I have found so far is using "webcam 7", an application that fetches an RTSP stream and creates a virtual webcam driver that registers in system as webcam and that any application can then use. Unfortunately, this application often becomes unstable and might crash randomly.
Are there any alternative/better ways for achieving this?
Create your own DirectShow video capture filter (there are lots of examples - this is a great one) and handle the RTSP stream inside it. This way you can implement the stability yourself.
I know this is a bit old question.
But you can also have look at vlc2vcam, looks promising.
Try Moonware Universal Source Filter from http://netcamstudio.com. The only drawback is that it creates only video "composite" device that sends both video + audio and Skype can only see the video (I think most of applications does the same).
If I find an easy way to split that stream will post it here.
You can easily do it on Ubuntu, Debian, Raspian, and Ubuntu Linux for Windows subsystems using the following method,
Installing required libraries, v4l2loopback-dkms and ffmpeg:
sudo apt install v4l2loopback-dkms
sudo apt install ffmpeg
Emulate a video device:
sudo modprobe v4l2loopback card_label="Webcam Stream Name" exclusive_caps=1
Streaming from RTSP uri to the created virtual device:
ffmpeg -stream_loop -1 -re -i rtsp://uri -vcodec rawvideo -threads 0 -f v4l2 /dev/video0
You can replace the '0' at the end of /dev/video0 with the number of the available and playable video device.

How to run video present on a sever in windows 8 app

I want to know how to run video present on a sever in windows 8 app.
I am using media element and binding source with the specific url.But video it not playing well if the video is on the local machine it able to play.
thanks in advance for any suggestion
I'd suggest the Player Framework, it works well from my usages with remote videos.