Flash 2 frame second webcam viewer - URGENT

I have asked this question of the JAVA people.

I have a cam FTP uploading a file called cam0.jpeg  a couple of times a second to a web server.
This is something you see all over the web. Like http://www.earthcam.com/usa/newyork/timessquare/

Usually then flash or a Java applet refreshes the image.

My problem is the image is always broken because the file is being constantly uploaded.

Can Flash be made to view just one file constantly changing at 1-2 frames a second without viewing the half loaded images?

I still haven’t really got a definitive yes or no.





Nathan_LondonAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
infoCatchConnect With a Mentor Commented:
I have uploaded the source files here to help you get started:

        http://www.infocatch.com/livecam.zip

See readme.txt for info.

Norbert
0
 
OBCTCommented:
Yes.
Just preload the images.
0
 
infoCatchCommented:
Is this what you want?

http://www.sunsetbeachbar.com/livecam

Let me know. If this is what you need, I'll post the code here.
0
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
infoCatchCommented:
Just for background:

The constantly updating image that mimics motion, viewed through a java applet of activex control is NOT one that's uploaded through FTP.

Rather, it uses (HTTP server push) nph-cgi (non-parsed-headers) to continuously upload one single file (usually a MJpeg). The java applet reads the file as it comes in; whenever it encounters a Content-Type and Content-Length header, it displays that part of the file as a single jpeg image.

Since you're talking about several frames a second, I doubt that FTP will work for you at all (either with or without Flash). You would have to create a buffer of images on the server and tell Flash to grab the newest complete image. This way, users with varying connection speeds will still be able to upload a complete image (i.e. it won't get destroyed by a newer one).

Probably a better option would be to rebroadcast the stream from your local machine with CURL or some such. Get ready for a lot of tinkering...

HTH
0
 
Nathan_LondonAuthor Commented:
Im not sure what you mean when you say its not uploaded via FTP. The source of the video is a server in location A. The images are FTPed to a server at location B. The upload of the files with the bandwidth is fine for the frame rate as its currently doing it fine.

Not taking about FTPing to the client.

The client is uploading from their browser via normal http. Client pull.



0
 
infoCatchCommented:
Two comments:

1. I was referring to what you said here:

  > Usually then flash or a Java applet refreshes the image.
  > My problem is the image is always broken because the file is being constantly uploaded.

Cam --- Server --- Clients           |   This won't work for streaming cameras.  
      FTP        HTTP                     | (i.e. the situation where a Java applet is normally used)

2. If you want to avoid broken images, you can
    a) let your camera upload a temporary image and then rename it.
    b) upload several uniquely named (timestamped) images to act as a buffer.

To check whether an image has completed loading, Flash has methods such as:
   myImage.getBytesLoaded()
   myImage.getBytesTotal()







0
 
Nathan_LondonAuthor Commented:
ok excellent that answer the question. So if uploading a single file broken files will always appear.. That’s what i expected.

The timestamp or sequential named files is what i have assumed would be the solution. This I can set up and the source.

ok, where can i get a buy/download/Flash program I can configure to do this for me?

N
0
 
infoCatchCommented:
Since soliciting business on EE is a no-no, I think you'll have to look at a qualified developer in your area if you require a custom application.

However, I notice you didn't comment on the Sunset Beach Bar LiveCam, see link above.

I believe that application could be modified to suit your needs. Right now, the camera uses FTP to send a new image to the server every 20 seconds. The Flash app checks with the server every 7 seconds for an updated image by checking for the size of the file.  Whenever a new file is available, Flash downloads the image in the background and swaps it with the previous image when done.  

My approach would be to let camera upload a continuously rotating series of 10-20 images. Let the Flash client download the newest complete image, and when done check for what is at that point the newest image (so you don't run into problems with users that have slower connections). And so on...


0
 
Nathan_LondonAuthor Commented:
I didnt know you are not allowed to Solicit business!
Yes the Sunset Beach Bar LiveCam is fine yes. Just needs to be quicker. What you suggest is what im after.

So where can i go to solicit business? Just need someone to do it then!

0
 
Nathan_LondonAuthor Commented:
I'll check this out.
0
 
Nathan_LondonAuthor Commented:
thanks for the help but didnt really help me. I have got someone working on code to sort my problem.
0
 
Nathan_LondonAuthor Commented:
Yes I agree. But the answers didnt solve the problem. Thats why i gave a C. Change it to whatever you like its cool.
 
0
 
SupplyMetalCommented:
infoCatch,

Your response was right in line with what I am looking for... do you have an updated link to the livecam.zip?  I would like to refresh the newest 'complete' image from a set of sequential images from my webcam.

Is there a way to have Flash/Actionscript delete, say all but the 100 newest images, so the dir does not fill?

Thanks again for explaining what you have!
Regards,
Michael
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.