Stepping Frames

This tutorial describes how to watch frames in a video clip.

Purpose

The purpose of this tutorial is to show you how to step forward and backward through video frames.

Required Background

The Video Client Overview introduces the video client utilities.

Introduction

Frame step allows you to step the current video playback position forward or backward by a number of frames. This feature is provided by the CVideoPlayerUtility::StepFrameL() method and is only available when playback is paused.

Note: This functionality is dependent on the capabilities of the underlying play-controller implementation and the characteristics of the video clip.

Using Frame Step

The following tasks are covered in this tutorial:

Basic Procedure

The high level steps to step frames forward and backward are shown here:

  1. Create a new video player utility object.

  2. Open a video clip to play.

  3. Use CVideoPlayerUtility::GetPlayRateCapabilitiesL() to check frame step is supported. This returns KErrNotSupported if frame step is not supported.

  4. Call the CVideoPlayerUtility::Prepare() method.

  5. Call CVideoPlayerUtility::Play() to start playback.

  6. Pause playback using CVideoPlayerUtility::PauseL().

  7. To step forward through the video frames use CVideoPlayerUtility::StepFrameL() and set aStep to a positive TInt value.

  8. To step backward through the video frames use CVideoPlayerUtility::StepFrameL() and set aStep to a negative TInt value.

  9. Call CVideoPlayerUtility::Stop() to halt video playback.

Example

// Create new video player utility object (iVideoPlayer)
// Open the video clip
// Call Prepare()
// Call Play()

iVideoPlayer->GetPlayRateCapabilitiesL(iVideoPlayRateCapabilities);
// Return the current playback rate capabilities

// Check that engine has forward capability.
if( iVideoPlayRateCapabilities.iStepForward)
{
iVideoPlayer->StepFrameL(10); // Steps to 10th frame from current.
}
else
{
// Forward is not supported.
}

// If user wants to rewind. Check that engine has rewind capability.
if( iVideoPlayRateCapabilities.iStepBackward)
{
iVideoPlayer->StepFrameL(-5); // Steps to 5th frame backward.
}
else
{
// Rewind is not supported.
}

// Call Stop() 

See Also

Creating and Preparing a Video Player

Configuring the Video Player

Enabling/Disabling Audio or Video Playback Separately

Scaling Automatically

Controlling Video Playback

Fast Forwarding and Rewinding

Controlling the Video Controller Plugin