A Flash Developer Resource Site

Page 1 of 3 123 LastLast
Results 1 to 20 of 53

Thread: creating a seamless experience with lots of flvs

  1. #1
    Senior Member
    Join Date
    Feb 2001
    Posts
    268

    creating a seamless experience with lots of flvs

    hi.

    i have a website with a video host who walks you thru all the sections
    of the site.

    currently, we are using 50 external flv files for this experience. each one weighs around 1mb. some weigh a little less.

    every time the video host moves on the stage, we switch to another flv. why? because the background changes and we need to throw the new one in. yes, the spec is for flash 7. i know, i know...not my decision.

    we want to make it as seamless as possible so the user doesn't see
    we're loading in new flvs whenever the video host moves. but each new flv, no matter how small, will have to load to some degree before it starts playing.

    but i just did a test trying to see how quickly i can switch between 3
    of these flv files where i reset the flv via setMedia() and then
    invoked play() ( i'm using the media display component ).

    each new video needed between 1-2 seconds before it started again. this is on a live web server.

    has anyone attempted s/thing like this before? what solutions should i
    be looking for or how can i restructure my project to get around this
    problem?

    any tips are very much appreciated. thank you. -- fumeng.

  2. #2
    Senior Member
    Join Date
    Jul 2003
    Location
    Reading, UK
    Posts
    149

    don't get excited

    I don't have an answer for you except to say I have been working on something with very similar requirements.

    I am coding a game that involves in loading several flv's that tell a story. It also has to be to flash player 7.

    The flv's need to be tight so that when one stops, the following one starts without the player waiting even a very small amount of time.

    I get the same delay as you, 1-2 seconds. And that's the minimum.

    But I am using NetStream and have had to hand code all of this.

    I wonder if it is even possible to eliminate this delay.

    I don't want to sound defeatist though, so I live in hope.

  3. #3
    Senior Member
    Join Date
    Feb 2001
    Posts
    268
    hey there.

    thanks a lot for responding. no worries that you don't have a solution. i just feel better knowing that someone else is going thru the same thing. hopefully we can help each other out.

    i've been thinking this thru a little more and this is what i've come up with:

    i don't mind showing a preloader for the video for each new section a user enters, but i was thinking that i would have another instance of the media display ( and you would have another instance of the video object ) that would load its flv in the background so it would be ready when it is its turn.

    so if the video object has to appear in 3 different positions in a particular section then you use 3 different video objects to load the flvs behind the scenes.

    so for each section i have i count where the different positions the media display has to be in and then i throw another instance of the media display and load the flv in the background, secretly, behind the scenes.

    how does this sound to you?
    Last edited by fu-meng; 11-03-2005 at 06:14 PM.

  4. #4
    Flash Video Moderator Wheels's Avatar
    Join Date
    Dec 2000
    Location
    Minneapolis
    Posts
    1,590
    This is due to the default buffering of .flv's in Flash, if you can - use .swf's and preload the next one so it's there and ready. You could try that too if you're using http - but you may find the same result.

    I just went through the whole .flv stall issue on another site, what a nightmare.

    Good luck.

  5. #5
    Junior Member
    Join Date
    Jun 2002
    Posts
    21

    Encoding guidance...

    Greetings folks!

    I'm doing something similiar on an intranet site at work and wanted to get your thoughts on encoding to .flv.

    I'm encoding from Final Cut Pro into Player 7 format (Most of our end-users don't have Player 8 yet) and am curious as to what settings you are using to keep your .flv file sizes down.

    Each of my clips is approximately 2:00 minutes in length.

    Thanks for any insight you can provide.

    -- Jeff

  6. #6
    Senior Member
    Join Date
    Feb 2001
    Posts
    268
    hi wheels. thanks for your response.

    i know that loading the flvs into an swf is a better idea but i'm really dealing with 50 flvs in my case. and i know, i'm not loading them all at once but each section contains about 3-5 flvs and i don't want to have the user wait while i try and preload 3-5MBs of swf files that contain the video.

    can i ask you, how did you handle the project you were talking about that was such a nitemare?

    thanks for your input. -- fumeng.

  7. #7
    Senior Member
    Join Date
    Jul 2003
    Location
    Reading, UK
    Posts
    149
    I have the same issue as you, fu-meng, regarding wheels' response, some of my flv's are 7-10 meg(!) (and people looked puzzled when my response on receiving them was not joy but trepidation).

    I use a buffer clip on the layer above my video object that, when the flv is streaming, gets set to
    Code:
    _visible = false;
    and when the flv is buffering gets set to
    Code:
    _visible = true;
    That's the best solution I can come up with that avoids the end user looking at an ugly freezeframe of the video.

    I can't use the solution you suggest as already I am maxing out the bandwidth with my MASSIVE flv's so to download the others in the background would mean the end user would see a lot of my buffer clip.

    Anyways, for what it's worth, here's the code I'm using. Any comments suggestions gratefully accepted:

    Code:
    class VideoStreamer
    {
    	private var flv:String; // holds path to flv file
    	private var nc:NetConnection; 
    	private var ns:NetStream;
    	public var target:MovieClip; // store reference to clip that generates instance of VideoStreamer
    	
    	public function VideoStreamer(target:MovieClip)
    	{
    		_root.buffer_clip._visible = false; // make sure buffer clip is turned off
    	}
    	
    	public function playVideo(flv:String, target:MovieClip, seconds:Number, bufTime:Number):Void
    	{
    		this.target = target;
    		target.videoHolder._visible = true;
    		target.buffer_clip._visible = true;
    		nc = new NetConnection();
    		nc.connect(null);
    		ns = new NetStream(nc);
    		target.videoHolder.attachVideo(ns);
    		ns.setBufferTime(bufTime);
    		ns.play(flv)
    		ns["target"] = this.target;
    		ns["target.buffer_clip"] = target.buffer_clip;
    		ns["target.videoHolder"] = target.videoHolder;
    		ns["streamObject"] = this;
    		ns["endtime"] = seconds;
    		ns.onStatus = function(streamInfo)
    		{
    			switch(streamInfo.code)
    			{
    				case "NetStream.Buffer.Empty":
    				if((this.time *1000) < this["endtime"])
    				{
    					var timeRemaining = (this.time *1000) - this["endtime"];
    					timeRemaining = timeRemaining/ 1000;
    					if(timeRemaining < this.bufferTime)
    					{
    						this.setBufferTime(timeRemaining/2)
    					}
    					this["target.buffer_clip"]._visible = true;
    				}
    				else
    				{
    					this["target.buffer_clip"]._visible = false;
    					_root.gotoAndPlay(2); // once video has finished go to next frame of main timeline
    				}
    				break;
    				
    				case "NetStream.Buffer.Full":
    				this["target.buffer_clip"]._visible = false;
    				break;
    				
    				case "NetStream.Play.Stop":
    				this["target.buffer_clip"]._visible = false;
    				this.close();
    				
    				break;
    			}	
    		}
    	}
    	
    	
    	public function deleteVideo(current)
    	{
    		delete current;
    	}
    	
    }

    As for nusrsedad's question about keeping size down, this was all done for me by other people, I know that they used Sorenson Squeeze, but I am afraid I cannot tell you the details (this is something we will be talking about next week)

    And I'm sorry it's taken me so long to reply, for some reason, the email alerts didn't appear in my registered email.

  8. #8
    Senior Member
    Join Date
    Jul 2003
    Location
    Reading, UK
    Posts
    149
    to get a zipped demo of the code above: click here

  9. #9
    Senior Member
    Join Date
    Feb 2001
    Posts
    268
    your code looks fine. i think that's a good approach. because of the size of your external flvs it is a bad idea to load other ones into the flash player behind the scenes. certainly you'd expect it to interfere with the video currently playing.

    what about combining your flvs together? the start and end points would coincide with the natural break/pause points in your story. then you load up another video and show a preloader until it is sufficiently loaded. i don't think the user would mind that. they might expect to see a preloader with each new part of the story.

  10. #10
    Senior Member
    Join Date
    Jul 2003
    Location
    Reading, UK
    Posts
    149
    great minds think alike!

    I suggested today that they re-edited the raw video clips so that there were fewer of them and each clip lasted longer. So now we're going to convert them to flv's and hopefully that will create a better experience with less delay.

    How are you getting on with your project?

  11. #11
    Senior Member
    Join Date
    Feb 2001
    Posts
    268
    awesome. glad to hear it.

    i told them yesterday that we needed to do this in flash 8 so we could take advantage of the alpha channel in video. then, with less flvs, we'd be able to create a better user experience.

    the answer was no (no surprise) and now i'm going to try loading the flv that is "on deck" behind the scenes. it'll be a little nitemarish as there are so many but there's no other solution right now. it's a good thing these flvs weigh only 1MB or less each and the target audience is a broadband user.

    good luck with your project. thanks for helping me brainstorm.

    fumeng.

  12. #12
    Member
    Join Date
    Sep 2004
    Location
    Key West
    Posts
    38

    Try this

    Quote Originally Posted by fu-meng
    hi.

    i have a website with a video host who walks you thru all the sections
    of the site.

    currently, we are using 50 external flv files for this experience. each one weighs around 1mb. some weigh a little less.

    every time the video host moves on the stage, we switch to another flv. why? because the background changes and we need to throw the new one in. yes, the spec is for flash 7. i know, i know...not my decision.

    we want to make it as seamless as possible so the user doesn't see
    we're loading in new flvs whenever the video host moves. but each new flv, no matter how small, will have to load to some degree before it starts playing.

    but i just did a test trying to see how quickly i can switch between 3
    of these flv files where i reset the flv via setMedia() and then
    invoked play() ( i'm using the media display component ).

    each new video needed between 1-2 seconds before it started again. this is on a live web server.

    has anyone attempted s/thing like this before? what solutions should i
    be looking for or how can i restructure my project to get around this
    problem?

    any tips are very much appreciated. thank you. -- fumeng.

    Take a look at www.qtvnews.tv this has a seamless XML driven player.

    We also have other similar delivery methods
    Here
    http://www.flashvideostream.com/index.php?ssp=6

    and at:

  13. #13
    Senior Member
    Join Date
    Feb 2001
    Posts
    268
    hi flashvideo.

    thanks for responding to my post. that xml driven flv player works very nicely. as soon as i click to another video, it begins automatically and they all appear to be very heavy videos. this is exactly what i'm trying to do with my videos.

    how do you do it? are you streaming the video or progressively downloading it?

    thanks. -- matt.

  14. #14
    Member
    Join Date
    Sep 2004
    Location
    Key West
    Posts
    38
    We can do it both ways.
    The one you saw is progressive.
    Let us know if we can provide you with this player.

  15. #15
    Senior Member
    Join Date
    Feb 2001
    Posts
    268
    hey.

    i think i'm misunderstanding you here. my assumption in posting here in this forum is to get help from other flash developers, not get sold a product.

  16. #16
    Member
    Join Date
    Sep 2004
    Location
    Key West
    Posts
    38
    Quote Originally Posted by fu-meng
    hey.

    i think i'm misunderstanding you here. my assumption in posting here in this forum is to get help from other flash developers, not get sold a product.

    Yes, of course, and we have some players available to share with the community. Some are free and yes some have a cost only because we have to keep servers running and pay the creators. Our posts serve to inform of a resource for certain items and services as well as help when we can.

  17. #17
    Senior Member
    Join Date
    Feb 2001
    Posts
    268
    ok-ok. i understand. so in the case that "Our posts serve to...help when we can"...

    would you help me with this problem? because this is my goal: to learn how to best approach this problem and then code around it as i feel it will make me a better developer.

    or are you only willing to provide me with an flv player?

    thanks.

  18. #18

  19. #19
    Senior Member
    Join Date
    Feb 2001
    Posts
    268
    those posts don't have anything to do with my problem. they deal with how to play flvs one after another.

    my problem has to do with the default buffering of flvs and how to get around it.

    thanks anyway.

  20. #20
    Senior Member
    Join Date
    Jul 2003
    Location
    Reading, UK
    Posts
    149
    bravo! I applaud your polite and restrained response to this unsolicited sales pitch which missed the point of your original question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center