ironman_75 Posted February 20, 2013 Share Posted February 20, 2013 Hi, Im trying to accomplish the following wo any success and are hoping for some help from the experts here. Im really a beginner... I have a Foscam IP camera (8910w) were i by URL (http://x.x.x.x:80/videostream.cgi) can look at live streaming. (Camera got build in web server) I would like to record this live stream and and save it into my dropbox account as soon as i execute a HTTP request. Steps: 1. HTTP Request executed (Containing parameter for x minutes of recording) 2. Get video stream from CGI URL above and start recording for x minutes 3. Save file (mpeg, m4v) 4. Upload file to dropbox folder The HTTP request will be triggered from my Home automation system or manually. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/274736-ip-camera-stream-recording/ Share on other sites More sharing options...
requinix Posted February 20, 2013 Share Posted February 20, 2013 (edited) Do an fopen/fread/fclose loop that watches the time. $input = fopen(stream) $output = fopen(output file) $end = time() + however many seconds you want to record do { fwrite(fread($input, some amount you determine)) } while time() <= $end fclose($output) fclose($input) Do a bit of trial and error with the amount read in: too high and you'll get more than X minutes of video, too low and you'll waste CPU and potentially get less than X minutes (though probably not by much). Edited February 20, 2013 by requinix Quote Link to comment https://forums.phpfreaks.com/topic/274736-ip-camera-stream-recording/#findComment-1413693 Share on other sites More sharing options...
ZohaibKhalid1 Posted October 17, 2014 Share Posted October 17, 2014 $input = fopen(stream)$output = fopen(output file)$end = time() + however many seconds you want to recorddo { fwrite(fread($input, some amount you determine))} while time() <= $endfclose($output)fclose($input) It is not done please help a little bit more Quote Link to comment https://forums.phpfreaks.com/topic/274736-ip-camera-stream-recording/#findComment-1493978 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.