Linux Security Camera Alternative: OpenRTSP

by intox

OpenRTSP doesn’t get much exposure because it’s just a (single file I think) library within the live555 library set. The scope of OpenRTSP is basically just to handle RTSP streams. Opens / streams / receives / records them.

More or less everything you need to record the stream from a stationary camera is included, and that’s all I need or care about. Zoneminder is big and difficult to configure, but includes more complicated operations and a web-browser interface… I don’t need all that.

Here’s the “scripts” I wrote / use to handle it:


pkill -1 openRTSP

Easy peasy. The stop command is necessary because it terminates OpenRTSP in a safe way so the video recorded is written properly. Here’s the script I have in /etc/cron.daily/ to handle storage:


  cd /some/location/Stream/
  /bin/mv /some/location/video-* staging/
  for file in /some/location/Stream/staging/*; do
    /bin/mv -n -- "$file" "$file.$(date +%Y%m%d)"
  /bin/mv /some/location/Stream/staging/video-* /some/location/Stream/old/
  /usr/bin/find /some/location/Stream/old/ -mtime +7 -exec /usr/bin/rm {} \;


The script, since it’s in cron, needs to include full paths to unix tools and needs to be in a function so directory changes work. It’s mostly self explanatory. If you want to change the number of days that video is stored in “old” before being deleted, change -mtime +7 to -mtime + whatever amount of days you want stuff stored. If you don’t want anything deleted automatically, just remove that line.

I’ve done minimal testing and so far this works for me. Pretty sure there aren’t errors. You need directories for the actual Stream, a staging directory, and an “old” directory for this script.

Here’s the docs:

Also, if you have VLC, you can open up a stream to watch it live via:

Media -> Open Network Stream

And type in something like:


Depending on your specific camera.


By: Glenda (Sat Jul 25 14:00:15 EDT 2015)
moshi moshi anon desu
Pretty good. Fuck bloated shit.

By: Glenda (Sat Jul 25 15:35:37 EDT 2015)

By: Glenda (Sun Jul 26 16:58:54 EDT 2015)

By: absent (Mon Aug 10 23:58:45 EDT 2015)
sir you appear to be testing comment functionality in my post >:|


By: Glenda (Tue Aug 11 00:22:15 EDT 2015)
i like jacking off
tell my mom to fuck off i dont wanna shower

By: absent (Tue Aug 11 00:25:13 EDT 2015)

clean urself you dirty fuk it's good for the soul

Anyway I included a cron script above.

Does this shit alert you when there's a comment wtf

By: Glenda (Tue Aug 11 00:27:46 EDT 2015)
What about... wait, is this just storing a shitload of JPEGs? Or some less efficient video format? Why not encode them as VP9 or something? Why not uh

some shit like that

also "deduplication" or motion detection and not recording stuff that's not moving or something

By: absent (Thu Aug 13 21:58:05 EDT 2015)
"Motion": is already a thing. I could use a different format, it's using the default output from the stream, which is this:

I wonder if I could do compression or something.

I just wanted something to work quickly because I don't have loads of time to dump into this, but I'll probably keep working on it in the future.