Hello guys, I've got an IP camera from which I can get a video stream (either in mjpeg or h264 format, using proper URLs) Is there any easy way (script or free plugin) to display the live stream inside my scene? I've searched for many solutions online but they either don't work or are outdated.
You can use Spout (Windows) or Syphon (macOS) to stream textures between different apps, including Unity. To go from IP camera -> Spout/Syphon -> Unity plane you need a Spout/Syphon sender app that can stream your camera to that protocol, and a receiver in Unity that catches it. I don't know of any such apps (webcam to Spout/Syphon sender) but they must exist. To receive the texture in Unity, use this: https://github.com/keijiro/KlakSpout https://github.com/keijiro/KlakSyphon
the easiest is to, obviously, make the IP cam register in the system as a Webcam - you can then open it directly in Unity for that you will need direct support from the manufacturer - which is usually a problem for IP cams some support local http server - where you might connect directly e.g. from VideoPlayer - but overall IP cams are problematic in that you need to bring it in sane way outside Unity first
I didn't mention I'm building an Android app, sorry. Adding an external pc to work with the data stream looks like overkill to me It would only increase the software complexity Anyway thanks for the suggestion!
Can you explain better what do you mean by HTTP server? My IP camera is simply a raspberry zero w with a camera module and I do have a webserver serving it, but the video player still doesn't seem to work. Am I doing something wrong? p.s. I'm building an Android app, so the webcam solution isn't viable
Webcam is available on mobiles, but in this case more like isn't (meaning for IP cams, phone cameras more or less work with the class) If you have some webserver set up try opening it in something like VLC If that works then the video format isn't probably compatible with Unity VideoPlayer class
these work with few different live stream formats: https://assetstore.unity.com/packages/tools/video/easy-movie-texture-video-texture-10032 https://assetstore.unity.com/packages/tools/video/ump-pro-android-ios-83283
It does work on VLC the mjpeg Thanks but atm I don't have any budget to spend on this side project Anyway, I think I'll just implement my mjpeg receiver, it shouldn't be so difficult. I was hoping to find some h264 decoder just to have some video compression, but I guess I'll leave that for some future phase Thanks to all of you. I'll eventually post a link to how to do it once I'll manage to make it work.