mirror of
https://github.com/eRgo35/ascii.git
synced 2026-02-03 20:36:10 +01:00
video path added
This commit is contained in:
@@ -74,6 +74,9 @@ pub enum Subcommands {
|
||||
},
|
||||
|
||||
Vid {
|
||||
#[arg(short, long, default_value_t = String::from(""))]
|
||||
input: String,
|
||||
|
||||
#[arg(long, default_value_t = false)]
|
||||
invert: bool,
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ use ffmpeg_next::software::scaling::{context::Context, flag::Flags};
|
||||
use ffmpeg_next::util::frame::video::Video;
|
||||
|
||||
pub fn video(
|
||||
input_path: String,
|
||||
invert: bool,
|
||||
colorful: bool,
|
||||
width: usize,
|
||||
@@ -21,12 +22,17 @@ pub fn video(
|
||||
) {
|
||||
ffmpeg_next::init().unwrap();
|
||||
|
||||
if let Ok(mut ictx) = input("bad_apple.webm") {
|
||||
if input_path.is_empty() {
|
||||
eprintln!("Error: No input path provided");
|
||||
std::process::exit(1);
|
||||
}
|
||||
|
||||
if let Ok(mut ictx) = input(&input_path) {
|
||||
let input = ictx
|
||||
.streams()
|
||||
.best(Type::Video)
|
||||
.ok_or(ffmpeg_next::Error::StreamNotFound)
|
||||
.unwrap();
|
||||
.expect("Failed to find video stream");
|
||||
let video_stream_index = input.index();
|
||||
|
||||
let context_decoder =
|
||||
|
||||
@@ -42,6 +42,7 @@ fn main() {
|
||||
);
|
||||
}
|
||||
Some(libs::args::Subcommands::Vid {
|
||||
input,
|
||||
invert,
|
||||
colorful,
|
||||
width,
|
||||
@@ -53,7 +54,7 @@ fn main() {
|
||||
lightmap,
|
||||
}) => {
|
||||
libs::vid_handler::video(
|
||||
invert, colorful, width, height, pixel, noresize, matrix, nofill, lightmap,
|
||||
input, invert, colorful, width, height, pixel, noresize, matrix, nofill, lightmap,
|
||||
);
|
||||
}
|
||||
None => {
|
||||
|
||||
Reference in New Issue
Block a user