Last active
May 22, 2016 02:43
-
-
Save w4ilun/fba741839e3d1c744e60ab8d0396b0ed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var childProcess = require('child_process'); | |
| //take a snapshot using the webcam with ffmpeg | |
| childProcess.exec('/home/root/bin/ffmpeg/ffmpeg -loglevel panic -y -s 320x240 -f video4linux2 -i /dev/video0 -vframes 1 ./capture.jpeg'); | |
| /*********************************************************** | |
| ffmpeg flags: | |
| * -loglevel - set the logging level used by the library | |
| * -y - overwrite output files without asking | |
| * -s - set frame size WxH | |
| * -f - force format | |
| * -i - input filename | |
| * -vframes - set the number of video frames to output | |
| * ./capture.jpeg - output name | |
| ***********************************************************/ | |
| var gcloud = require('gcloud')({ | |
| projectId: 'YOUR_PROJECT_ID', | |
| keyFilename: 'YOUR_KEY_LOCATION' | |
| }); | |
| var vision = gcloud.vision(); | |
| vision.detectLabels('./capture.jpeg', { verbose : true }, function(err, labels){ | |
| if(err){ | |
| console.log(err); | |
| }else{ | |
| console.log(labels); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment