Stream video from a camera in real time
Stream video from a camera in real time
Can PB stream video from a camera in real time? The Camera Library seems to be only for a virtual camera.
Last edited by k3pto on Sat Dec 14, 2024 10:13 pm, edited 2 times in total.
Re: Stream video from a camera in real time
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.
Sorry, can't help you with your problem.
Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Re: Stream video from a camera in real time
You can try aviCap or any external solution.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.
If translation=Error: reply="Sorry, Im Spanish": Endif
Re: Stream video from a camera in real time
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!
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
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
viewtopic.php?t=77848
And load movie withsomething like this:
rtsp://camname:password@192.168.7.79/live
Or
Code: Select all
vlc_play(vlc, "dshow://")
Last edited by infratec on Tue Oct 01, 2024 10:51 am, edited 1 time in total.
Re: Stream video from a camera in real time
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
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?
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
Follow the link infratec posted above
Re: Stream video from a camera in real time
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
https://www.purebasic.fr/english/viewtopic.php?p=636983
https://github.com/kenmo-pb/PBWebcam