Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapshot? #97

Open
Ming-desu opened this issue Aug 20, 2021 · 6 comments
Open

Snapshot? #97

Ming-desu opened this issue Aug 20, 2021 · 6 comments
Labels
question Further information is requested

Comments

@Ming-desu
Copy link

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

@k-yle
Copy link
Owner

k-yle commented Sep 22, 2021

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 k-yle added the question Further information is requested label Sep 22, 2021
@Ming-desu
Copy link
Author

Ohhh, it's okay. Thank you.

@waleedd32
Copy link

waleedd32 commented Apr 6, 2022

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

@k-yle
Copy link
Owner

k-yle commented Apr 6, 2022

I don't recommend this - read #97 (comment) first - but you can take a screenshot of the HTML canvas.

@waleedd32
Copy link

My ip cameras doesnt have http endpoint

@k-yle
Copy link
Owner

k-yle commented Apr 8, 2022

Something like this would work:

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants