Page 1 of 1
Stream video from a camera in real time
Posted: Sun Aug 11, 2024 7:59 pm
by k3pto
Can PB stream video from a camera in real time? The Camera Library seems to be only for a virtual camera.
Re: Stream video from a camera in real time
Posted: Sun Aug 11, 2024 8:21 pm
by jacdelad
The camera library is for the 3d engine and has nothing to do with any real or virtual camera. Just for info.
Sorry, can't help you with your problem.
Re: Stream video from a camera in real time
Posted: Sun Sep 29, 2024 12:30 pm
by minimy
k3pto wrote: Sun Aug 11, 2024 7:59 pm
Can PB stream video from a camera in real time? The Camera Library seems to be only for a virtual camera.
You can try aviCap or any external solution.
Re: Stream video from a camera in real time
Posted: Tue Oct 01, 2024 3:14 am
by kenmo
The short answer is NO, PureBasic does not have any camera/webcam functionality built-in.
The longer answer is you can try using OS API for it (which OS are you on?) or some third party libraries.
Another exciting answer is that PureBasic already uses libSDL for some things, and major new version SDL3 is coming out very soon, which finally features camera/webcam functionality (cross-platform Windows Mac Linux and more!)
https://www.youtube.com/watch?v=MKM6-03iOPs
https://wiki.libsdl.org/SDL3/CategoryCamera
I don't expect PB to add camera features based on SDL3, but it will totally be possible to load SDL3 ourself and call SDL's camera functions. Soon!
Re: Stream video from a camera in real time
Posted: Tue Oct 01, 2024 10:20 am
by infratec
Maybe with libVLC
viewtopic.php?t=77848
And load movie withsomething like this:
rtsp://camname:password@192.168.7.79/live
Or
works here with a USB Logitech WebCam 200
Re: Stream video from a camera in real time
Posted: Tue Oct 01, 2024 10:41 am
by infratec
Maybe the selection is possible with:
Code: Select all
vlc_play(vlc, "dshow:// :dshow-vdev=" + #DQUOTE$ + "Logitech Webcam 200" + #DQUOTE$ + " :dshow-adev=" + #DQUOTE$ + "Logitech Webcam 200" + #DQUOTE$)
Re: Stream video from a camera in real time
Posted: Sat Dec 14, 2024 10:16 pm
by k3pto
It seems like several responses point to using VLClib. Can someone please show me how to add it to my PB and then how to use it? I now have two requirements that VLC may be able to do:
1) real time video from a USB camera
2) show a video from the web
Has someone already implemented a port of VLClib to PB and, if so, is it available? Or is there a better solution?
Re: Stream video from a camera in real time
Posted: Sun Dec 15, 2024 9:48 pm
by Caronte3D
Follow the link infratec posted above
Re: Stream video from a camera in real time
Posted: Sun Mar 16, 2025 12:45 am
by kenmo
Just as a follow-up, SDL3 released in January and I've released a "PBWebcam" includefile/library that uses SDL3 to access cameras in real time, to stream to PB image or CanvasGadget or save to file, etc.
https://www.purebasic.fr/english/viewtopic.php?p=636983
https://github.com/kenmo-pb/PBWebcam