Samples/Story/VideoClip.py

Samples/Story/VideoClip.py
1 # Copyright 2012 Autodesk, Inc. All rights reserved.
2 # Use of this software is subject to the terms of the Autodesk license agreement
3 # provided at the time of installation or download, or which otherwise accompanies
4 # this software in either electronic or hard copy form.
5 #
6 # Script description:
7 # Shows new properties ImageSequence, UseSystemFrameRate and FrameRate of video story clip, these properties
8 # are used to control the playing of image sequence independent of underlying video clip.
9 #
10 # Topic: FBStoryClip, FBVideoClip, FBStoryTrack
11 #
12 from pyfbsdk import *
13 import os.path
14 
15 # Create a video story track
16 lTrackVideo = FBStoryTrack(FBStoryTrackType.kFBStoryTrackVideo)
17 # Create a video clip using samples images, or change the path to where image sequence locates
18 lPath = os.path.join(FBSystem().ConfigPath, 'Scripts/Samples/Story/sample_image_sequence0000.jpg')
19 lPath = os.path.normpath(lPath)
20 lVideo = FBVideoClip(lPath)
21 
22 # Use this video clip to create a video story clip on the video track
23 lClip = FBStoryClip (lVideo, lTrackVideo, FBTime(0,0,0,0))
24 
25 # Drag the video track to viewer, chose video plane, play on transport control for test
26 # Specify the new property values for video story clip
27 # Need to set UseSystemFrameRate to False before FrameRate can be changed
28 lClip.ImageSequence = True
29 lClip.UseSystemFrameRate = False
30 lClip.FrameRate = 30