justadudewhohacks / face-api.js

JavaScript API for face detection and face recognition in the browser and nodejs with tensorflow.js
MIT License
16.37k stars 3.65k forks source link

videojs - as input source #159

Open prtvora99 opened 5 years ago

prtvora99 commented 5 years ago

i'm using video.js for playing the rtmp videos... which generates it's own html code... and i'm not able to give the same thing as an input to the face-api... how can I send input from video.js as html element to the face-api ?

justadudewhohacks commented 5 years ago

Well what is the type of the input you get out of video.js?

prtvora99 commented 5 years ago

vdjs-creen

As shown in the photo, i have some generated html stuff, which plays my rtmp live stream, so i'm not able to send this input to face api, as it requires html Image or html Video tags

justadudewhohacks commented 5 years ago

I see an video element in the dom tree. You can pass HTMLVideoElement as an input to the API too, see this.

prtvora99 commented 5 years ago

playing-vdjs

Actually while video starts playing, the above one html tree is generated, mistakenly I sent you initial html tree...(sorry for that) the

this is the error description:: Uncaught (in promise) Error: toNetInput - expected media to be of type HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | tf.Tensor3D, or to be an element id

jeffreytgilbert commented 5 years ago

That doesn't seem right. Video.js is an HTML5 capable video player. Why would it still be using a Flash plugin which has been disabled by nearly the entire web? Flash is blocked by default on Chrome and Safari, which represent well over half the marketshare of browsers out there. Is it possible to simply force video.js to use the HTML5 player rather than the swf player? If so, your problem should be solved. I recommend abandoning any Flash player tech as even Adobe has abandoned that project.

webdev778 commented 4 years ago

I've getting the same issue too, now I'm trying to use videojs for rtmp source, with this, trying to face detection using face-api.js. How can I solve this, justadudewhohacks I need urgent help

justadudewhohacks commented 4 years ago

I am not familar with VideoJS sorry, would be nice if anyone wants to investigate in this.

lonelygraywolf commented 3 years ago

Has anything else come up about this? So with the FaceAPI and videojs?

jeffreytgilbert commented 3 years ago

Your input source should be a canvas. Whatever comes out of Video.js and the sources/formats it can pull from must be converted to canvas data ideally. Canvas has the advantages of being zero copy when moving to background threads, and in addition, TensorFlow is used by this library and it will only support the image types it knows about.