Struct x264_framing::Encoder
[−]
[src]
pub struct Encoder<F> { /* fields omitted */ }
Encodes your video. Be nice to it!
Methods
impl<F> Encoder<F>
[src]
fn encode<T>(&mut self, pts: i64, image: &T) -> Result<(Data, Picture), Error> where
T: Image<Format = F>,
F: Format,
T: Image<Format = F>,
F: Format,
Feeds the encoder.
You have to give the encoder an image and a
pts
to encode.
The output is a byte sequence you can feed to stuff, and some image
data that you can use, too - you hopefully being a muxer or something.
fn work(&mut self) -> Result<(Data, Picture), Error>
Tells the encoder to keep encoding.
I guess you'd use this because the encoder somehow delayed some frames
or something and so isn't done yet. Don't ask me, I don't know how any
of this works either! That said, you might call in a loop until it's
done
before disposing of it, if you aren't using the encoder for
streaming purposes (e.g. if you're actually saving the file.)
fn headers(&mut self) -> Result<Data, Error>
Gets the video headers.
Send this before sending other things.
fn done(&self) -> bool
Indicates whether the encoder is done.
Again, not sure on the specifics, but it's something to do with delayed
frames, and if it's not done it probably won't be done until you call
work
until it says it is done.