Skip to content

Instantly share code, notes, and snippets.

@megasaturnv
Last active January 16, 2018 14:42
Show Gist options
  • Save megasaturnv/a42ed77d3d08d0d3d91725dbe06a0efe to your computer and use it in GitHub Desktop.
Save megasaturnv/a42ed77d3d08d0d3d91725dbe06a0efe to your computer and use it in GitHub Desktop.
Display snapshot from usb webcam camera /dev/video0 on a webpage. No temp file. Uses avconv command
<?php
//Megasaturnv 2018-01-16
header("content-type: image/jpeg");
// Change this resolution to match your camera \/
echo passthru("avconv -f video4linux2 -i /dev/video0 -vframes 1 -s 1920x1080 pipe:.jpg 2>/dev/null");
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment