Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    New Coder
    Join Date
    Jun 2006
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Save snapshot web camera

    Hi,

    I have a web site called www.yarmouthportal.com and I currently pay a lot of money for someone to proide me with a couple of benifits such as Saving a Snapshot and Emailing a Snapshot.


    Now I am able to get a temporary (updates when the browser refreshes) snapshot from the camera but I don't know how to upload the image to my server. Currently I would have to right click then save as. I want this to be a bit more user friendly such as the one currently www.yarmouthportal.com/camera/index.php

    Can anyone please help me?

    Thanks

  • #2
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,369
    Thanks
    8
    Thanked 1,075 Times in 1,066 Posts
    Could you show us how you get the photo?
    Perhaps you're using a PHP script already, or Javascripting?

  • #3
    New Coder
    Join Date
    Jun 2006
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    Ok this is the image location http://217.155.209.14:2220/SnapshotJ...ality=Standard

    This is updated every time you refresh.

    I want to be able to include that in my Yarmouth Portal site and then when I click "Save Snapshot" it will prompt me to save this image to my computer.

    Thanks for any help

  • #4
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,369
    Thanks
    8
    Thanked 1,075 Times in 1,066 Posts
    I'm just confused here ...

    On this page:
    http://www.yarmouthportal.com/camera/index.php

    You already are displaying the webcam shot and there are
    links to email or save. How is this different from your question?

    ... and this link times-out:
    http://217.155.209.14:2220/SnapshotJ...ality=Standard

  • #5
    New Coder
    Join Date
    Jun 2006
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry,

    On the Yarmouth Portal site features an existing program which I pay a lot of money every month for. I can't afford to pay it and I know that there is a way to do it myself. Somehow.

  • #6
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,369
    Thanks
    8
    Thanked 1,075 Times in 1,066 Posts
    So do you have a link where you can get your camera image?

    .... a way to view the photo for free? (or is that part of the package)?

    Somewhere along the line, that webcam is hooked up to a PC or something
    that puts the image on the internet. Is that part of your system, or are you
    paying for that?

  • #7
    New Coder
    Join Date
    Jun 2006
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is the snapshot direct from the camera http://217.155.209.14:2220/SnapshotJ...ality=Standard

    As i said everytime the page is refreshed the image will change unless it has been saved.

  • #8
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,369
    Thanks
    8
    Thanked 1,075 Times in 1,066 Posts
    OK,

    I'm going to look for a PHP solution to this.
    A way to grab the image and create some options
    to save or email.

    Until then, someone may jump in with another solution.

  • #9
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    ok , first off who `owns` the webcamera ? and the bandwidth it uses... they need to give you permission to use images from it, if thats the case then the solution is easy, but if you don't have rights to use the image then we can't help you `grab` it here.

    Please advise.

    actually, it appears possible for anyone to control that camera ... not good!
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #10
    New Coder
    Join Date
    Jun 2006
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks I would really appreciate the help.

    The site, IP address and Web Camera are all mine and I have full rights to them.

    The camera can be controlled by anyone by using up to 8 presets. This is as far as a guest user can go.

    Regards

  • #11
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    OK...
    PHP Code:
    <?php
    /*where to get*/
    $url="http://217.155.209.14:2220/SnapshotJPEG?Resolution=320x240&Quality=Standard";
    /*where to put*/
    $img_path='/home/fire/Desktop/snap'.mktime.'.jpg'

    $yaks=file_get_contents($url);
    $fp=fopen($img_path,'wb');
    fputs($fp,$yaks);
    fclose($fp);
    ?>
    I put a timestamp at the end of the filename but whatever...
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #12
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    ah ok missed the bit about saving the image..

    you could run the above code when someone clicks the 'save image' button then ... pass the img_path to something like this
    PHP Code:
    <?php
    function force_download($path){
               
    $file=basename($path);
               
    header("Content-Type: application/octet-stream");
               
    header("Content-Type: application/force-download");
              
    header("Content-Length: $size");
               
    // Required to get around the MSIE 5.5 Bug of downloading filname.php
               
    if(preg_match("/MSIE 5.5/"$_SERVER['HTTP_USER_AGENT']))
               {

                      
    header("Content-Disposition: filename=\"$file\"");
                                } else
                {
                       
    header("Content-Disposition: attachment;filename=$file");
                                 }
               
    //header("Content-Transfer-Encoding: binary");
               
    $fh fopen($path"rb");
               
    fpassthru($fh);
    }
    ?>
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #13
    New Coder
    Join Date
    Jun 2006
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi

    ok code looks great.

    Excuse me if I am being stupid but how would I pass the image onto the next script you posted?

    I really appreciate your help!

    Regards

  • #14
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,369
    Thanks
    8
    Thanked 1,075 Times in 1,066 Posts
    James ...

    I was also looking into using PHP GD library for doing something like
    putting a watermark or text directly on the image ... maybe to indicate
    camera location, time, etc. Would you be interested in anything like that?

    Firepages provided the good stuff for saving image, much better than the
    solution I had, so go with that.

  • #15
    New Coder
    Join Date
    Jun 2006
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi all I am always looking for ways to improve what I have.

    Firepages, I really appreciate the help but i'm not sure how to implement this script. I tried just running the first script alone but it just spat loads of errors at me beginning from line 7.

    If you could help me I would really appreciate it.

    Regards,

    James


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •