From f8b3a65a35b6ac966dbe4e45ad9399cb4d06e0f7 Mon Sep 17 00:00:00 2001 From: Thomas Heck Date: Fri, 22 Nov 2019 16:29:24 +0100 Subject: [PATCH] ffmpeg testing --- Cargo.toml | 2 +- shell.nix | 14 ++++++++++++++ src/main.rs | 6 ++++-- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 shell.nix diff --git a/Cargo.toml b/Cargo.toml index 6a701a0..d8cc3d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,5 +5,5 @@ authors = ["Thomas Heck "] edition = "2018" [dependencies] -ffmpeg-next = { path = "../rust-ffmpeg" } +stainless_ffmpeg = "0.1" rayon = "1.0.2" diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..a39a3cb --- /dev/null +++ b/shell.nix @@ -0,0 +1,14 @@ +with import {}; + +stdenv.mkDerivation { + name = "audio_conv"; + buildInputs = [ + stdenv + pkg-config + ffmpeg_4 + clang + cargo + rustc + ]; + LIBCLANG_PATH="${llvmPackages.libclang}/lib"; +} diff --git a/src/main.rs b/src/main.rs index 8ba3e81..742bc8b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,7 @@ use std::env; use std::path::Path; use std::{fs, io}; -use ffmpeg_next::{self as ffmpeg, codec, filter, format, frame, media}; +use stainless_ffmpeg::{self as ffmpeg, codec, filter, format, frame, media}; use rayon::prelude::*; #[derive(Debug)] @@ -13,7 +13,7 @@ enum Error { Str(&'static str), } -impl From for Error { +impl From for Error { fn from(v: ffmpeg::Error) -> Error { Error::Ffmpeg(v) } @@ -151,6 +151,8 @@ fn transcoder( } fn transcode(input: &Path, output: &Path) -> Result<(), Error> { + println!("{:?}", output); + let mut ictx = format::input(&input)?; let original_extension = output .extension()