Stream video from a camera in real time

Everything else that doesn't fall into one of the other PB categories.
k3pto
User
User
Posts: 87
Joined: Sat Jan 17, 2015 5:24 pm

Stream video from a camera in real time

Post by k3pto »

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.
User avatar
jacdelad
Addict
Addict
Posts: 2010
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Stream video from a camera in real time

Post 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.
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
User avatar
minimy
Enthusiast
Enthusiast
Posts: 619
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Re: Stream video from a camera in real time

Post 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.
If translation=Error: reply="Sorry, Im Spanish": Endif
User avatar
kenmo
Addict
Addict
Posts: 2043
Joined: Tue Dec 23, 2003 3:54 am

Re: Stream video from a camera in real time

Post 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!) :D
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!
infratec
Always Here
Always Here
Posts: 7618
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Stream video from a camera in real time

Post by infratec »

Maybe with libVLC

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://")
works here with a USB Logitech WebCam 200
Last edited by infratec on Tue Oct 01, 2024 10:51 am, edited 1 time in total.
infratec
Always Here
Always Here
Posts: 7618
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Stream video from a camera in real time

Post 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$)
k3pto
User
User
Posts: 87
Joined: Sat Jan 17, 2015 5:24 pm

Re: Stream video from a camera in real time

Post 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?
User avatar
Caronte3D
Addict
Addict
Posts: 1361
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: Stream video from a camera in real time

Post by Caronte3D »

Follow the link infratec posted above
User avatar
kenmo
Addict
Addict
Posts: 2043
Joined: Tue Dec 23, 2003 3:54 am

Re: Stream video from a camera in real time

Post 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
Post Reply