ffmpeg testing

This commit is contained in:
2019-11-22 16:29:24 +01:00
parent c0f7b3212f
commit f8b3a65a35
3 changed files with 19 additions and 3 deletions

View File

@@ -5,5 +5,5 @@ authors = ["Thomas Heck <t@b128.net>"]
edition = "2018"
[dependencies]
ffmpeg-next = { path = "../rust-ffmpeg" }
stainless_ffmpeg = "0.1"
rayon = "1.0.2"

14
shell.nix Normal file
View File

@@ -0,0 +1,14 @@
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "audio_conv";
buildInputs = [
stdenv
pkg-config
ffmpeg_4
clang
cargo
rustc
];
LIBCLANG_PATH="${llvmPackages.libclang}/lib";
}

View File

@@ -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<ffmpeg::Error> for Error {
impl From<ffmpeg::error::Error> 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()