Request for IP Camera interface Example Code or Project

Hi , Could anyone share an example code or project to interface with IP Camera [RSTP or ONVIF] and streaming video on the screen?

a simple htmlviewer with the ip address of the camera ?

Yes Jean-Yves. Anything will do first. I was hoping to able to display the video in a Image box on a Window.

not in an image box, use an htmlviewer instead. it should work straight.

i’ve been fighting with such things on and off over the years and it’s a true pain. Apple removed any direct support for RTSP years ago and there are no good solutions for handling it otherwise. You can try to include the VLC libraries into the app but my success at that has been severely limited, it leaks memory hugely and hangs up after just a few minutes. Your experience might be different though so don’t let me dissuade you from trying. It may work better on windows I don’t know. Onvif is just a way to discover cameras and what their real connection addresses are automatically, the connection method is still likely to be RTSP in which case you’re still in trouble for getting their video directly.

The idea of just linking an HTML viewer to the real camera IP is a good one with a few potential problems. You’ll likely have to sign into each camera display separately. Many cameras still require a plugin to display their contents and I’m not sure where to place that so it will load. On MacOS these are ALL broken as far as I can tell as there are none that meet the new security requirements so for many cameras there is no way to actually view them on a Mac at all and I have no idea if windows will still let you use less secure browser plugins or not but if so then their time is running out there too as that won’t last forever.

If you have control over which camera brands and models you’re wanting to support then you can pick some that will work via that method and tell people what to use, if you want to support many different things that are out there right now then it’s much more difficult.

The HTML viewer will work for just viewing, but if you wanted actual access to the video streams for recording or taking snap shots that are not just a screen shot of the viewer then it’s going to be very difficult.

Thanks you , Guys. YOU are the Best of the Best…

I actually just finished part of a project doing this again :slight_smile: I used ffmpeg in a shell to connect to the RTSP stream and then transcode the video at a lower framerate to mjpeg. I wrote a progressive MJPEG parser class which sends me events as it receives each frame and just keeps swallowing data from the ffmpeg process. You can’t use stdin for the data as it’s VERY slow but sending through a TCP socket is very easy. It’s still not as ideal as if we had the ffmpeg libraries as a plugin in Xojo (christian are you listening?) but it does work and I can get the latency down to about a second and a half which isn’t so bad really.

There was also a brand new VLC release recently which added a lot of hardware acceleration. I haven’t tried to include those libraries in my app anymore but it was REALLY hard to do previously. I have notes around here about how to use the various command line tools to change their include paths so they would find themselves inside another app. It was so much work and leaked so much memory and dropped the connection so badly that I am not really thinking I need to do that now with ffmpeg being able to run in a shell and do the translation for me…