| |
- exceptions.Exception
-
- VCodecError
- VCodecError
- __builtin__.object
-
- Decoder
- Encoder
- VFrame
class Decoder(__builtin__.object) |
|
Decoder( codecParams ) -> Decoder
Creates new video decoder object based on codecParams.
codecParams - dictionary with the following items parameters:
'id', 'fourcc', 'type', 'bitrate', 'width', 'height',
'format', 'data', 'size', 'rate',
'rate_base', 'frame_rate', 'frame_rate_base', 'gop_size'
'max_b_frames', 'deinterlace'
The list of available codecs may be accessed through vcodec.codecs
All possible formats can be obtained through vcodec.formats
Methods of Decoder are:
convert( format {, size } ) -> frame
Convert existing video frame into another format with all needed color conversions and scaling.
getParams() -> params
Parameters that represents the current state of codec |
|
Methods defined here:
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- decode(...)
- convert( format {, size } ) -> frame
Convert existing video frame into another format with all needed color conversions and scaling.
- getParams(...)
- getParams() -> params
Parameters that represents the current state of codec
- reset(...)
- reset() -> None
Reset current state of codec
Data and other attributes defined here:
- __new__ = <built-in method __new__ of type object at 0x012EF958>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class Encoder(__builtin__.object) |
|
Encoder( codecParams ) -> Encoder
Creates new video encoder object based codecParams.
codecParams - dictionary with the following items parameters:
'id', 'fourcc', 'type', 'bitrate', 'width', 'height',
'format', 'data', 'size', 'rate',
'rate_base', 'frame_rate', 'frame_rate_base', 'gop_size'
'max_b_frames', 'deinterlace'
The list of available codecs may be accessed through vcodec.codecs
All possible formats to the convert video frame to are available trough vcodec.formats
Methods of Encoder are:
encode( frame, [ scale ]-> encoded string
Encode frame |
|
Methods defined here:
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- encode(...)
- encode( frame, [ scale ]-> encoded string
Encode frame
- getParams(...)
- getParams() -> params
Parameters that represents the current state of codec
Data and other attributes defined here:
- __new__ = <built-in method __new__ of type object at 0x012EFA48>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class VFrame(__builtin__.object) |
|
VFrame( format, size, data ) -> VFrame
Create a new VFrame with the parameters passed.
The 'format' should be one from vcodec.formats and the 'size' should represent the actual size of the frame( w, h )
If you create RGB picture, make sure that 'data' contains 3 strings as below: ( RGB, None, None ) |
|
Methods defined here:
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- convert(...)
- convert( format {, size } ) -> frame
Convert existing video frame into another format with all needed color conversions and scaling.
Data and other attributes defined here:
- __new__ = <built-in method __new__ of type object at 0x012EF858>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
- aspect_ratio = <member 'aspect_ratio' of 'pymedia.video.vcodec.VFrame' objects>
- Picture default aspect ratio.
- bitrate = <member 'bitrate' of 'pymedia.video.vcodec.VFrame' objects>
- Bitrate of the stream. May change from frame to frame.
- data = <attribute 'data' of 'pymedia.video.vcodec.VFrame' objects>
- Data of the frame as a tuple of strings. Numbers of strings depend on frame type( 1 for RGB, 3 for component )
- format = <member 'format' of 'pymedia.video.vcodec.VFrame' objects>
- Frame format as integer. See list of formats in vcodec.codecs
- frame_number = <member 'frame_number' of 'pymedia.video.vcodec.VFrame' objects>
- Frame number in a stream
- frame_pts = <member 'frame_pts' of 'pymedia.video.vcodec.VFrame' objects>
- Frame PTS
- pict_type = <member 'pict_type' of 'pymedia.video.vcodec.VFrame' objects>
- Type of the frame( 1-I, 2-P, 3-B )
- rate = <member 'rate' of 'pymedia.video.vcodec.VFrame' objects>
- Frame rate in units relative to the frame_base
- rate_base = <member 'rate_base' of 'pymedia.video.vcodec.VFrame' objects>
- Frame rate base
- resync = <member 'resync' of 'pymedia.video.vcodec.VFrame' objects>
- Flag is set if resync still in place
- size = <attribute 'size' of 'pymedia.video.vcodec.VFrame' objects>
- Size of the frame in pixels( w, h )
|
|