mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-05-09 08:25:54 +02:00
[GH-ISSUE #1177] [Bug]: External camera images show as black in notifications/timelapse #850
Labels
No labels
A1
automated
automated
bug
bug
Closed due to inactivity
contrib
dependencies
dependencies
duplicate
enhancement
feedback
hold
invalid
Notes
P1S
pull-request
security
ThumbsUp
user-report
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/bambuddy-maziggy-1#850
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nkm8 on GitHub (Apr 30, 2026).
Original GitHub issue: https://github.com/maziggy/bambuddy/issues/1177
Originally assigned to: @maziggy on GitHub.
Component
Bambuddy
Bug Description
With an external camera configured - tried both as a direct device connection and an external mjpeg stream hosted in go2rtc - the images all show as black.
Expected Behavior
Images/timelapse images show actual camera stream contents.
Steps to Reproduce
Printer Model
A1 Mini
Bambuddy Version
v0.2.4b2
SpoolBuddy Version
No response
Printer Firmware Version
No response
Installation Method
Docker
Operating System
Linux (Ubuntu/Debian)
Relevant Logs / Support Package
bambuddy-support-20260430-100200.zip
Screenshots
No response
Additional Context
No response
Checklist
@nkm8 commented on GitHub (Apr 30, 2026):
Additional context - I don't think it shows in the logs I shared, but I noticed that eventually the notification images started working mid-way through the print. I theorize this happened after I went into the Settings page and clicked the 'Test' button on the camera. From the logs, after the test:
However, the final print finish image shows as black - that is still viewable and downloadable from the UI.
Just a theory - but I noticed that when viewing the go2rtc mjpeg stream in a browser - there is a brief moment, maybe a second, where the image displayed is black. After the stream loads, it is consistent and never shows a black frame. This is on a pi4 - maybe there is a delay needed before capturing the image to allow the camera image to load?
@nkm8 commented on GitHub (Apr 30, 2026):
More research - I'm not sure if it is possible to delay the capture or detect if an all-black image is captured. I also noticed that go2rtc provides a specific endpoint for a single frame - in my example, it is: http://192.168.1.61:1984/api/frame.jpeg?src=printer
I refreshed that page a bunch and never saw an all-black result. Does it make sense to add an additional/optional input for image capture in addition to live stream?
@maziggy commented on GitHub (May 1, 2026):
Thanks for the methodical follow-ups — the size details in your log plus the go2rtc /api/frame.jpeg observation made the root cause diagnosis clean.
Confirmed and fixed in dev. Bambuddy was returning the very first JPEG it found on the MJPEG stream — and go2rtc (along with several IP cameras) emits a warm-up / black frame on the byte that follows connection accept, before the encoder catches up to live content. Subsequent frames on the same connection are fine, which is why everything worked from the live-view tab once the stream had been running for a second, and why your post-Test-button captures came through correctly while fresh-connection captures did not.
The fix reads past the first frame and returns the second; on a single-frame stream or a timeout it falls back to the warm-up frame so the snapshot / plate-detect / timelapse code paths never silently get None instead of something. 7 regression tests pin both the new behaviour and the fallback guarantees. Latency penalty is at most one frame interval — well inside the 15 s timeout window.
The separate /api/frame.jpeg endpoint suggestion is reasonable for a future "snapshot URL" override on cameras where the warm-up frame persists, but the warm-up skip covers your case directly without needing extra config.
Available/Fixed in branch dev and available with the next release or daily build. Please let me know if it works for you.
If you find Bambuddy useful, please consider giving it a ⭐ on GitHub — it helps others discover the project!
@nkm8 commented on GitHub (May 2, 2026):
Thank you for the quick and thorough response! I pulled the latest daily, but unfortunately I am still seeing the same issue (support bundle attached).
A few notes:
Some additional context: I don't think the root issue is go2rtc, I think it is the camera itself. I added go2rtc to try to stabilize the stream - but I also tried letting bambuddy stream directly from the device. Direct from device, I saw a lot of connection issues - after playing with go2rtc, I think this is because my camera supports both an mjpeg stream and a RAW yuyv stream. go2rtc allows me to pick between them, but bambuddy doesn't - from my testing, the yuyv stream is unstable in both, but the mjpeg stream is rock solid in go2rtc.
Here's my go2rtc config, for reference:
@nkm8 commented on GitHub (May 2, 2026):
D'oh - forgot the attachment:
bambuddy-support-20260502-124045.zip
@maziggy commented on GitHub (May 3, 2026):
Thanks for the follow-up — the camera-positioning observations (timelapse showing nozzle in different positions per frame, finish photo framing the nozzle instead of the bed) are physical-setup matters that any snapshot-from-live-stream timelapse will inherit; those aren't something the core can fix.
The intermittent black thumbnails were addressable, and your /api/frame.jpeg observation pointed at the cleanest fix. Shipped in dev as a new optional Snapshot URL field under Settings → External Cameras (visible for MJPEG / RTSP / USB stream types). When set, every single-frame capture (notification thumbnails, finish photo, timelapse, plate detection, Obico) goes through that URL via plain HTTP GET, bypassing the warm-up dance entirely. Your config would be:
Available/Fixed in branch dev and available with the next release or daily build. Please let me know if it works for you.
If you find Bambuddy useful, please consider giving it a ⭐ on GitHub — it helps others discover the project!