Theora-1.0

Theora.Encoding

Contents

Description

This module calls the libtheora C library to generate video ogg files from YCbCr images. As explained on http://theora.org/doc/libtheora-1.0/group__encfuncs.html, the basic steps for creating a video are the following :

Synopsis

Theora structures and function

data Comment Source

Constructors

Comment 

Fields

user :: [String]

Your comments

vendor :: String

Name of the encoder, i.e. your application

Instances

data PixelFmt Source

Theora supports 4 different pixel formats, listed in http://theora.org/doc/Theora.pdf. YCbCr chroma frames (Cb and Cr) may be resized for compression (see http://en.wikipedia.org/Ycbcr). The resulting pixel formats are as follows :

Constructors

Pf420

Chroma decimation by 2 in both directions

Pf422

Chroma decimation by 2 in the x direction

Pf444

No chroma decimation

Instances

data ColorSpace Source

Constructors

Unspecified 
ItuRec470M

A color space designed for NTSC content

ItuRec470BG

A color space designed for PAL/SECAM content

Instances

encodeAlloc :: Info -> IO (Maybe EncCtx)Source

Makes an encoder (EncCtx) instance out of an Info record

flushHeader :: EncCtx -> Comment -> IO [OggPacket]Source

Returns the last header packets. This function should be called before encoding actual video.

data YCbCrBuffer Source

YCbCrBuffer is the type of raw YCbCr frames

Constructors

YCbCr 

Fields

y :: ImgPlane

the Y plane

cb :: ImgPlane

the Cb plane

cr :: ImgPlane

the Cr plane

newYCbCr :: Int -> Int -> PixelFmt -> IO YCbCrBufferSource

Allocate a new YCbCrBuffer object

encodeIn :: EncCtx -> YCbCrBuffer -> IO ()Source

Submits a frame for encoding

encodeOut :: EncCtx -> Bool -> IO [OggPacket]Source

Retrieve all the ready encoded packets

Ogg-related functions

newOggStreamState :: Int -> IO OggStreamStateSource

Initializes an Ogg container stream

streamPacketIn :: OggStreamState -> OggPacket -> IO ()Source

Submits an encoded packet into the streams

streamPageOut :: OggStreamState -> IO (Maybe OggPage)Source

Get an outputable Ogg page

streamFlush :: OggStreamState -> IO (Maybe OggPage)Source

Retrieve the last pages of the stream