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

Get frame(s) from Video stream #361

Open
peterel opened this issue Sep 8, 2022 · 1 comment
Open

Get frame(s) from Video stream #361

peterel opened this issue Sep 8, 2022 · 1 comment

Comments

@peterel
Copy link

peterel commented Sep 8, 2022

This is driving me nuts. Can someone please show me how to get the frames from a video stream? I get the stream using the example, see below, and that works well. But how do I go about getting each frame from that stream? Any help or tip is very very very welcome!

navigator.mediaDevices.getUserMedia(constraints)
    .then((stream) => {
      console.log('getUserMedia.stream', stream);
      console.log('getUserMedia.stream.getTracks', stream.getTracks());
      console.log("Im streaming!!", stream);
      var video = document.querySelector('video');
      console.log("video element", video);
      video.srcObject = stream;
      video.onloadedmetadata = (e) => {
        console.log("stream start");
        video.play();
      };
    }).catch((err) => {
      console.log('getUserMedia.error', err, err.stack);
    });
}

@peterel
Copy link
Author

peterel commented Sep 8, 2022

Sorry, wrong repo :)

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

No branches or pull requests

1 participant