Skip to content

Conversation

@Jonathan-Woo
Copy link
Contributor

@Jonathan-Woo Jonathan-Woo commented Oct 23, 2025

Fixes #213

By default, the picamera2 FfmpegOutput hides the thread_queue_size so we had to create a fork of it (https://github.com/AccelerationConsortium/picamera2) to change those values. Thus, moving forwards, the picamera2 dependency would have to be installed from the fork.

We are pending additional testing with the cron auto restarts.

Copilot AI review requested due to automatic review settings October 23, 2025 23:11
@Jonathan-Woo Jonathan-Woo linked an issue Oct 23, 2025 that may be closed by this pull request
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates the camera streaming implementation from libcamera-vid CLI to the picamera2 Python library, adds timestamp overlays to the video stream, and improves error handling.

  • Replaced subprocess-based libcamera-vid approach with native picamera2 library for better control and integration
  • Added timestamp overlay functionality using OpenCV that displays current date/time on the video stream
  • Enhanced error handling with graceful shutdown and automatic retry logic

libcamera_cmd.extend(["-o", "-"]) # Output to stdout (pipe)
picam2.configure(
picam2.create_video_configuration(
main={"size": (1280, 720)}, transform=Transform(hflip=CAMERA_HFLIP, vflip=CAMERA_VFLIP)
Copy link

Copilot AI Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The video resolution changed from 854x480 to 1280x720 without corresponding bitrate adjustment. This represents a 2.5x increase in pixels but uses the same 1 Mbps bitrate (line 65), which may result in lower quality video. Consider increasing the bitrate to 2-3 Mbps for 720p streaming.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding clock/timestamp overlay to camera feed

2 participants