Retrieve the direcotry of a camera image

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
parallax1978
Forum Newbie
Posts: 2
Joined: Fri May 18, 2007 9:40 am

Retrieve the direcotry of a camera image

Post by parallax1978 »

Hi. I am trying to build a page that has a feed from a camera. The way it works is that the page retrieves a .jpg image stored in a buffer on a network security camera and displays it on a page. It then updates every X amount of seconds and displays the image stored in the buffer at that time; http://www.coastal.edu/tour/webcam/ is an exact example of what I am talking about. I have my site set up to do this with html by entering the static IP address and the path to the .jpg file of the camera, then refresh the page every 15 seconds. That site is here http://www.theentropyeffect.com/mbc/camera.htm the problem I am having is that the UID portion of the file name changes periodically and makes the web page unable to get the image from the camera without me going in and modifying the code. The coastal site (the example I used above) uses a php script to get the image from the camera, I was wondering if anyone knows the coding technique used to accomplish this, or another approach to getting the file name on the camera and displaying it on the web page. Any help would be greatly appreciated.
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post by Grim... »

If the image is always stored in the same directory, you could just display the most recent file.
file() has some sample code that should get you started.
parallax1978
Forum Newbie
Posts: 2
Joined: Fri May 18, 2007 9:40 am

Post by parallax1978 »

Thanks I will look through it. Just to be clear something like http://24.172.32.182:82/cgi-bin/cameraid?UID=754 will display the image. The problem is the last part changes from time to time so I just need to get that file name with whatever value 'UID' currently has, so the image will always display. Thanks for your advice.
Post Reply