Jump to content

IP Camera stream recording


ironman_75

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/274736-ip-camera-stream-recording/
Share on other sites

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).

  • 1 year later...

$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)

 

 

It is not done please help a little bit more

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.