Python Reference Guide
 
Loading...
Searching...
No Matches
Samples\Video\VideoInput.py
1# Copyright 2010 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# This script shows how to setup a cube with a live video input.
7# ...
8#
9# Topic: FBVideoIn, FBMaterial, FBTexture, FBMaterialTextureType
10#
11
12from pyfbsdk import FBSystem, FBModel, FBModelCube, FBMaterial, FBTexture, FBVector3d, FBColor, FBMaterialTextureType
13
14# for directory access
15import os
16
17# Create a cube
18lCube = FBModelCube("My Cube")
19lCube.Scaling = FBVector3d(40, 40, 20)
20lCube.Show = True
21lCube.Visible = True
22
23# Create a material
24lMaterial = FBMaterial("My Material with live video")
25
26# Create a video live input
27videoInList = FBSystem().VideoInputs
28if(len(videoInList) > 0):
29 videoInput = videoInList[0]
30
31 #set some properties of the video input
32 print(videoInput.LiveGetCompressorCount())
33 if(videoInput.LiveGetCompressorCount() > 1):
34 print(videoInput.LiveGetCompressorName(1))
35 videoInput.LiveSetCompressor(1)
36
37 print(videoInput.LiveGetResolutionFRCount())
38 if(videoInput.LiveGetResolutionFRCount() > 1):
39 print(videoInput.LiveGetResolutionFRName(1))
40 videoInput.LiveSetResolutionFR(1)
41
42 videoInput.Online = True
43 videoInput.Recording = True
44 videoInput.RecordAudio = True
45 videoInput.FilePath = "C:\\test.avi"
46
47 # Create a texture
48 lTexture = FBTexture("Video live input")
49 lTexture.Video = videoInput
50
51 # Set texture to material's diffuse channel.
52 lMaterial.SetTexture(lTexture, FBMaterialTextureType.kFBMaterialTextureDiffuse)
53
54 # Attach material to cube
55 lCube.Materials.append(lMaterial)
56
57
Material class.
Definition: pyfbsdk_generated.h:10458
Cube model class.
Definition: pyfbsdk_generated.h:11337
Provides access to the underlying system, and the MotionBuilder scene.
Definition: pyfbsdk_generated.h:18771
See samples: HUDElements.py, MaterialAndTexture.py, TextureAnimation.py, VideoInput....
Definition: pyfbsdk_generated.h:19477