My automated workflow - running on a headless Debian system #20
5559175
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Through a lot of trial and error I think I have got quite a robust capture and analysis method for my Reolink CX810 IP camera (over RTSP). This works well in very low light and still produces colour video without needing to turn on IR lighting. I know there are other projects out there doing similar sorts of things but I couldn't find anything that did exactly what I wanted - most are geared up for "all sky" cameras it seems.
I am capturing first to a .ts file then when either the value of "$SECONDS" has elapsed or it receives a SIGTERM or SIGINT, the script "finalizes" the video into an mp4 container. This seems to help should there be any interruption of signal, jittery framerate from RTSP, or otherwise to avoid any sort of corruption/weirdness in the resulting video.
All of this is wrapped up in a very basic Flask webapp which Gemini wrote for me along with the scripts that I've tweaked a bit (I'm not a developer at all). It runs on my headless Debian NAS. More details of how I got MetDetPy to work nicely on my specific hardware are in this bug report
I can either just use the webapp to start/stop recording just the 4K video or alternatively I can run the auto-detect meteors "pipeline" which does in sequence: the stream recording, timelapse creation, 720p transcode, MetDetPy analysis and finally ClipToolkit clip creation. There is also an extra step inserted into the pipeline before running ClipToolkit which uses "sed" in the detections.json to swap the path of the 720p video used for analysis to the full 4K one to get better quality clips generated.
I have edited things since this original message and added some new functions to:
View a live stream of the camera via HTTP-FLV and a static image for easy viewing...the URLs are probably specific to the Reolink I would guess - I have had Gemini do this all for me and it suggested using a proxy inside Flask to workaround a CORS issue which the camera has which worked.
I can also now view the meteor clip folders (and clips) and there's a function to concatenate all clips together into one single MP4 file.
I have separate "STOP" (which acts just on the capture recording) and "STOP ALL" which stops the rest of the pipeline if I chose that in case I want to interrupt it manually for any reason. Finally, there is a basic log that is recorded which also times how long each post-process step in the pipeline takes.
Hopefully this might be useful to someone else...
"app.py" is the webapp itself - it runs on TCP port 5050.
"templates/index.html" is the webapp interface.
"skycamcapture.sh" creates the original 4K stream recording from my camera.
"timelapse.sh" creates the timelapse at 20x speed - it does it in a very fast way without re-encoding the video by changing the presentation timestamps.
"transcode_720p.sh" creates the 720p version from the original 4K video accelerated for an NVIDIA GPU.
"pipeline.sh" is the optional sequence which can be called to do everything.
app.py:
templates/index.html:
skycamcapture.sh:
timelapse.sh:
transcode_720p.sh:
pipeline.sh
Beta Was this translation helpful? Give feedback.
All reactions