Solved

FLV looping problem...

Posted on 2009-05-07
2
323 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
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 500 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
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…
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

685 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