Git Product home page Git Product logo

benstanfish / timelapsepy Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 332 KB

Library for simplifying and automating time lapse photography using a Raspberry Pi and camera. Can also use ffmpeg to convert images to mp4 if desired.

License: Creative Commons Zero v1.0 Universal

Python 100.00%
libcamera picamera2 python raspberry raspberry-pi raspberrypi timelapse timelapse-photography timelapse-videos

timelapsepy's People

Contributors

benstanfish avatar deses avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

deses

timelapsepy's Issues

Folders are not being created

2023-07-30 16:21:03,835 - TimelapsePy - ERROR - Error at division
Traceback (most recent call last):
  File "/home/pi/timelapses/TimelapsePy/timelapse.py", line 60, in <module>
    save_dir = util.get_preferred_path(users.directory_name_for_images,
  File "/home/pi/timelapses/TimelapsePy/tutilities.py", line 122, in get_preferred_path
    path = build_path(os.path.join(os.path.join(os.path.expanduser('~'),'Pictures'), directory_name), iterate_name)
  File "/home/pi/timelapses/TimelapsePy/tutilities.py", line 95, in build_path
    os.mkdir(path)
FileNotFoundError: [Errno 2] No such file or directory: '/home/pi/Pictures/timelapse_images'

That's because in a default headless Pi installation, there are no default folders like Pictures and Downloads. If I create the Pictures folder it works, tho.

I would not hardcode the Pictures folder anyway, for instance I don't want to store the pics there.

`tvideo.py` crashes, freezes the SSH session and creates 1KB video.

I tried doing a video using 905 images totaling 2GB (2.135.596.738 bytes) and I get this error from dmesg

[   85.819153] Out of memory: Killed process 745 (ffmpeg) total-vm:2008236kB, anon-rss:826772kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:1210kB oom_score_adj:0

Apparently, 2GB is too much!

Ran into this error when trying your scripts

pi@pi3:~/timelapses/TimelapsePy $ python timelapse.py
tlogger.py <version 0.0.2> imported.
usersettings.py <version 0.0.1> imported.
tutilities.py <version 0.0.3> imported.
[2:07:28.607665408] [2178]  INFO Camera camera_manager.cpp:297 libcamera v0.0.5+83-bde9b04f
[2:07:28.648126597] [2180]  INFO RPI vc4.cpp:437 Registered camera /base/soc/i2c0mux/i2c@1/ov5647@36 to Unicam device /dev/media3 and ISP device /dev/media0
[2:07:28.648294565] [2180]  INFO RPI pipeline_base.cpp:1101 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
[2:07:28.660302209] [2178]  INFO Camera camera.cpp:1033 configuring streams: (0) 3840x2160-BGR888 (1) 2592x1944-SGBRG10_CSI2P
[2:07:28.660905695] [2180]  INFO RPI vc4.cpp:565 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected sensor format: 2592x1944-SGBRG10_1X10 - Selected unicam format: 2592x1944-pGAA
2023-07-30 16:16:49,218 - TimelapsePy - ERROR - Error at division
Traceback (most recent call last):
  File "/home/pi/timelapses/TimelapsePy/timelapse.py", line 35, in <module>
    picam2.set_controls({"AfMode": util.get_focal_mode(users.user_focus_mode),
  File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 1093, in set_controls
    self.controls.set_controls(controls)
  File "/usr/lib/python3/dist-packages/picamera2/controls.py", line 58, in set_controls
    self.__setattr__(k, v)
  File "/usr/lib/python3/dist-packages/picamera2/controls.py", line 33, in __setattr__
    raise RuntimeError(f"Control {name} is not advertised by libcamera")
RuntimeError: Control AfMode is not advertised by libcamera

I'm using an old Pi Camera 1.3 that doesn't have AF or anything fancy, uses the ov5647 sensor and works well when I manually use libcamera-still.

If i comment line 35 and 36, it works.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.