#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Posts
    6
    Rep Power
    0

    sequential images on website


    Okay, I really don't know where else to go for any advice on this, or even what to search for...hell, i don't know if this is possible or not even

    Okay, I have some webcam software (Peephole 3) that I want to use for a webpage. We are hosting a LAN party this weekend, and want to have a live image from the event on our website. This program will let you overwrite an image every xx seconds, or save in order (like, image001.jpg, image002,jpg, etc).

    The webcam software takes a picture every 30 seconds, and the webpage refreshes every 30 seconds. My question is...

    If i were to take the pics and have them saved like livefeed001.jpg, livefeed002.jpg, etc, is there any script i could use to have the page load the picture that has the highest number? I really want to have an archive of all these pics, and I can't think of any other way to do it.

    Any help is GREATLY appreciated.

    Thanks In Advance!
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Posts
    6
    Rep Power
    0
    actually, if anyone could give me some good JS that would make the pic refresh every 30 seconds instead of using the meta tag to do it, that would be great too.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    this is the server-side java forum.
    you need to get into streaming and use RealMedia, MPEG or maybe Flash. but for a lan-party, this is probably much oversized. guess you are wrong here.

    if you would have asked in client-side JavaScript forum, i would have told you:
    - save all images with the same name, no numbers.
    - and use: <meta http-equiv="refresh" content="30; url=...your url here...">
    for a quick-n-dirty solution.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Posts
    6
    Rep Power
    0
    no no.....i don't want to do any live streaming. i just want a different still-image on the site every 30 seconds. i already have that meta tag in there for the auto-reload.

    lemme re-explain....i want to have an archive of all the shots, but if i archive all the shots, i don't know how to put the most current on on the website
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    hard to do without server-side programming. how would you know the current number?
    maybe mix the two solutions, make the webcam write the file to a sequentally numbered AND to one that always has the same name...
    my webcam came with a pre-made java applet, but i canīt remember if it kept a "history" of the old files...
    you could need some server side code that always inserts the right picture (-number). do you have access to any server side programming languages for this?
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Posts
    6
    Rep Power
    0
    i'll be honest with you ...i have no idea what you mean by server side

    but, i will tell you this, the server is running on my computer with apache, so i guess if you are saying i would need to put any java script stuff on the server, that is not a problem,

    and, as far as saving sequentually and overwriting a file, the software will NOT do both, and i have tried about 10 programs.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    hmmm. we have a basic understanding problem here.

    let me try to explain:
    there is two partys for an internet connection. for the www, this is:
    - you, using your browser (internet explorer, netscape, ...). this side is called the client.
    - the other one that has the html documents and stuff you want to read. this is called the server.
    a program can run on any of these, giving you different approaches for solving a problem.

    for you, this means:
    a) you can use a JavaScript program that runs in the browser and just counts up a number, then tries to get the file with that number.
    if the connection is dropped or delayed, you will come out-of-sync and canīt get the right pictures anymore nor can you re-sync.
    b) you can use a php / perl / ... program running on the server. you always request for instance "www.yourdomain.com/image.jpg", but the program running on the server will catch this request and deliver the image with the highest number instead. this cannot get out-of-sync as a program running on the server can actually determine the image with the highes number.

    if you can get php to run on apache (read the php manual, chapter installation. itīs easy once you found this.), you would do this for example:
    PHP Code:
    $j=0;
    for (
    $i=0;$i<100000;$i++) {
      if (
    file_exists('image'.$i.'.jpg')) $j=$i;
    }
    header("Content-type: image/jpeg");
    readfile("image".$j.".jpg"); 
    do you understand what this program would do?

    remarks:
    Additionally you would need some headers to convince the browser that it really should reload the image from the page even though the url is already in itīs cache. If you understand what i want to say, iīll look up these headers tomorrow, but right now i am too lazy
  14. #8
  15. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Posts
    6
    Rep Power
    0
    alright...i think we're starting to click here

    i DO have php installed and configured with apache...i was originally working on some pages that were going to be php based and using sql till i realized that it was way over my head.

    i know a guy here that knows php fairly well...i will see if he can help me out with the php coding (after i try what you listed).

    i will get back with ya and let you know if it worked.

    i appreciate your patience with a n00b

  16. #9
  17. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    I asked a moderator to move this thread to "beginners" as it doesnīt fit here at all. If you canīt find it here anymore, look there.
    Shiju, maybe you can even make this "sticky"?
  18. #10
  19. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Posts
    6
    Rep Power
    0
    yeah...this IS a beginners type post...and it really has nothing to do with java anymore

IMN logo majestic logo threadwatch logo seochat tools logo