AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
4.65k stars 378 forks source link

Snapshot black when not streaming on USB Device #1015

Open cavernerg opened 6 months ago

cavernerg commented 6 months ago

I use a logitech USB Cam to monitor my 3D printer. When I grab a snapshot (via Octoslack/Octoprint) I get a black image, if nothing else needs the cam. If I stream while Octosclack downloads the snapshot, it's fine.

AlexxIT commented 5 months ago

Please provide more info. How you setup stream.

cavernerg commented 5 months ago

Thanks for replying. Here is an example picture WhatsApp Bild 2024-04-30 um 20 15 12_008f86b1

This is the entry in config file: ffmpeg:device?video=1#video=mjpeg#hardware

AlexxIT commented 5 months ago

Show what you can see WebUI > Add > USB

cavernerg commented 5 months ago

image

it is a Logitech C615 Camera. To me it seems like the camera is in standby and when go2rtc takes the snapshot, the camera is not fully awake and adjusted to the light. Because if I am watching the stream on my android and go2rtc takes the snapshot in the same moment, everything is fine.

The light dots in the example picture in the post 3 days ago are from the LED-Strip, which permanently lights up the 3D-Printer

AlexxIT commented 5 months ago

Use config as suggested in WebUI. You don't need transcoding for mjpeg, because camera support this format out of box.

cavernerg commented 5 months ago

Oh right, I was there before and tried around - but the result remains the same.

AlexxIT commented 5 months ago

What about stream? Do you have problems only with snapshots?

cavernerg commented 5 months ago

Stream works flawless. Only snapshots are problematic. And that only, when camera is not in use e.g. through parallel streaming.

AlexxIT commented 4 months ago

Have you tried to get snapshot during active stream?

cavernerg commented 4 months ago

Yeah that is what I tried to explain. In this moments , snapshots are fine

AlexxIT commented 4 months ago

You have two examples in the go2rtc WebUI. Have you tried them both?

cavernerg commented 4 months ago

Yes , I did. To me it seems like the camera needs too much time to wake up from standby

AlexxIT commented 4 months ago

I also think the camera is the problem. The solution may be to skip the first X frames. But there are no plans for such a fix in the near future

cavernerg commented 4 months ago

Yeah I'd do that , if it was my own implementation of getting the snap, but I'm using octoprint/octoslack to do that. :(