mostly okay decoder, slight glitching

This commit is contained in:
l1npengtul
2022-12-18 16:09:58 +09:00
parent 84e132929c
commit 4efd0b0fbf
6 changed files with 37 additions and 5 deletions
+20
View File
@@ -0,0 +1,20 @@
use nokhwa_core::buffer::Buffer;
use nokhwa_core::pixel_format::RgbFormat;
use nokhwa_core::types::{FrameFormat, Resolution};
use std::fs::File;
use std::io::Read;
fn main() {
let mut nv12 = Vec::new();
File::open("cchlop.nv12")
.unwrap()
.read_to_end(&mut nv12)
.unwrap();
let buffer = Buffer::new(Resolution::new(1920, 1080), &nv12, FrameFormat::NV12);
buffer
.decode_image::<RgbFormat>()
.unwrap()
.save("cchlop_out_nv12.png")
.unwrap();
}