Setting frames per second (fps) using FLVPlayback

Hi,

I'm using the FLVPlayback component in Flash 8 to play an instruction video.
The video plays at 25fps (PAL std), but I'm looking to add a feature where the user can watch the video a half that speed to inspect all the details and movements at slow speed.

I was kind of hoping that there would be a .fps property in the component, but there doesn't seem to be any.

Does anyone know of a way to slow down the video speed?
I know that slowing down the video would also mean distorted sound, but that's not a problem. I'll be muting the sound when the video plays at half speed anyway.

best
Terje
EpiktetAsked:
Who is Participating?
 
rythmik1Commented:
here's the full code to connect to an flv and then make it do slow motion, tested and working. notice i pause it immediately after starting the video so that it won't run off on its own. then the setInterval function tells it to advance to the next second at whatever interval _global.seekSpeed is set to. all you have to do is change the 'YOURVIDEO.flv' in the code below to the path to your flv.


////////////////////////////////////////////////////////////////////////////
// CREATE CONNECTION TO FLV ////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
var myConnection;
var myVideo;
my_video._alpha = 100;
playVideo = function () {
      myConnection = new NetConnection();
      myConnection.connect(null);
      myVideo = new NetStream(myConnection);
      myVideo.setBufferTime(5);
      my_video.attachVideo(myVideo);
      this.createEmptyMovieClip("movFLVAudio", this.getNextHighestDepth());
      movFLVAudio.attachAudio(myVideo);
      var snd1:Sound = new Sound(movFLVAudio);
      snd1.setVolume(50);
      myVideo.onMetaData = function(obj) {
            _global.bufTime = obj.duration;
            totalPlayTime = obj.duration;
            trace(_global.bufTime);
      };
      myVideo.play("YOURFLV.flv");
      myVideo.pause();
};
playVideo();

//////////////////////////////////////////////////////////////////////////////
// SLOW MOTION CODE
//////////////////////////////////////////////////////////////////////////////
_global.seekSpeed = 1000;
// (number of milliseconds to pass before going advancing flv frame)
i = 0;
// starting second
function doSloMo() {
      i += 1;
      // increment second
      trace(i);
      myVideo.seek(i);
      // seek to i
}
sloMo = setInterval(doSloMo, _global.seekSpeed);
// set an interval to call the above function.
0
 
Irwin SantosComputer Integration SpecialistCommented:
the most efficient way is to output your source video to 12fps and offer 2 flash movies one at full frame rate, the other at 12fps
0
 
EpiktetAuthor Commented:
yes, I've thought about that as a last resort.
However, this is a demo for a system holding over 200 instruction videos, so making 12fps versions would double that amount to 400...

Waiting in agony for another solution :-)
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Irwin SantosComputer Integration SpecialistCommented:
what happens if you change the stage to 12fps?
0
 
EpiktetAuthor Commented:
The flvPlayback component plays the video at the FLV's fps rate independent of the stage fps.
Besides, that would slow down all the other animation (buttons, fades etc) as well, which is not really what I want.
0
 
Irwin SantosComputer Integration SpecialistCommented:
...prepare for agony... :-(
0
 
rythmik1Commented:

if i had to do it, i'd make a function using setinterval() to update the playhead's position using the seek() command.. ie:

_global.seekSpeed = 1000; // (number of milliseconds to pass before going advancing flv frame)
i=0; // starting second
function doSloMo() {
i+=1; // increment second
myVideo.seek(i); // seek to i
}
sloMo = setInterval("doSloMo", _global.seekSpeed); // set an interval to call the above function.

////////////////////////

then, you could make some buttons that change the _global.seekSpeed to slow it down or speed it up:

on(release) { global.seekSpeed = 2000; }
on(release) { global.seekSpeed = 3000; }

etc.

0
 
EpiktetAuthor Commented:
Fantastic!
That's exactly what I wanted, and it's working like a charm.

Thanks alot!

best
Terje
0
 
rythmik1Commented:
Glad it worked.. and glad you asked.. it gave me some good ideas for using it myself!

:)

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.