AWS Thinkbox Discussion Forums

VideoDecoder Class

[size=150]VideoDecoder Class[/size]

VideoDecoder
Type: Class
Constructor Arguments:
[list]Filename – A string value indicating the path of the video file to decode.
Properties:
fps – The average frame rate of the video.
width – The width of a video frame.
height – The height of a video frame.[/list:u]

[size=150]Member Functions[/size]
DecodeNextFrame
Description: Decodes a frame from the video and returns it by reference through the image argument. This function returns a boolean to indicate whether or not the decode succeeded.
Arguments:
[list]image – A Draft image object used to return the decoded frame.
Usage:

decoder = Draft.VideoDecoder( "//path/to/video/file.mov" ) frameImage = Draft.Image.CreateImage( 800, 600 ) while( decoder.DecodeNextFrame( frameImage ) ): #process the decoded frames here[/list:u]

DecodeFrame
Description: Decodes a specified frame from the video and returns it by reference through the image argument. This function returns a boolean to indicate whether or not the decode succeeded.
Arguments:
[list]frameNumber – An integer indicating which frame should be decoded.
image – A Draft image object used to return the decoded frame.
Usage:

decoder = Draft.VideoDecoder( "//path/to/video/file.mov" ) frameImage = Draft.Image.CreateImage( 800, 600 ) if decoder.DecodeFrame( 100, frameImage ): #Process frameImage here...[/list:u]

Privacy | Site terms | Cookie preferences