Solved

FLV looping problem...

Posted on 2009-05-07
2
318 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:mingchih
2 Comments
 
LVL 9

Expert Comment

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Inserting a pop up image to a scanned PDF 5 424
Stop Ads in Browser Google Chrome 3 525
File drag and drop 6 127
Google Chrome pepflashplayer.dll 8 113
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

744 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

17 Experts available now in Live!

Get 1:1 Help Now