all groups > flash actionscript > september 2004 >
You're in the

flash actionscript

group:

projector with flv cuepoints:performance TERRIBLE


projector with flv cuepoints:performance TERRIBLE pierrego
9/11/2004 2:51:38 PM
flash actionscript:
summary:
* Using Flash MX 2004 Pro
* flv playback using media display component
* subtitle display, subtitles loaded using 'loadvars' from external textfile
* cuepoints created on load of the text file to display proper subtitle at the
appropriate time
* playback choppy, sluggish, and even crashes; performance is terrible

details:
I have created a projector that loads and displays an .flv (using 2004 MX PRO
media display component). While the video plays, subtitles are to be shown. I
have chosen to have the end-user be able to turn on or off the
subtitle display by pressing a button. This is accomplished by creating an mc
that reads in a text file that defines the times the subtitles are to be
displayed, along with the subtitle text. This text file is read in before the
video playback, an array of all the subtitle text is created and filled, and
cuepoints are created to sync the display of the subtitle text with the
flv playback.

The problem, is that now that all the code works and does what I want,
(subtitles can be hidden on the press of a button, the text is all synched,
etc) the performance is TERRIBLE! the playback struggles, hiccups, and
sometimes I get the dreaded "the script in this movie is causing Macromedia
flash player 7 to run slowly, if it continues to run, your computer may become
unresponsive. Do you want to abort this script?" error. NOT acceptable for
CDROM distribution.

The text files themselves are not that large (the largest is 35k). The number
of cuepoints aren't that many (the most cuepoints for one flv is 430, is that
'too many'?). The longest video is about 5 minutes long, at 12 fps (and yes,
they've all been squeezed).

The videos without any of the cuepoints defined play beautifully, but with all
these 'synch' points loaded and the subtitles being displayed, they're
unwatchable.

what can I do? I've been careful to unload all the previous video before
loading a new one. Are there some performance tricks I should be aware of that
I'm not using? I can't think of a better way to have subtitles being displayed
without embedding them in the video (which I DO NOT want to do, it's tedious
and slow, and prone to error). The whole reason I switched to MX Pro was this
cuepoint method, which isn't really working out for me.

Any performance tricks you can pass along will be greatly appreciated.
Re: projector with flv cuepoints:performance TERRIBLE Rothrock
9/11/2004 3:46:48 PM
My first thought was that you were using two high a frame rate, but then you
mentioned 12 fps. (By the way what is the frame rate of the parent movieclip?)
How big are the flvs? Pixel dimension and or datarate?

430 cuepoints? Yes that does seem pretty extreme to me. I have been doing some
things using about 2 minute videos and they have about 40. But hey, if you need
them, you need them.

When you say the largest file is 35K do you mean the subtitles and cuepoints
for an entire clip or is that for just one subtitle?

Do you get this problem when you run it locally off the hard drive? Or is it
only from the CD?

Ususally the unresponsive error is some kind of loop that is repeating too
many times within a frame. Perhaps you have made a coding error? Can you share
the parts about creating and showing the cuepoints? It might help.


Re: projector with flv cuepoints:performance TERRI pierrego
9/11/2004 6:04:52 PM
The frame rate of every mc clip in the presentation is 12 fps. I can see that
even on my raided P4 2.8 GHz development machine, that things run a little
slow, but then when I put it on CD and take it to the 400MHz 'test' machine, it
dies a horrible death. I'll have to check the encoding rate, I can't quite
remember off the top of my head (I used the CD setting in squeeze 3.5, and
dialed it down slightly)

The method I use is to load the movie, and load the text file, load up all the
variables, then play the movie when the variable loading is done. I've used a
listener to watch the flv cuepoints playback to trigger different lines of
text being displayed as subtitles.

The smaller video files play fine (the ones around a minute or so), but the
longer ones (the 5-7 minute in length) is when I get into problems. There's
more dialog, so, there's more subtitles which makes the text files bigger, but
35k really isn't that much.

Here's an excerpt from one of the text files I was describing:

&total=374&
&time_0=0&subtitle_0=&
&time_1=8&subtitle_1=How many of you remember your first kiss?&
&time_2=11&subtitle_2=Maybe it was your puppy, your cat, maybe your
grandmother.&
&time_3=14&subtitle_3=You probably don't remember it, but I use this slide to
sort&
&time_4=17&subtitle_4=of bring me back to some first-time memories.&
&time_5=20&subtitle_5=I remember the first time I experienced a&
&time_6=23&subtitle_6=disability. I was drag racing on the way to school one
day,&
&time_7=26&subtitle_7=and I had just beaten my buddy who had a 911 Porsche,
and I&
&time_8=29&subtitle_8=was in a 1965 Dodge Dart with a small block engine, high&
&time_9=32&subtitle_9=performance. And when a, you know, red-neck kid beats a
city&
&time_10=35&subtitle_10=kid in a drag race across the grids, he wants to get
to&
&time_11=38&subtitle_11=school and tell everybody else about it. Well, in the&
&time_12=41&subtitle_12=process of trying to beat him to school I spun out in
the&
&time_13=44&subtitle_13=rain into the oncoming lane of traffic and broke my
back,&
&time_14=47&subtitle_14=severed my spinal cord, fractured three ribs, and
severed one&
&time_15=50&subtitle_15=lung.&
&time_16=53&subtitle_16=Needless to say, it was the most&
&time_17=56&subtitle_17=catastrophic event that had ever happened to me up to
that&
&time_18=59&subtitle_18=point in my life. I woke up the next morning
paralyzed from&
&time_19=62&subtitle_19=my shoulders down, and after a month of observation a
doctor&
&time_20=65&subtitle_20=comes in and gives me the news. Mr. Smith, Don be thy&
&time_21=68&subtitle_21=name, you are never going to walk again.&
&time_22=71&subtitle_22=Well, aside from calling him names and a&
&time_23=74&subtitle_23=few other things that happened that day, my life and
my&
&time_24=77&subtitle_24=perspective about my life changed drastically.&
.
.
.
&EOF=true
AddThis Social Bookmark Button