Skip to content

Instantly share code, notes, and snippets.

@megasaturnv
Created January 16, 2018 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save megasaturnv/6e5965732d4cff91f2e976e7a39efbaa to your computer and use it in GitHub Desktop.
Save megasaturnv/6e5965732d4cff91f2e976e7a39efbaa 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. Image is in an <img> tag
<?php //Megasaturnv 2018-01-16 Change this resolution to match your camera \/ ?>
<img src="data:image/jpeg;base64, <?php echo base64_encode(shell_exec("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