Dirac video decoderThis component decodes a stream of video, coded using the Dirac codec, into frames of YUV video data. This component is a thin wrapper around the Dirac Python bindings. Example UsageA simple video player: Pipeline(ReadFileAdapter("diracvideofile.drc", ...other args...), DiracDecoder(), RateLimit(framerate), VideoOverlay() ).activate() More detailReads a raw dirac data stream, as strings, from the "inbox" inbox. Sends out frames of decoded video to the "outbox" outbox. The frames may not be emitted at a constant rate. You may therefore need to buffer and rate limit them if displaying them. The decoder will terminate if it receives a shutdownMicroprocess message on its "control" inbox. The message is passed on out of the "signal" outbox. It will ignore producerFinished messages. The decoder is able to work out from the data stream when it has reached the end of the stream. It then sends a producerFinished message out of the "signal" outbox and terminates. For more information see the Dirac Python bindings documentation. Dirac video encoderThis component encodes frames of YUV video data with the Dirac codec. This component is a thin wrapper around the Dirac Python bindings. Example UsageRaw video file encoder: imagesize = (352, 288) # "CIF" size video Pipeline(ReadFileAdapter("raw352x288video.yuv", ...other args...), RawYUVFramer(imagesize), DiracEncoder(preset="CIF"), WriteFileAdapter("diracvideo.drc") ).activate() RawYUVFramer is needed to frame raw YUV data into individual video frames. More detailReads video frames from the "inbox" inbox. Sends out encoded video data (as strings) in chunks to the "outbox" outbox. The encoder can be configured with simple presets and/or more detailed encoder and sequence parameters. Encoder and sequence parameters override those set with a preset. For more information see the Dirac Python bindings documentation. The encoder will terminate if it receives a shutdownMicroprocess or producerFinished message on its "control" inbox. The message is passed on out of the "signal" outbox. If the message is producerFinished, then it will also send any data still waiting to be sent out of the "outbox" outbox, otherwise any pending data is lost. The component does not yet support output of instrumentation or locally decoded frames (the "verbose" option). UNCOMPRESSED FRAME FORMATUncompresed video frames are output by the decoder, as dictionaries. Each contains the following entries: { "yuv" : (y_data, u_data, v_data) # a tuple of strings "size" : (width, height) # in pixels "frame_rate" : fps # frames per second "interlaced" : 0 or not 0 # non-zero if the frame is two interlaced fields "topfieldfirst" : 0 or not 0 # non-zero the first field comes first in the data "pixformat" : "YUV420_planar" # format of raw video data "chroma_size" : (width, height) # in pixels, for the u and v data } The encoder expects data in the same format, but only requires "yuv", "size", and "pixformat". Kamaelia.Codec.Dirac.DiracDecoderclass DiracDecoder(Axon.Component.component)DiracDecoder() -> new Dirac decoder component Creates a component that decodes Dirac video. Inboxes
Outboxes
Methods defined hereWarning! You should be using the inbox/outbox interface, not these methods (except construction). This documentation is designed as a roadmap as to their functionalilty for maintainers and new component developers. __init__(self)x.__init__(...) initializes x; see x.__class__.__doc__ for signature main(self)Main loop Kamaelia.Codec.Dirac.DiracEncoderclass DiracEncoder(Axon.Component.component)DiracEncoder([preset][,verbose][,encParams][,seqParams][,allParams]) -> new Dirac encoder component Creates a component to encode video using the Dirac codec. Configuration based on optional preset, optionally overriden by individual encoder and sequence parameters. All three 'params' arguments are munged together, so do what you like :) Keyword arguments:
Methods defined hereWarning! You should be using the inbox/outbox interface, not these methods (except construction). This documentation is designed as a roadmap as to their functionalilty for maintainers and new component developers. __init__(self[, preset][, verbose][, encParams][, seqParams][, allParams])x.__init__(...) initializes x; see x.__class__.__doc__ for signature main(self)Main loop FeedbackGot a problem with the documentation? Something unclear that could be clearer? Want to help improve it? Constructive criticism is very welcome - especially if you can suggest a better rewording! Please leave you feedback here in reply to the documentation thread in the Kamaelia blog. -- Automatic documentation generator, 05 Jun 2009 at 03:01:38 UTC/GMT |
Kamaelia
is an open source project originated from and guided by BBC
Research. For more information browse the site or get in
contact.
This is an ongoing community based development site. As a result the contents of this page is the opinions of the contributors of the pages involved not the organisations involved. Specificially, this page may contain personal views which are not the views of the BBC. (the site is powered by a wiki engine)
(C) Copyright 2008 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved.