diff --git a/src/decode/codecs/audio.rs b/src/decode/codecs/audio.rs index efab7a6..09a270d 100644 --- a/src/decode/codecs/audio.rs +++ b/src/decode/codecs/audio.rs @@ -28,7 +28,9 @@ impl Decoder for Arc> { } pub fn new_aac(metadata: Arc) -> Result> { - let f = File::create("raw.aac")?; - let cmd = Command::new("tee").stdin(Stdio::piped()).stdout(f).spawn()?; + let f = File::create("out.pcm")?; + let cmd = Command::new("faad") + .args(["-f", "2", "-w", "-q", "-"]) + .stdin(Stdio::piped()).stdout(f).spawn()?; return Ok(AACDecoder {cmd: cmd, metadata: metadata}) } diff --git a/src/decode/codecs/video.rs b/src/decode/codecs/video.rs index 7673deb..e49118b 100644 --- a/src/decode/codecs/video.rs +++ b/src/decode/codecs/video.rs @@ -28,7 +28,9 @@ impl Decoder for Arc> { } pub fn new_h264(metadata: Arc) -> Result> { - let f = File::create("raw.h264")?; - let cmd = Command::new("tee").stdin(Stdio::piped()).stdout(f).spawn()?; + let f = File::create("out.yuv")?; + 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}); }