Samples/Utilities/ImageSequenceFrameRateChange.py

# Copyright 2011 Autodesk, Inc.  All rights reserved.
# Use of this software is subject to the terms of the Autodesk license agreement 
# provided at the time of installation or download, or which otherwise accompanies
# this software in either electronic or hard copy form.
# 
# This script demonstrates the ability to change the FrameRate of an image sequence.
# 
# Topic: FBVideoClipImage FBTimeMode
#
from pyfbsdk import FBVideoClipImage, FBTimeMode, FBVideoClip


# Set to where the image sequence located before run it.
lFileName = 'C:/MB/image_sequence/sample_image_sequence0000.jpg'


lImageSquence = FBVideoClipImage('ImageSquence')
lImageSquence.Filename = lFileName

# Set as an image sequence. 
lImageSquence.ImageSequence = True
# Set do not use system FrameRate, so we are able to set the FrameRate.
lImageSquence.UseSystemFrameRate = False


# Set the FrameRate through the TimeMode property.
lImageSquence.TimeMode = FBTimeMode.kFBTimeMode30Frames

# Set the FrameRate through the SetVideoClipFrameRate method.
lImageSquence.SetVideoClipFrameRate(FBTimeMode.kFBTimeMode50Frames)


# When TimeMode is kFBTimeModeCustom, be able to set the custom FrameRate.
#lImageSquence.SetVideoClipFrameRate(FBTimeMode.kFBTimeModeCustom, 10)

# When TimeMode is kFBTimeModeCustom, be able to set the custom FrameRate.
# The value to be set will be clamped to nearest possible custom FrameRate.
#lImageSquence.FrameRate = 22