Skip to content

how to run face api from mp4 file? #139

Answered by vladmandic
psw7420fusion asked this question in Q&A
Discussion options

You must be logged in to vote

If all you want is to use video instead of webcam, simply remove section of the code from webcam.js that initializes webcam:

face-api/demo/webcam.js

Lines 102 to 130 in fb38360

log('Setting up camera');
// setup webcam. note that navigator.mediaDevices requires that page is accessed via https
if (!navigator.mediaDevices) {
log('Camera Error: access not supported');
return null;
}
let stream;
const constraints = { audio: false, video: { facingMode: 'user', resizeMode: 'crop-and-scale' } };
if (window.innerWidth > window.innerHeight) constraints.video.width = { ideal: window.innerWidth };
else constraints.video.height = { ideal: window.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@psw7420fusion
Comment options

Answer selected by vladmandic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants