Solved

Flash 2 frame second webcam viewer - URGENT

Posted on 2004-04-02
15
3,456 Views
Last Modified: 2010-08-05
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.





0
Comment
Question by:Nathan_London
15 Comments
 
LVL 9

Expert Comment

by:OBCT
Comment Utility
Yes.
Just preload the images.
0
 
LVL 4

Expert Comment

by:infoCatch
Comment Utility
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
 
LVL 4

Expert Comment

by:infoCatch
Comment Utility
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
 

Author Comment

by:Nathan_London
Comment Utility
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
 
LVL 4

Expert Comment

by:infoCatch
Comment Utility
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
 

Author Comment

by:Nathan_London
Comment Utility
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 4

Expert Comment

by:infoCatch
Comment Utility
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
 

Author Comment

by:Nathan_London
Comment Utility
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
 
LVL 4

Accepted Solution

by:
infoCatch earned 500 total points
Comment Utility
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
 

Author Comment

by:Nathan_London
Comment Utility
I'll check this out.
0
 

Author Comment

by:Nathan_London
Comment Utility
thanks for the help but didnt really help me. I have got someone working on code to sort my problem.
0
 

Author Comment

by:Nathan_London
Comment Utility
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
 

Expert Comment

by:SupplyMetal
Comment Utility
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

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now