rtsp-relay icon indicating copy to clipboard operation
rtsp-relay copied to clipboard

Snapshot?

Open Ming-desu opened this issue 4 years ago • 6 comments

Hello, I just want to ask if this library supports grabbing snapshot from IP Cameras whenever possible? Thank you. :)

Ming-desu avatar Aug 20 '21 18:08 Ming-desu

Hi, apologies for the delayed response. At the moment this library doesn't support that, because on slow networks we would need to merge several incomplete frames to get a reliable image.

In my situation, I found that the IP cameras had an HTTP endpoint that returns a JPG image, which is a much simpler method.

k-yle avatar Sep 22 '21 21:09 k-yle

Ohhh, it's okay. Thank you.

Ming-desu avatar Sep 29 '21 14:09 Ming-desu

Is taking a snapshot from live stream possible ? i tried with html2canvas but could just take snapshot of a text and not from live video https://stackoverflow.com/questions/71773950/capture-snapshot-of-inside-div-doesnt-show-everything

waleedd32 avatar Apr 06 '22 19:04 waleedd32

I don't recommend this - read https://github.com/k-yle/rtsp-relay/issues/97#issuecomment-925337675 first - but you can take a screenshot of the HTML canvas.

k-yle avatar Apr 06 '22 21:04 k-yle

My ip cameras doesnt have http endpoint

waleedd32 avatar Apr 06 '22 21:04 waleedd32

Something like this would work:

  loadPlayer({
    url: 'ws://localhost:5000/api/stream',
    canvas: canvasRef.current,
+   preserveDrawingBuffer: true
  });

+ const myScreenshot = document.querySelector('canvas').toDataURL();

k-yle avatar Apr 08 '22 23:04 k-yle