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

Edited by requinix
Link to comment
Share on other sites

  • 1 year later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.