HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
scottlamb
moonfire-nvr
Rust2016–2025
scottlamb / moonfire-nvr

moonfire-nvr

Moonfire NVR, a security camera network video recorder

2Distinct people
32Mentions
0Explicit recommenders
1.8KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Moonfire NVR, a security camera network video recorder

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 8:03:49 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year32 dated mentions

Observed mentions: 2016-12-27 05:52:55 UTC to 2025-10-24 16:37:24 UTC.

02462016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC101
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC000
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC303
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC505
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC606
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC606
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC505
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC505
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101

What Hacker News says

3 sources
My plan is to extend the HTTP API [1] with an event stream [2] that can be accessed via https-with-a-session-cookie or http-over-Unix-domain-socket. It could be used by browser-based Javascript, mobile clients, and automated event subscribers. One could write a subscriber that launches a subprocess or runs scripts in-process. I think there are a few advantages over doing this directly from the main process: * it keeps the main process logic minimal. This API is needed anyway to make a good web interface. * it's the easiest way to have nothing else run as the same Unix user as the main process. My design is similar to a DBMS in that that you should only ever be accessing Moonfire NVR's data through its interfaces (except for development or emergency maintenance purposes). Having a dedicated user helps enforce that. * your script can run on
Read the rest
a separate machine if desired Also a couple disadvantages: * two services to set up (main process + subscriber) instead of one. * there's the possibility that an event happens while the main process is running but your subscriber is disconnected, so the event gets committed to the database but you never see it. The easiest thing to do is to accept skipping these (as would happen anyway if the main process is down). Or the main process could buffer events for a while. Or the watcher could have logic to "catch up" (which unfortunately means not only more complex logic but also keeping state somehow). If you'd prefer another approach or want it sooner than I'm likely to implement it, please contribute! I have my priorities & design ideas, but if you chip in, you get a say in both. And I go pretty slowly on my own anyway, so if you're able, it's worth chipping in even if you agree with me about everything. [1] https://github.com/scottlamb/moonfire-nvr/blob/master/design... [2] https://github.com/scottlamb/moonfire-nvr/issues/40
In Ask HN: What do you do with your Raspberry Pi?
Thanks! > Is there any way to test it without rpi/camera? Without a Raspberry Pi, yes. It should run on any Unix-like OS. I've tested Linux/arm32, Linux/x86-64, and macOS/x86-64. (For the last, install ffmpeg via homebrew first.) Without an IP camera...hmm, there are probably some public RTSP live streams somewhere. Not sure offhand. > If I understand the readme correctly, you store frames individually (as jpegs?) on disk and construct flexible mp4 streams on the fly. Naturally I would have assumed that this would be inefficient so I’m wondering if I got this right, not very familiar with stream/video/codec tech No, I store the video stream in the compressed form the camera gave it to me. Currently that's H.264; it wouldn't be hard to add H.265 support as well. I break it apart into roughly one-minute segments at convenient locations. The
Read the rest
schema design doc talks about that here: https://github.com/scottlamb/moonfire-nvr/blob/master/design... .mp4 serving will aggregate those together (maybe clipping the start and end segment) to give you a .mp4 segment for any time range of interest. It comes up with a mp4::File struct which knows what video segments to serve and maps byte locations to parts of the .mp4 container format. I don't have a good doc about how this works other than the source code right now. https://github.com/scottlamb/moonfire-nvr/blob/master/src/mp... [edit: and you probably won't be successful in understanding it without having a pdf of the ISO/IEC 14496-12 specification open next to it.] Here's some debug output for generating a five-minute video segment: https://pastebin.com/Wzfz7BF7 Storing individual frames as jpegs would be inefficient I agree in all sorts of ways: recording CPU (you have to decode the H.264 and re-encode it as JPEGs), disk space, disk seeks, playback bandwidth, browser CPU, etc. My understanding is this is how Zoneminder currently works. I imagine it worked better with the cameras Zoneminder was originally designed for: low-resolution, low-qps webcams that didn't do their own H.264 encoding.
In Ask HN: What do you do with your Raspberry Pi?
A security camera NVR. (Help wanted! I'm developing it here: https://github.com/scottlamb/moonfire-nvr I'm proud of the design but it's still far from a polished system that does everything a reasonable person would expect. Lots of opportunities to extend it if you're looking for a fun Rust + Javascript project.) A Raspberry Pi 2 will run a working setup; the new Raspberry Pi 4 should be a lot more pleasant in terms of being able to recompile it in a reasonable time, transfer video segments quickly, etc. I think the biggest missing piece is a real-time clock. Faster flash, builtin SATA, and a builtin NPU would also be great of course but not realistic for $35. A home theater control system. The Pi uses HDMI-CEC, my Samsung TV's EXLINK (their protocol over RS-232), Roku's HTTP interface, etc. and an Android app is the frontend. I wanted to
Read the rest
make this into a nice polished thing other people could use but have given up on the idea for now. The thing is that media components are super finicky, many things need special support written just for them, and you really have to extensively tweak them to see how they function as a whole. (eg does your TV turn off your stereo receiver when it turns off itself. The answer varies based on the model and settings of both components.) HDMI-CEC doesn't live up to its potential in this regard. [edit: fixed hyperlink]
In Ask HN: What do you do with your Raspberry Pi?

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.