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

Python versions? #3

Open moorsey opened 2 years ago

moorsey commented 2 years ago

Having used this successfully and now setting up on another device, having some issues

I'm running:

/home/user/Downloads/rtsp-timelapse-scripts-main/grab-timelapse-frame.py --city Manchester --output-directory /media/timelapse --output-filenames opsbuilding --url 'rtsp://admin:password@1.1.1.1:554/Streaming/Channels/101'

But getting:

Traceback (most recent call last):
  File "/home/user/Downloads/rtsp-timelapse-scripts-main/grab-timelapse-frame.py", line 116, in <module>
    main()
  File "/home/user/Downloads/rtsp-timelapse-scripts-main/grab-timelapse-frame.py", line 69, in main
    action=argparse.BooleanOptionalAction,
AttributeError: module 'argparse' has no attribute 'BooleanOptionalAction'

Google suggests python 3.9 is required, but trying to get that running on Ubuntu 2.04 has been a nightmare so far.

Just looking for some clarification on versions, before I pursue - many thanks

moorsey commented 2 years ago

OK, got there in the end. Seems python 3.9 is required, I installed as follows:

I have some other queries:

  1. Can we just capture one image each time the script runs?
  2. Is my script above correct for using astral? Appears not to be working for me. Sunset was 30 minutes ago, images still being captures however! - edit, this is actually dawn/dusk, not sunrise/sunset as described in the readme, so working OK here
ShapeShifter42 commented 1 year ago
1. Can we just capture one image each time the script runs?

The capture script has some parameters: --interval, which allows setting the time between frames (default is 10 seconds) and --duration, which is the time that the script will continue to capture frames (default is 60 seconds.) I'm not in a position to try it myself at the moment, but I would think that if you set a duration that is less than or equal to the interval, the script will exit after taking one frame. I would start by adding --interval 1 --duration 1 to your command line.

moorsey commented 1 year ago

Much appreciated, will test and report back