With AWS Rekognition I was able to get faces detected in a mp4 video with the following nodejs,
var AWS = require("aws-sdk");
AWS.config.update({
region: "us-east-1"
});
var rekognition = new AWS.Rekognition();
var params = {
Video: { /* required */
S3Object: {
Bucket: 'videobucket',
Name: 'testvideo.mp4'
}
},
FaceAttributes: "ALL",
NotificationChannel: {
RoleArn: 'arn:aws:iam::xxx:role/xxx', /* required */
SNSTopicArn: 'arn:aws:sns:us-east-1:xxx:alerts' /* required */
}
};
rekognition.startFaceDetection(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
And was able to get the results with the following cli,
aws rekognition get-face-detection --job-id xxxxxxx
and outputs the faces in the following json format,
{
"Faces": [
{
"Timestamp": 0,
"Face": {
"BoundingBox": {
"Width": 0.029999999329447746,
"Top": 0.2588889002799988,
"Left": 0.29374998807907104,
"Height": 0.052222222089767456
},
"Landmarks": [
{
"Y": 0.28277161717414856,
"X": 0.3052537739276886,
"Type": "eyeLeft"
},
{
"Y": 0.27957838773727417,
"X": 0.3085327744483948,
"Type": "eyeRight"
How to extract those faces as images and dump them in an s3 bucket?
Thanks