Kamaelia

Nuts & Bolts | Components | Tools | Cookbook | Systems
wiki:( guest738784, Dev Console, Index, Recent, Edit )


Home, News
Dev Console

How, Why
Project Blog
Summer of Code

Documentation
Download
SVN (web)
Sourceforge page

Project Admin
License

Contact Us

  Page Tags

No tags are defined for this page yet - how would you classify/think of this page? Add your notes below!

Kamaelia docs : Kamaelia.Video.PixFormatConversion

Converting the pixel format of video frames

These components convert the pixel format of video frames, for example, from interleaved RGB to planar YUV 420.

Example Usage

Decoding a Dirac encoded video file, then converting it to RGB for display on a pygame display surface:

Pipeline( RateControlledFileReader("video.drc",readmode="bytes", rate=100000),
          DiracDecoder(),
          ToRGB_interleaved(),
          VideoSurface(),
        ).run()

Which component for which conversion?

The components here are currently capable of the following pixel format conversions:

From To Which component?
"RGB_interleaved" "RGB_interleaved" ToRGB_interleaved
"YUV420_planar" "RGB_interleaved" ToRGB_interleaved
"YUV422_planar" "RGB_interleaved" ToRGB_interleaved
"RGB_interleaved" "YUV420_planar" ToYUV420_planar
"YUV420_planar" "YUV420_planar" ToYUV420_planar

More details

Send video frames to the "inbox" inbox of these components. They will be converted to the destination pixel format and sent out of the "outbox" outbox. Video frames are dictionaries, they must have the following keys:

  • "rgb" or "yuv" -- containing the pixel data
  • "pixformat" -- the pixel format
  • "size" -- (width,height) in pixels

Any other fields will be transparently passed through, unmodified.

These components support sending data out of its outbox to a size limited inbox. If the size limited inbox is full, these components will pause until able to send out the data. Data will not be consumed from the inbox if these components are waiting to send to the outbox.

If a producerFinished message is received on the "control" inbox, these components will complete converting and frames pending in its inbox, and finish sending any resulting data to its outbox. They will then send the producerFinished message on out of its "signal" outbox and terminate.

If a shutdownMicroprocess message is received on the "control" inbox, these components will immediately send it on out of its "signal" outbox and immediately terminate. It will not complete processing, or sending on any pending data.


Kamaelia.Video.PixFormatConversion.ToRGB_interleaved

class ToRGB_interleaved(Axon.Component.component)

" ToRGB_interleaved() -> new ToRGB_interleaved component.

Converts video frames sent to its "inbox" inbox, to "RGB_interleaved" pixel format and sends them out of its "outbox"

Supports conversion from:

  • YUV420_planar
  • YUV422_planar
  • RGB_interleaved (passthrough)

Inboxes

  • control : Shutdown signalling
  • inbox : Video frame

Outboxes

  • outbox : RGB_interleaved pixel format video frame
  • signal : Shutdown signalling

Methods defined here

Warning!

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.

main(self)

Main loop.

Kamaelia.Video.PixFormatConversion.ToYUV420_planar

class ToYUV420_planar(Axon.Component.component)

" ToYUV420_planar() -> new ToYUV420_planar component.

Converts video frames sent to its "inbox" inbox, to "ToYUV420_planar" pixel format and sends them out of its "outbox"

Supports conversion from:

  • RGB_interleaved
  • YUV420_planar (passthrough)

Inboxes

  • control : Shutdown signalling
  • inbox : Video frame

Outboxes

  • outbox : YUV420_planar pixel format video frame
  • signal : Shutdown signalling

Methods defined here

Warning!

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.

main(self)

Main loop.

Feedback

Got 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, 23 Jul 2008 at 03:02:36 UTC/GMT


Your tags for this page: If you had set UserPreferences (name & email) and validated them (simple single click in your email), you would be able to define personal tags

Versions: current , 1


(C) 2005 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved,
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.