You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.1 KiB
Rust

#![allow(dead_code)]
use crate::av::init;
use crate::transcoder::Transcoder;
use ffmpeg_sys_next::{av_make_error_string, av_malloc, av_version_info};
use std::ffi::{CStr, CString};
use std::os::raw::{c_char, c_int};
pub mod av;
pub mod transcoder;
pub mod utils;
// const INPUT_PATH: &str = "/tank/ephemeral/anime/series/Witch Hunter Robin - 2ndfire/[2ndfire]Witch_Hunter_Robin_-_01[91DCE49A].mkv";
const INPUT_PATH: &str = "/tank/ephemeral/anime/series/Brave Witches - Eila/Extras/[Eila] Brave Witches - NCOP [BD 1080p][DB44ED0B].mkv";
const OUTPUT_PATH: &str = "/tmp/transotf";
fn av_err2str(error_code: c_int) -> String {
unsafe {
let str: *mut c_char = av_malloc(1024).cast();
av_make_error_string(str, 1024, error_code);
CString::from_raw(str).to_str().unwrap().to_string()
}
}
fn main() {
println!("> transotf: ffmpeg {}", unsafe {
CStr::from_ptr(av_version_info()).to_str().unwrap()
});
init();
let mut transcoder = Transcoder::create(INPUT_PATH, OUTPUT_PATH, None, None)
.expect("Failed to create transcoder");
transcoder.transcode().expect("Failed to transcode");
}