A package that allows you to use an openwrt device as an RTSP/ONVIF DVR

I was looking for a ready-made solution that allows using an openwrt device as an RTSP/ONVIF DVR with support for recording events in the device's storage (alarm detector, motion detector, etc..), but I only found libgst1rtsp, which does not seem to be the case. Does such a thing exist?

Not as existing package, but you are welcome to try to build and contribute one.

ffmpeg can do it, if you enable the required functionality -

1 Like

For a non-developer, it sounds like "go to the forest..." :sweat_smile:

Well, you can restream, but not organize/lifecycle recordings.

the one I provided is DIY too, unfortunately ...

Maybe I didn't ask google well afout ffmpeg, but all I've found so far is:
Constantly receive a video stream
Delete duplicate frames via ffmpeg and write them to a file.

Perhaps this is not the worst solution, but it is not yet clear how to record them at normal speed and in separate short video files with a timestamp.

yes, cameras tend to transmit 24/7/365.

no idea why this is important, but if AI says it is, it must be.

record them at whatever speed, adjust the playback ?

why ?
only reason for this would be motion detection, and ffmpeg won't do it.

as you can see, you're pretty far from the "ready-made solution" you were looking for.

where's always software like Shinobi, but it won't run on OpenWRT, unless perhaps in a Docker container, and if it would, it'd have to be on an x64, or something equally powerful.

You can make videos for an hour, rather than for each trigger, but then add time to the video itself.
That's why I initially wanted to record a video to a file based on the event from the camera, and not stream 24/7 :slightly_smiling_face:

adding the time, in video or only as date and time in the file name, is probably the least of your obstacles.

then you need to figure out a way to catch those, no idea how that's done, haven't tried it myself.

btw, the motion package's available in openwrt, have a look at what it's capable of.

Years ago, I implemented motion and mjpg-streamer on a D-Link camera powered by OpenWrt. This used to work well, given the camera was running on a 400MHz MIPS CPU. The clips were automatically uploaded to my NAS for later review.

I did a quick web search for current RTSP impementations and I found "mediamtx". While it's not in the OpenWrt package repository, they do provide a standalone binary for OpenWrt. NB: I've not tested this myself, this is just what came up in a web search.

2 Likes

In your application, are you looking for a ready made solution that simply dumps a bunch of video files to storage, or did you want a GUI that can show you the events with the ability to click to view the video and such?

If the former, the suggestions in the thread may be workable, but you'll need to do a bit of work to figure out how to tie it all together (still not ready-made, but the parts are available). If the latter, I don't think you'll find that on OpenWrt. Instead, you should consider an actual NVR solution.

Regarding NVR options -- if you already have a NAS or an x86 system or a reasonably powerful SBC, you may be able to find free or inexpensive options for this. If you don't have those things, you can buy a ready made solution that includes what you need in terms of compute+network+software+storage.

That's enough. The main thing is that the data from the video (if anything) can be correlated with real time.

In general, I already +/- understand how this can be implemented. It remains to figure out how to receive events from the camera (or subscribe to events)


Cool. ffmpeg is built in the repository with --disable-decoder=h 264 --disable-muxer=h 264 --disable-demuxer=h264 --disable-parser=h264.
Just 264 is needed