flv to swf setting
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...
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
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.
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: ww.demetri-media.com/Sven/iconRollOut2.swf ( "raw"swf again, so resize your browser smaller)
i can show you what i did if you want to adapt it to your design.
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!
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.
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 ! )
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.
arrays - yes - that is exactly what they are for !
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...
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...
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?
So I fixed a coding issue and I've got it working pretty well. Thanks so much for all the insight and help!
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
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...