dcsimg
A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 24

Thread: MX can not smoothly rewind video over 35 frames long ??

  1. #1
    Senior Member
    Join Date
    Mar 2001
    Posts
    527

    MX can not smoothly rewind video over 35 frames long ??

    Hi all,

    i have done alot of work with Flash and video using Flash 5 and have built several players that have alot of functionality - similar to the functions of WIndows Media Player and Quicktime

    However, with Flash MX embedded video i am getting frustrated at not being able to control video as i want.

    It appears that there is a problem with MX's ability to rewind a piece of video footage smoothly.


    eg.
    I have a piece of MX encoded footage and is 330 frames long and my flash frame rate is 25fps.

    i have built a fast forward button and the code is as follows
    ======================================
    tellTarget ("myMovie") {
    nextFrame();
    };
    tellTarget ("myMovie") {
    nextFrame();
    };
    tellTarget ("myMovie") {
    nextFrame();
    };
    ======================================
    This code is looped so i am calling it all the time and the movie Clip "myMovie" moves forward smoothly as desired.

    Here is the problem
    I have almost identical code on my rewind button and again i am looping a call to it....

    ======================================
    tellTarget ("myMovie") {
    prevFrame();
    prevFrame();
    prevFrame();
    };
    ======================================

    BUT what happens is that MX does not appear to action this code as fast. It apears that the further you are into your clip , the less responsive the control you get - If i am say between frames 0 and 30 then the rewind functionality works ok (well i say "ok", what happens is that as i approach frame "0" the rewinding speeds up).

    If however i am further into "myMovie" lets say over 150 frames, then i seem to have extremely delayed rewinding so much so that i am thinking if anyone sees this then they may say - "who the hell coded this and do they really think thay have a grip of this Flash MX thing" - The movie rewinds my 3 frame loop then rests for about 5 seconds tehn the loop occurs again.....

    Now i know that i am a good actionScripter - i have been studying Flash 5 and MX Scripting for over 2 years now - BUT i cant seem to get this rewind thing - i have tried all sorts of different ways.


    There seems to me to be a little bug in the way that MX looks at the rewinding process.

    The same thing hapens if i try to move the "myMovie" video encoding back by one frame at a time. If i am close to the start of "myMovie" then the reaction is much quicker than say if i am over frame 100.


    WHY IS THIS !!!!!!!!!!!!!!!!!!!!

    if anyone can shed any light on this then i would be very appreciative.

    Thanks in advance

    gilesb

  2. #2
    Senior Member
    Join Date
    Mar 2001
    Posts
    527
    Funnily enough, Macromedia did not put any useful fast forward or rewind controls into their component that they suggest you should used to control a video clip


    If you look at your "Samples" folder within your Macromedia MX folder in your Program files folder, you see a file called "Import_video.fla"

    At first glance you think "great" they have given me usable rewinding code but then if you look closer the rewind is only one frame on one click and if you test this - the further you are into the clip being controlled, the less responsive the move back one frame is.....

    Macromedia????????????

    is there a bug here???

  3. #3
    Senior Member andrthad's Avatar
    Join Date
    Apr 2002
    Location
    Oklahoma - USA
    Posts
    154
    I have noticed the same thing using Musak's video component from http://www.flashcomponents.net. Looking at his code it looks as though he adds and subtracts 6 frames for fast forward and rewind. The fast forward is very smooth. The rewind is a little jerky.

  4. #4
    Senior Member bluephoenix's Avatar
    Join Date
    Nov 2002
    Location
    Upstate/Central New York
    Posts
    144
    Yeah, seriously. How difficult would it be for Macromedia to impliment a play.Backwards() function!?
    Timothy Boronczyk
    -http://home.twcny.rr.com/organman20/bluephoenix

  5. #5
    Flash Video Moderator Wheels's Avatar
    Join Date
    Dec 2000
    Location
    Minneapolis
    Posts
    1,590
    Just curious, is this a problem when there is video in the .swf - or does it happen with all content in MX?

  6. #6
    Senior Member
    Join Date
    Mar 2001
    Posts
    527
    HI Wheels,

    no it appears only to be when i am trying to rewind specifically MX encoded video.

    I have actually used Wildform Flix to encode the video using there encoding software - nevertheless - when i play a Flash 5 file using the controls the rewind is fine - BUT when i play the MX encoding the rewind gets slower the further you are into the MX video

    ??????

    Any ideas??

    gilesb

  7. #7
    www.intensewd.com
    Join Date
    Apr 2002
    Location
    Australia
    Posts
    450
    Hi,

    I've got smooth rewind/fast forward buttons on this:

    http://www.intensewd.com/clients/valhalla

    This is the AS on the rewing button:

    Code:
    on(press){
    	this.onEnterFrame = function(){
    		if(_root.FClip._currentframe > 1){
    			_root.FClip.gotoAndStop(_root.FClip._currentframe-6);
    		} else {
    			delete this.onEnterFrame;
    		}
    	}
    }
    
    on(release){
    	delete this.onEnterFrame;
    	_root.FClip.play();
    }
    where FClip is the mc the movie is loaded into.

    btw .. any suggestions on how/what i should be encoding the videos with because the quality i've gotten .. is pretty sad. Basically new to video editing so talk slowly

    Cheers,
    Ben

  8. #8
    Flash Video Moderator Wheels's Avatar
    Join Date
    Dec 2000
    Location
    Minneapolis
    Posts
    1,590
    Nice code ben

    Looks like you have an aliasing problem. It's usually caused by not having your video in even dimensions.

    You want to make sure your video size is in factors of 4. So if you're using 175 x 189 you'll have problems. But go to 160 x 176 and you'll be O.K.

    As far as quality goes, it depends on what bandwidth you're shooting for. What are the specs on the videos you're using.

    Dimensions, time, fps, file size of the .swf, bit rate?

    They load very quickly with a cable connection. You're loading into movie clips?

  9. #9
    www.intensewd.com
    Join Date
    Apr 2002
    Location
    Australia
    Posts
    450
    Thanks wheels,

    Glad that code worked for you.

    I'm mainly targeting cable users, although there'll be a dial up option with smaller ones sometime this week.

    The movies are all wmv's embedded into seperate fla's. The swf's are loaded into a target clip, which resizes it to 120% width and height on(data). I think that's partially responsible for the enhanced crappiness of the viewing quality

    The clips:
    176x144,
    all of them are somewhere between 28 and 32 seconds.
    The swf file sizes range from 610 - 800kb@12 fps.

    When I imported them I chose 3/4 for the sorenson frame thing .. but .. whether that's good or not is beyond my knowledge.

    Windows Media Player is telling me the bitrate of the movies is 98kbs. The framerate of the movies .. i think is 30, I cut the clips out the other day so I'm not 100% sure.

    Any suggestions on better approaches (particularly which codec to use when I save the clip's) is more than welcome.

    Cheers,
    Ben

  10. #10
    Flash Video Moderator Wheels's Avatar
    Join Date
    Dec 2000
    Location
    Minneapolis
    Posts
    1,590
    OK, it's the resizing that's mussin' things up. Just make sure to import you movies at the size you want to use on the stage, and don't resize.

    I guess it's just loading fast for me because it's late - sometimes I run at 2 mbp/s late at night.

    .WMV wouldn't be my first choice for a source format. I would choose DV, .mov or .avi if you have a choice. Make sure not to add much compression to your cuts, try to keep them as raw as possible.

    I would run my main movie at 30 fps then when you create the seperate .fla's and import your video - run those at 30 fps, but use 1:4 or 7.5 for the fps. Choose 90% for the quality and don't bother with key frames for this kind of content.

    Under the publish settings, make sure your sound is 24kbp/s or less, mono.

  11. #11
    www.intensewd.com
    Join Date
    Apr 2002
    Location
    Australia
    Posts
    450
    Thanks wheels.

    Muchly appreciated.

    Ben

  12. #12
    Senior Member
    Join Date
    Mar 2001
    Posts
    527
    Hey Ben

    how was your video encoded/?

    I use Wildform Flix as i find that for my purposes i get the best quality video output

    I use their MX settings and encode 2 pass VBR - which in effect means that the software runs through the video to be encoded twice, first to see where it can save on bit rate, and secondly to encode ussing the Variable Bit Rate....... blah blah etc etc

    Anywhay

    i tried your code but the thing would still only rewind at a satisfactory rate at below 50 framess into the video. And again the further you are within the video, the less responsive the action of rewind.

    eg at 250 frames into the MX encoding, it takes 1 and a bit seconds to rewind one of those "onEnterFrame" functions.......

    still very confused....


    WIERD!

    gilesb

  13. #13
    www.intensewd.com
    Join Date
    Apr 2002
    Location
    Australia
    Posts
    450
    giles,

    set the -= 6 to a higher number then, try 12 or 20 even if you've got several hundred frames.

    if you want it to rewind all the way back to one, create another button and tell it to gotoAndStop(1);.

    i'd like to use flix, grabbed the trial version but that sticks a big ugly watermark on it, although the results seemed pretty good .. flix works out to $300 where i'm sitting .. which isn't feasible for one site.

    cheers,
    Ben

  14. #14
    Senior Member andrthad's Avatar
    Join Date
    Apr 2002
    Location
    Oklahoma - USA
    Posts
    154
    Hey Wheels,

    I noticed you questioned Ben on loading the external videos into an empty clip versus into a level. On my site I am loading them into a empty clip as well. Do you see an advantage either way?

  15. #15
    Senior Member
    Join Date
    Mar 2001
    Posts
    527
    Ben,

    Thanks again, but i dont really want to do that becasue i want smooth manageable rewind. I could put a larger number in the code but that would just make things less manageable.....

    The rewind is still jerky, no matter what number we are talking about, the further you are within the MX encoding

    gilesb.

  16. #16
    Moderator
    Join Date
    Apr 2001
    Location
    Akron OH, USA
    Posts
    4,841
    ----
    The advantage of loading to a level is that the movie will begin to play (stream) right away. When loading into a MC the movie must load completely before playback will begin.
    ----
    this is an interesting observation. why would Flash stream a video in a level but load fully in a movie clip? this is contrary to other media, like sound and animation.
    aviarts.com - web development and flash development

  17. #17
    Senior Member andrthad's Avatar
    Join Date
    Apr 2002
    Location
    Oklahoma - USA
    Posts
    154
    I guess I am still a little confused on this point as well. When I use an empty mc to load the external video swf, I also preload 10% before I tell the video to play. The video plays fine and streams the other 90%.

    Perhaps if I did not have the preloader the loading into a level would be the way to go versus the empty mc.

  18. #18
    Flash Video Moderator Wheels's Avatar
    Join Date
    Dec 2000
    Location
    Minneapolis
    Posts
    1,590
    OK, I just had to test for myself.

    I was confused. What I should have said is that as long as your video is on the main timeline (or a Sorenson/Flix .swf) it will stream as it loads.

    Video "embedded" in movie clips will have to load completely first. As long as the video is on the main timeline - it will stream regardless of load method.
    Last edited by Wheels; 12-03-2002 at 05:36 PM.

  19. #19
    Moderator
    Join Date
    Apr 2001
    Location
    Akron OH, USA
    Posts
    4,841
    -----
    What I should have said is that as long as your video is on the main timeline (or a Sorenson/Flix .swf) it will stream as it loads.

    Video "embedded" in movie clips will have to load completely first.
    -----
    this would make sense because the sound track behaves as stream sync. Stream sync sounds behave this same way. Sounds on the main timeline of a SWF set to stream sync will effectively stream. Sounds in a movie clip timeline set to stream sync must download completely before playback. Ofcourse you can load a swf into a mc and get streaming, just not include the sound directly in a mc.

    Just out of curiousity, what happens if you have a video with no sound track, will it stream from both mc or main timeline? (I wonder if the sound is some how determining the load process).
    aviarts.com - web development and flash development

  20. #20
    Senior Member
    Join Date
    Mar 2001
    Posts
    527
    So am i doing something out of the ordinary to get my swf video file to load into an empty container movie clip and stream as it loads in

    This is what happens

    in fact i dont think i have ever loaded into a level!!!!

    I preload a certain percentage, but then the rest appears to stream in perfectly fine, is this not meant to happen??

    gilesb

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