Python Reference Guide
 
Loading...
Searching...
No Matches
Rendering\codecExamples.py
1# Copyright 2009 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 how to specify codec and pop codec selection dialog.
8#
9# Topic: FBVideoCodecManager, FBVideoGrabber
10#
11from pyfbsdk import *
12import sys
13
14try:
16 # By specifying Codec stored, the first time we render a scene, the codec dialog
17 # will ve available if user press con configure
18 # the second time a scene is rendered, the same settings will be used.
19 mgr.VideoCodecMode = FBVideoCodecMode.FBVideoCodecStored
20
21 # Will print the list of all available codec id
22 print(mgr.GetCodecIdList( "AVI" ))
23
24 # Get the current default codec id for AVI file
25 print(mgr.GetDefaultCodec( "AVI" ))
26
27 lApp = FBApplication()
28 lOptions = FBVideoGrabber().GetOptions()
29 # render first time: user can specify rendering params
30 lOptions.OutputFileName = "c:/ouput_1.avi"
31 lApp.FileRender( lOptions )
32
33 # render second time: the same params are used for rendering
34 lOptions.OutputFileName = "c:/ouput_2.avi"
35 lApp.FileRender( lOptions )
36
37except Exception as e:
38 # Unkown error encountered... Maybe from the 'listdir' call failing...
39 FBMessageBox( "ERROR", "Unknown error encountered. Aborting! " + str(e), "OK", None, None )
FBApplication is used mainly to manage files.
Definition: pyfbsdk_generated.h:801
Video Codec manager class.
Definition: pyfbsdk_generated.h:20805
Video Grabber class.
Definition: pyfbsdk_generated.h:20875
Python built-in string class.
Definition: pyfbsdk.h:77
int FBMessageBox(str pBoxTitle, str pMessage, str pButton1Str, str pButton2Str=None, str pButton3Str=None, int pDefaultButton=0, int pScrolledMessage=0)
Dialog popup box.