test decoder programs, write raw output to files for now

This commit is contained in:
Muaz Ahmad 2023-10-10 16:43:28 +05:00
parent 0355704cb1
commit 82fc74f22c
2 changed files with 8 additions and 4 deletions

View file

@ -28,7 +28,9 @@ impl Decoder for Arc<Mutex<AACDecoder>> {
} }
pub fn new_aac(metadata: Arc<util::Metadata>) -> Result<AACDecoder, Box<dyn Error>> { pub fn new_aac(metadata: Arc<util::Metadata>) -> Result<AACDecoder, Box<dyn Error>> {
let f = File::create("raw.aac")?; let f = File::create("out.pcm")?;
let cmd = Command::new("tee").stdin(Stdio::piped()).stdout(f).spawn()?; let cmd = Command::new("faad")
.args(["-f", "2", "-w", "-q", "-"])
.stdin(Stdio::piped()).stdout(f).spawn()?;
return Ok(AACDecoder {cmd: cmd, metadata: metadata}) return Ok(AACDecoder {cmd: cmd, metadata: metadata})
} }

View file

@ -28,7 +28,9 @@ impl Decoder for Arc<Mutex<H264Decoder>> {
} }
pub fn new_h264(metadata: Arc<util::Metadata>) -> Result<H264Decoder, Box<dyn Error>> { pub fn new_h264(metadata: Arc<util::Metadata>) -> Result<H264Decoder, Box<dyn Error>> {
let f = File::create("raw.h264")?; let f = File::create("out.yuv")?;
let cmd = Command::new("tee").stdin(Stdio::piped()).stdout(f).spawn()?; let cmd = Command::new("ffmpeg")
.args(["-y", "-hide_banner", "-loglevel", "error" , "-i", "-", "-c:v", "rawvideo", "-pix_fmt", "yuv420p", "-f", "rawvideo", "-"])
.stdin(Stdio::piped()).stdout(f).spawn()?;
return Ok(H264Decoder {cmd: cmd, metadata: metadata}); return Ok(H264Decoder {cmd: cmd, metadata: metadata});
} }