Package libavg :: Module avg :: Class Video

Class Video


Video nodes display a video file. Video formats and codecs supported are all formats that ffmpeg/libavcodec supports.

Instance Methods
acodec
getAudioCodec()
Returns the audio codec used as a string such as 'mp2'
samplerate
getAudioSampleRate()
Returns the sample rate in samples per second (for example, 44100).
bitrate
getBitrate()
Returns the number of bits in the file per second./n
 
getCurFrame()
Returns the video frame currently playing.
 
getCurTime()
Returns seconds of playback time since video start.
duration
getDuration()
Returns the duration of the video in milliseconds./n
numchannels
getNumAudioChannels()
Returns the number of audio channels.
 
getNumFrames()
 
getNumFramesQueued()
Returns the number of frames already decoded and waiting for playback.
string
getStreamPixelFormat()
Returns the pixel format of the video file as a string.
vcodec
getVideoCodec()
Returns the video codec used as a string such as 'mpeg4'.
bool
hasAudio()
Returns true if the video contains an audio stream.
 
pause()
Stops video playback but doesn't close the object.
 
play()
Starts video playback.
 
seekToFrame(num)
Moves the playback cursor to the frame given.
 
seekToTime(secs)
Moves the playback cursor to the time given.
 
setEOFCallback(pyfunc)
Sets a python callable to be invoked when the video reaches end of file.
 
stop()
Stops video playback.

Inherited from unreachable.instance: __new__

Inherited from object: __delattr__, __getattribute__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

    Inherited from RasterNode
Bitmap
getBitmap()
Returns a copy of the bitmap that the node contains.
 
getOrigVertexCoords()
Returns the unwarped coordinate of all vertices as a list of lists.
 
getWarpedVertexCoords()
Returnes the current coordinate of all vertices as a list of lists.
 
setWarpedVertexCoords(grid)
Changes the current coordinates of all vertices.
    Inherited from AreaNode
AreaNode
getElementByPos(pos)
Returns the topmost child node that is at the position given.
mediasize
getMediaSize()
Returns the size in pixels of the media in the node.
    Inherited from Node
 
__eq__(...)
 
__hash__(...)
hash(x)
 
__init__(...)
Raises an exception This class cannot be instantiated from Python
 
__ne__(...)
abspos
getAbsPos(relpos)
Transforms a position in coordinates relative to the node to a position in window coordinates.
node
getParent()
Returns the container (AVGNode or DivNode) the node is in.
relpos
getRelPos(abspos)
Transforms a position in window coordinates to a position in coordinates relative to the node.
 
releaseEventCapture(cursorid)
Restores normal mouse operation after a call to setEventCapture().
 
setEventCapture(cursorid)
Sets up event capturing so that cursor events are sent to this node regardless of the cursor position.
 
setEventHandler(type, source, pyfunc)
Sets a callback function that is invoked whenever an event of the specified type from the specified source occurs.
None
unlink(kill)
Removes a node from it's parent container.
Properties
  fps
Returns the nominal frames per second the object should display at.
  href
The source filename of the video.
  loop
Whether to start the video again when it has ended (ro).
  volume
Audio playback volume for this video.

Inherited from object: __class__

    Inherited from RasterNode
  blendmode
The method of compositing the node with the nodes under it.
  maskhref
The source filename for a mask image to be used as alpha channel.
  maskpos
An offset for the mask image.
  masksize
The size of the mask image.
  maxtileheight
The maximum width and height of the tiles used for warping.
  maxtilewidth
The maximum width and height of the tiles used for warping.
  mipmap
Determines whether mipmaps are generated for this node.
    Inherited from AreaNode
  angle
The angle that the node is rotated to in radians.
  height
  pivot
The position of the point that the node is rotated around.
  pivotx
Deprecated.
  pivoty
Deprecated.
  pos
The position of the node's top left corner relative to it's parent node.
  size
  width
  x
The position of the node's left edge relative to it's parent node.
  y
The position of the node's top edge relative to it's parent node.
    Inherited from Node
  active
If this attribute is true, the node behaves as usual.
  id
A unique identifier that can be used to reference the node.
  opacity
A measure of the node's transparency.
  sensitive
A node only reacts to events if sensitive is true.
Method Details

getNumAudioChannels()

 

Returns the number of audio channels. 2 for stereo, etc.

Returns: numchannels

getStreamPixelFormat()

 

Returns the pixel format of the video file as a string. Possible pixel formats are described in http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/ffmpeg-r_2libavutil_2avutil_8h.html

Returns: string

hasAudio()

 

Returns true if the video contains an audio stream. Throws an exception if the video has not been opened yet.

Returns: bool

pause()

 

Stops video playback but doesn't close the object. The playback cursor stays at the same position.

stop()

 

Stops video playback. Closes the file and 'rewinds' the playback cursor.


Property Details

fps

Returns the nominal frames per second the object should display at.

Get Method:
unreachable(...)

href

The source filename of the video.

Get Method:
unreachable(...)
Set Method:
unreachable(...)

loop

Whether to start the video again when it has ended (ro).

Get Method:
unreachable(...)

volume

Audio playback volume for this video. 0 is silence, 1 passes media file volume through unchanged. Values higher than 1 can be used to amplify sound if the sound file doesn't use the complete dynamic range. If there is no audio track, the call is ignored.

Get Method:
unreachable(...)
Set Method:
unreachable(...)