face-api.js icon indicating copy to clipboard operation
face-api.js copied to clipboard

videojs - as input source

Open prtvora99 opened this issue 6 years ago • 9 comments

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 ?

prtvora99 avatar Dec 06 '18 11:12 prtvora99

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

justadudewhohacks avatar Dec 06 '18 16:12 justadudewhohacks

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

prtvora99 avatar Dec 07 '18 07:12 prtvora99

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

justadudewhohacks avatar Dec 07 '18 08:12 justadudewhohacks

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

prtvora99 avatar Dec 07 '18 11:12 prtvora99

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.

jeffreytgilbert avatar Jun 21 '19 19:06 jeffreytgilbert

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

webdev778 avatar Aug 02 '19 20:08 webdev778

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

justadudewhohacks avatar Aug 05 '19 05:08 justadudewhohacks

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

lonelygraywolf avatar Apr 26 '21 17:04 lonelygraywolf

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.

jeffreytgilbert avatar Apr 26 '21 19:04 jeffreytgilbert