FORUMS: list search recent posts

flv to swf setting

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Nicholas Hauselman
flv to swf setting
on May 15, 2009 at 11:14:02 pm

I have 2 seconds video clips that need to be turned into swfs so that when you rollover the button, the clip plays. I've exported the video to flv, imported the flv into a flash project and then exported that out to a swf - which then gets loaded into a container button.

Do I make the QT hightest res, then lower the settings while making the flv - do I keep the flv the highest settings, then lower the settings in the flash project when publishing the swf? Is this too complicated? It works well, except that there are 18 thumbnail clips and the preload is huge...

Return to posts index

demetri tashie
Re: flv to swf setting
on May 16, 2009 at 4:23:43 pm

wow. i really think that you are taking something that can be real simple, and economic( small file size) and making it much more complicated ( and big) than it should be. are you embedding the video in the SWF(big file size) ? as opposed to just referencing the flv(small file size) ?

since your question is not really about that, i will move on. but DO ask if you need help with that, i think we can really get you to a pared down, slick, fast SWF to present.

regarding your question. i also hope some of the video compression experts chime in, but i say to always start with the highest quality QT for your purposes. then, encode down to what you are presenting.
most normal video on the web ( let's say 720 x 480 ) can get away with 400 kbps using On2 VP6 codec. make it higher if there is a lot of motion.

here is a quick test example of 5 images ( all jpegs) used as roll-over triggers for 5 separate FLVs
note 1: this is a 'raw' swf NOT embedded in HTML. it will be as large as your browser is- resize your browser smaller
note 2 : don't judge the'design' of this - it is just to show functionality....
note 3: i turned the audio off on all clips
note 4: the buttons are the images on the bottom of the page

just ask if you need help or more clarification

Return to posts index

Nicholas Hauselman
Re: flv to swf setting
on May 16, 2009 at 7:49:55 pm

Thanks for the reply. I'll fill you in on what I'm doing - if there's a better way, I'm all ears:

The client wants to have rollover buttons that, when you rollover, it plays the 2 second video. When you rolloff, it returns to the first frame. So the up state of the button needs to be the first frame of the video. So here's what I did: I spit out a hi-res 2 second clip, made it into a hi-res flv, then imported it into the timeline of a flash project, put a button on top of it, then exported that. I then created a container to load all the swf buttons into. This container will then move and act as an infinite scrolling menu.

Since the container needs to scroll, I need to preload all the swfs first so they're ready to be seen when you scroll to them. Since the playback of the video needs to be controlled by rolling over it, I needed to create a swf - rather than create a flvplayback instance and have it progressively play.
Please let me know how I made this too complicated - I've got it working for the most part, but there could be as many as 18 buttons and each button is 50 kb right now, and the quality is sub-standard.

Return to posts index

demetri tashie
Re: flv to swf setting
on May 16, 2009 at 9:33:06 pm

i am not so sure about that. as a test. i made a "button" out of each FLVPlayback Component.

the FLVPlayback is given an instance name "vid11" that is turned into a MovieClip, so it can be scripted better for Rollover and Rollout. that Movie Clip is given an instance name "vid1"

likewise for FLVPlayback Components called vid22 - vid55 turned into Movie Clips named vid2 - vid5

vid1 - vid5 are gouped into a new Movieclip/Container instance name "vid". this was just to prove that those independent clips with video are in a unique clip. as visual proof, i made the overall "vid" clip draggable ( it should now be easily scripted to scroll, etc )

the videos are scripted to play on rollover, and to stop playing and return to firrst frame on roll out. i think that is what you had done also, but scripted the swf with the embedded video, rather than the empty flv player with its external flv. make sense ?

so now all these external FLVs are loading into this file to be Rolled Over and Rolled Out. all seems to work fine. that whole exported SWF is now just 53kb, a very small, manageable size. your graphics will add more weight, of course, but it will still be manageable.

the test is here: ( "raw"swf again, so resize your browser smaller)

i can show you what i did if you want to adapt it to your design.

Return to posts index

Nicholas Hauselman
Re: flv to swf setting
on May 17, 2009 at 1:17:26 am

Based on your sample videos, I would say "Spasiba" - but perhaps it is "Efcharisto" !!

Since I needed rollover control, I didn't consider the playback component, but this looks like it could solve my problem. In theory, based on your design, it doesn't matter how large the external .flvs are since it'll progressively play and they would all load enough to at least have the first frame visible before people rollover it - right?

If you wouldn't mind, I'd love to see the code you placed in the empty player - was it in a class path?

Again, thanks for letting me see a more elegant solution to something that made me go almost insane with the amount of work I did on it!

Return to posts index

demetri tashie
Re: flv to swf setting
on May 17, 2009 at 1:56:15 am

right you are - have as many videos/buttons as you want, and the videos ( FLVs) can be as long as you want, the file size will not change....

this is the code. there was no special/external class or anything. these are all standard Methods in the MovieClip and Video Playback Classes.

normally i try to make my functions more modular or concise, with less lines of code, buit for demonstration purposes i wrote them all out 'long-hand'. it should give you a much clearer idea of what is going on, and how to modify it to your needs.

vid.addEventListener(MouseEvent.MOUSE_DOWN, fun100);
vid.addEventListener(MouseEvent.MOUSE_UP, fun111);






vid.vid1.addEventListener(MouseEvent.MOUSE_OVER, fun1);
vid.vid2.addEventListener(MouseEvent.MOUSE_OVER, fun2);
vid.vid3.addEventListener(MouseEvent.MOUSE_OVER, fun3);
vid.vid4.addEventListener(MouseEvent.MOUSE_OVER, fun4);
vid.vid5.addEventListener(MouseEvent.MOUSE_OVER, fun5);

vid.vid1.addEventListener(MouseEvent.MOUSE_OUT, fun10);
vid.vid2.addEventListener(MouseEvent.MOUSE_OUT, fun20);
vid.vid3.addEventListener(MouseEvent.MOUSE_OUT, fun30);
vid.vid4.addEventListener(MouseEvent.MOUSE_OUT, fun40);
vid.vid5.addEventListener(MouseEvent.MOUSE_OUT, fun50);

function fun100(evt:MouseEvent):void { vid.startDrag(); }
function fun111(evt:MouseEvent):void { vid.stopDrag(); }

function fun1(evt:MouseEvent):void {; }
function fun2(evt:MouseEvent):void {; }
function fun3(evt:MouseEvent):void {; }
function fun4(evt:MouseEvent):void {; }
function fun5(evt:MouseEvent):void {vid.; }

function fun10(evt:MouseEvent):void { vid.vid1.vid11.stop();; }
function fun20(evt:MouseEvent):void {vid.vid2.vid22.stop();; }
function fun30(evt:MouseEvent):void { vid.vid3.vid33.stop();; }
function fun40(evt:MouseEvent):void { vid.vid4.vid44.stop();; }
function fun50(evt:MouseEvent):void { vid.vid5.vid55.stop();; }

you will of course have to adjust this if you are using AS2, and you will also have to test and add code for your scrolling feature. the theory should all be the same.

let's know how it goes ! happy coding !

( and 'efharisto' is the correct choice ! )

Return to posts index

Nicholas Hauselman
Re: flv to swf setting
on May 17, 2009 at 2:07:52 am

Thanks - I will have to make these into arrays, since hard coding it would be tedious. This looks like a great solution. I will let you now how it goes.

Return to posts index

demetri tashie
Re: flv to swf setting
on May 17, 2009 at 2:31:41 am

arrays - yes - that is exactly what they are for !

Return to posts index

Nicholas Hauselman
Re: flv to swf setting
on May 18, 2009 at 10:18:21 pm

Do you know how to add the flvplayback component to the stage using AS3? I want to do it in an array instead dragging 18 components on stage and having to give them all instance names...

Return to posts index

demetri tashie
Re: flv to swf setting
on May 18, 2009 at 11:21:31 pm

there is probably more streamlined code for this, but this should do it long-hand style....
i don't normally add a player all in code. i find it easier to use a playback component, but to script all my own playback functions, to avoid the pre-fabbed 'skins'.

( once a Playback component is placed on the stage, it is also placed in the Library, with Linkage. You should be able to use that Linkage to add a Child. i might try that later, when i have time....) i'd love to hear if anyone else does it that way, or has a better way...

import flash.display.*;

var vidNetCon:NetConnection;
var vidStream:NetStream;
var vid:Video;
var vidURL:String;

vidNetCon = new NetConnection();
vidStream = new NetStream(vidNetCon);

vid = new Video();

Return to posts index

Nicholas Hauselman
Re: flv to swf setting
on May 19, 2009 at 1:51:32 am

Here's my next issue - I've got the movie clips with the component inside for all the clips - and I've even got those inside a sprite container so that I can scroll it. What I found out is that Flash freaks if you try and assign two flvplayback components the same source.

Here's my next issue: To create a traditional infinite scrolling menu, I need to duplicate the sprite container that contains all the clips with the playback components in them.

In theory, I could just double the number of clips (based on an external xml list) and assign the duplicates the same source - but when I test the movie, Flash just hangs and can't seem to execute the script. Does this sound like familiar behavior to you?

Return to posts index

Nicholas Hauselman
Re: flv to swf setting
on May 19, 2009 at 4:09:12 am

So I fixed a coding issue and I've got it working pretty well. Thanks so much for all the insight and help!

Return to posts index

demetri tashie
Re: flv to swf setting
on May 19, 2009 at 12:09:27 pm

i am glad you got it working at this point ! please post a link so we can see the final result .

and for all other: Flash CAN handle having multiple players, all with the same source, as long as those players all have unique instance names

Return to posts index

Nicholas Hauselman
Re: flv to swf setting
on May 19, 2009 at 3:35:49 pm

I have encountered some errors with having so many playback components on the stage. Safari was giving me an error like "too many open files" - I was using dummy FLVs that were much larger than what I'll actually use. It seems a little more stable if I have 18 instances and the streams are 500k or so. They're all 2 second clips, so I'm pretty sure the flv size can be hi-res and be very small...
Are you aware of a maximum number of playback components you can have on a stage?
>> I checked the error out - I think the cache gets full, so I need to make sure the clips are small - Firefox handles it - Safari can't >>
Here's the example with random flv's that I could find on my computer that were under 1 MB...
When it's finished, I'll post it...

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved