oddity-ai / video-rs

Video readers, writers, muxers, encoders and decoders for Rust based on ffmpeg libraries.
Apache License 2.0
248 stars 31 forks source link

How to convert Context to bytes? #34

Closed soupslurpr closed 8 months ago

soupslurpr commented 8 months ago

Hi, I'm trying to convert a raw frame to RGB8 and then get the bytes, how do I do this?

for frame in video_decoder.decode_raw_iter().enumerate() {
  let (current_frame, Ok(frame)) = frame else { break };

  let frame = frame.converter(Pixel::RGB8).unwrap();

Thanks.

soupslurpr commented 8 months ago

Okay you have to do Context::get and use that