time-laps paroci by codex gpt-5.4
This commit is contained in:
31
gemini-code-1778096684998.txt
Executable file
31
gemini-code-1778096684998.txt
Executable file
@@ -0,0 +1,31 @@
|
||||
Act as an experienced Senior Fullstack/Linux Developer. Write a robust Python 3.10+ program to capture images from an RTSP home camera for a professional-grade time-lapse of a fern growing over 30-40 days.
|
||||
|
||||
**Project Context & Strategy:**
|
||||
- To ensure consistent lighting and minimize "shadow flicker," frames will be captured only during a 6-hour window daily (e.g., 10:00 AM - 4:00 PM).
|
||||
- Interval: Capture one frame every 10 minutes.
|
||||
- Target: ~36 frames/day, resulting in ~1440 frames over 40 days (~48 seconds of video at 30 FPS).
|
||||
|
||||
**Core Requirements:**
|
||||
1. **Target Platform:** Linux.
|
||||
2. **Capture Engine:** Use `ffmpeg` via Python `subprocess`.
|
||||
- *Technical Note:* If possible, suggest/implement flags to lock or stabilize auto-exposure/white balance to prevent color flickering between frames.
|
||||
3. **Execution Logic:**
|
||||
- The script should check the current system time. It must only capture and save a frame if the time falls within the predefined "Golden Window" (e.g., 10:00 - 16:00).
|
||||
- Alternatively, design the script to take a single frame and exit, so it can be triggered by a `cron` job.
|
||||
4. **Resilience:**
|
||||
- Implement robust error handling for RTSP stream timeouts or network drops.
|
||||
- Use exponential backoff for retries.
|
||||
- Log all activities (success, skips, errors) to a local file.
|
||||
5. **Output Management:**
|
||||
- Save high-quality JPEGs to a structured directory.
|
||||
- Filename format: `YYYY-MM-DD_HH-MM-SS_ferngrowth.jpg`.
|
||||
6. **Video Compilation:**
|
||||
- Provide a separate function or command to compile the final `.mp4` using `ffmpeg` at 30 FPS. Use high-quality libx264 settings.
|
||||
|
||||
**Strict Coding Guidelines:**
|
||||
- Clean, modular code (SOLID/DRY).
|
||||
- Use modern Python 3.10+ (type hinting, logging).
|
||||
- **Do not use Polish diacritics in code comments.**
|
||||
- If any C/C++ is used, follow LLVM brace style.
|
||||
- Provide a brief summary of "What" and "Why" regarding the architecture.
|
||||
- Include a sample `crontab` entry to automate the 10-minute interval during the 6-hour daily window.
|
||||
Reference in New Issue
Block a user