Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

FLV looping problem...

Posted on 2009-05-07
2
Medium Priority
?
327 Views
Last Modified: 2013-11-11
Hi, experts

I have the following code that works pretty well. However, it slows down the computer and use almost 50% of CPU. I would like to ask how can I fix the problem so the looping does not slow down computer. The FLV frame rate is 24fts. I think the code keep streaming from server. Is there a way to save the animation in cache and loop from cache ?

Cheers

B
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
purple_video.attachVideo(stream_ns);
stream_ns.play("purple_effects.flv");
 
 
stream_ns.onStatus = function(info) {
	if (info.code == "NetStream.Play.Stop") {
		stream_ns.seek(0);
	}
};

Open in new window

0
Comment
Question by:Brian Lin
2 Comments
 
LVL 9

Expert Comment

by:asaivan
ID: 24330960
Video processing is pretty CPU intensive. It would cost the same amount of resources no matter if you were doing it from a cache or from a streaming server.
0
 
LVL 4

Accepted Solution

by:
jeremyBass26 earned 1500 total points
ID: 24342431
I ran in to this issue a long while ago... the trick is this... you need to set the Expires headers and kill the eTags... that will make flash load the flv from cache...

proof
http://www.digitalbarn.tv/work.html

if you watch the net you'll see that even thou it's streamed on the http it only calls it once...

if your on apache use the .htaccess file.. add

# 3months
<FilesMatch "\.(ico|gif|jpe?g|png|flv|pdf|swf|mov|mp3|wmv|ppt)$">
  Header set Cache-Control "max-age=7257600"
</FilesMatch>
# WEEK
<FilesMatch "\.(js|css|swf|gz|min)$">
  Header set Cache-Control "max-age=604800"
</FilesMatch>
# 45 MIN
<FilesMatch "\.(html|htm|txt)$">
  Header set Cache-Control "max-age=2700"
</FilesMatch>


# CMSMS unset ETag
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|gz|swf)$">
Header unset ETag
FileETag None
</FilesMatch>


you can read more here

http://developer.yahoo.com/performance/rules.html#expires


this will solve your issue

cheers
jeremyBass
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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,…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

971 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