August'24: Kamaelia is in maintenance mode and will recieve periodic updates, about twice a year, primarily targeted around Python 3 and ecosystem compatibility. PRs are always welcome. Latest Release: 1.14.32 (2024/3/24)
These components convert the pixel format of video frames, for example, from interleaved RGB to planar YUV 420.
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()
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 |
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.
" 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:
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 loop.
" 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:
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 loop.
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, 05 Jun 2009 at 03:01:38 UTC/GMT