Jump to content
  • 0

Capture Stream Image frequently

Цэрэнчимэд Цэгмид


  • Answers 6
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

6 answers to this question

Recommended Posts

  • 0


I tried to get the image from the client, grab from the stream then upload to server
 but for some reason i cant get it to work.
where did you find this config to make a preview ?

here is the code :
 var firstVideoTrack;
 navigator.mediaDevices.getUserMedia({ video: true })
 .then(mediaStream => {
 firstVideoTrack = mediaStream.getVideoTracks()[0];

 var imageinterval;
 var imageCapture;
 var photo;

 function captureimage(){
 imageCapture = new ImageCapture(firstVideoTrack);
 imageCapture.takePhoto().then(function(blob) {
 photo = URL.createObjectURL(blob);
 var formData = new FormData();
 "FILES[]", photo

 url: "upload_camimages.php",
 type: "POST",
 enctype: 'multipart/form-data',
 processData: false, // Important!
 contentType: false,
 cache: false,
 data: formData,



Link to comment
Share on other sites

  • 0


Thank you for your contribution to the community.

I am sorry to say this but 2.2.1 version is problematic with the previews, I don't recommend to use previews in that version ( https://github.com/ant-media/Ant-Media-Server/issues/2801 )

You can indeed capture the stream from client side in the javascript, you can draw the stream on top a canvas and get the image from toDataUrl method if client side capturing is good enough for you.



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...