Skip to content

Instantly share code, notes, and snippets.

@hxtree
Created October 17, 2019 20:20
Show Gist options
  • Save hxtree/279d428779b9269b2043c0f9405475c5 to your computer and use it in GitHub Desktop.
Save hxtree/279d428779b9269b2043c0f9405475c5 to your computer and use it in GitHub Desktop.
PHP IP Camera Image to Movie
<?php
// save the image locally
$image = file_get_contents('http://ipcamera.example.com/oneshotimage');
$datetime = new DateTime();
$filename = $datetime->format('Y-m-d H:i:s') . '.jpg';
file_put_contents($filename, $image);
/*
*
* Afterwards, compile video, e.g.
*
* mencoder mf://*.jpg -mf w=1920:h=1080:fps=25:type=jpg -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=16000:keyint=15:mbd=2:trell -oac copy -o output.avi.
*
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment