[KBA-00991] How to fast-forward and reverse video using the Omnicast™ SDK - Omnicast™ 4.1 - 4.8

series
Omnicast™ 4.1 - 4.8
revised_modified
2014-01-27

[KBA-00991] How to fast-forward and reverse video using the Omnicast™ SDK

This article explains how to fast-forward video at a speed greater than 6x or reverse video using the Omnicast™ SDK.

Summary

When trying to fast-forward at a speed greater than 6x using the Omnicast™ SDK, the video pauses instead of fast-forwarding. When trying to play video in reverse, the video plays in fast-forward at a speed of 6x instead of playing in reverse.

More Information

This is an Omnicast™ limitation. When requesting frames at a speed greater than 6x or in reverse, the system falls in keyframe-only mode. However, the SDK contains methods to explicitly fast-forward at such speeds or play in reverse, using the FastForwardKeyFrame() or FastReverseKeyFrame() functions instead of SetPlaySpeed().

Here is a code example that describes how to play video at any speed:
// Normal play speed

if (nPlaySpeed >= ePlaybackSpeed.GXPLAYBACK_SPEED_1X && nPlaySpeed <= ePlaybackSpeed.GXPLAYBACK_SPEED_6X)

{

m_videoPlayBack.SetPlaySpeed(nPlaySpeed);

m_videoPlayBack.Play();

}

// Fast forward

else if (nPlaySpeed > ePlaybackSpeed.GXPLAYBACK_SPEED_6X)

{

m_videoPlayBack.FastForwardKeyFrame((int)nPlaySpeed);

}

// Reverse

else if (nPlaySpeed < ePlaybackSpeed.GXPLAYBACK_SPEED_1X)

{

m_videoPlayBack.FastReverseKeyFrame((int)nPlaySpeed);

}
Please note that nPlaySpeed is of type ePlaybackSpeed and that the expected value for the FastForwardKeyFrame() and FastReverseKeyFrame() is between 1000 and 20000.