Created
October 17, 2019 20:20
-
-
Save hxtree/279d428779b9269b2043c0f9405475c5 to your computer and use it in GitHub Desktop.
PHP IP Camera Image to Movie
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
<?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