5 Replies Latest reply on Sep 21, 2007 1:52 AM by elisavmus

    how to play .flv frame by frame

      I load a flv from code. I want to be able to get the next frame every time I push a button. I tried using seek() and passing it playheadTime+0.045 but it doesn't seem to work. It jumps much more than one frame. (For a flv movie frame rate of 20 per second one frame will occur once every 0.05 seconds so if I seek to the current position + a number smaller than the time until the next frame I should get the next frame). Can anyone give me some advice regarding this?
        • 1. Re: how to play .flv frame by frame
          Greg Dove Level 4
          -loaded flv's can only seek to keyframes. So the only way to do it simply would be to encode your flv with a keyframe every frame. This will make the file a lot larger though.
          -you can get frame accurate control if you import the video to a timeline - so it becomes a swf- at the expense of audio synch.
          -other ways to do it might include making a bitmapdata 'buffer' of frames on an invisible play-ahead copy of the flv with no sound (I'm guessing here... I've seen frame by frame done, and I can't think of any other way of doing it). Perhaps others have alternate approaches - I think this way (assuming it works) would be quite complicated.
          • 2. Re: how to play .flv frame by frame
            Hasenstein Level 1
            Seek obviously won't work (the previous posting points out why - you can only seek to keyframes). However, I haven't tried this but... try this, it's short and painless and if it doesn't work, well... use pause/resume! You can't seek to any point, but if pause/resume is fast enough it should work. My guess (without trying, as I said) is it doesn't need keyframes like a seek, but it won't be frame-accurate. Pls. tell us the solution shold you find one... :-)
            • 3. Re: how to play .flv frame by frame
              Greg Dove Level 4
              @hasenstein : good idea. I was thinking of an example I saw recently with forward and backwards frame by frame working... which I can only think of working with the 3rd approach I outlined above... and overlooked that approach. You can go forwards frame by frame like that I think. I'm not sure if there's a start-up lag each time you do that. Hopefully not.
              • 4. Re: how to play .flv frame by frame
                elisavmus Level 1
                Thank you for the responses. I think that I will apply the first method proposed by GWD even though it will increase the file size.
                • 5. Re: how to play .flv frame by frame
                  elisavmus Level 1
                  I tried the pause/ resume method and I could not get it to work.