chipturner / rtsp-timelapse-scripts

Some scripts I made for creating a timelapse from an RTSP stream
Apache License 2.0
17 stars 3 forks source link

filter-timelapse-frames.py path to pile parameter #2

Open ShapeShifter42 opened 2 years ago

ShapeShifter42 commented 2 years ago

Thank you for posting this, it's almost exactly what I've been looking for: capture a UniFi Protect time lapse on a Synology NAS. I've made a few slight tweaks, and have successfully set up a Docker container on the NAS and I've been able to collect a day's worth of image grabs using grab-timelapse-frames.py. I'm now trying to create a movie, and I'm not getting past the filter frames stage.

pi@camera:~/rtsp-timelapse-scripts $ ./filter-timelapse-frames.py /volume1/timelapse --sample 6 > /tmp/filelist
usage: filter-timelapse-frames.py [-h] [--skip-weekends SKIP_WEEKENDS]
                                  [--sample SAMPLE]
                                  [--supersample_ranges SUPERSAMPLE_RANGES]
filter-timelapse-frames.py: error: unrecognized arguments: /volume1/timelapse

How do we specify where the input files are located? I took a SWAG, and tried running the script from the /volume1/timelapse directory which is where the grab script puts them, and leaving off the directory parameter, but that just caused fileinput.input() to try reading from stdin, which accomplished nothing.

I tried adding a positional argument to the parser list, and passing that value to fileinput.input() so the posted syntax works, but now it simply trows an "IsADirectoryError" exception.

Either something is broken, or I'm too stoooopid to figure it out. The latter is entirely possible: I have almost four decades of professional programming experience, but I only lightly dabble in Python, and I have no experience with the fileinput library.

moorsey commented 1 year ago

I can't figure this out either, appears there is no way of passing an input folder to this script. I've started this endeavour now, so will have to figure it out one way or another, when my boss wants the video making!

Will keep messing and report back if I find anything out

moorsey commented 1 year ago

Just an FYI @ShapeShifter42

If you use the script in a previous version - https://github.com/chipturner/rtsp-timelapse-scripts/blob/37b8c44fd418f813a549a62c7cba398800c7c694/filter-timelapse-frames.py

Then the example filter commands work

I did this based on An issue (https://github.com/chipturner/rtsp-timelapse-scripts/issues/1) where the author is giving help, so assumed it must have worked at this stage

Something has been broken in the later few commits

ShapeShifter42 commented 1 year ago

Thanks for the information @moorsey, I'll give it a try. I'm really swamped with work at the moment, so it might not be right away. I might even look at the changes between versions and maybe be able to see what went wrong? But the way things are looking at the moment, it's not going to be this week, and probably not next week, either.