Skip to content

Commit

Permalink
🔥 Remove ffmpeg_args_factory.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
tgotwig committed Nov 29, 2023
1 parent 7b3325d commit e8f7030
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 23 deletions.
7 changes: 5 additions & 2 deletions src/commanders/_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ use std::{

use path_slash::PathBufExt;

pub fn merge(args: [String; 10]) -> Result<Child, std::io::Error> {
let cmd = format!("ffmpeg {}", args.join(" "));
pub fn merge(input: String, output: String) -> Result<Child, std::io::Error> {
let cmd = format!(
"ffmpeg -y -f concat -safe 0 -i {} -c copy {}",
input, output
);

println!("- {}", cmd);
execute_cmd(cmd)
Expand Down
4 changes: 2 additions & 2 deletions src/commanders/merger.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::commanders::_cmd;

pub fn merge(ffmpeg_args: [String; 10], file_format: String) {
let child = _cmd::merge(ffmpeg_args);
pub fn merge(input: String, output: String, file_format: String) {
let child = _cmd::merge(input, output);

let res = child.unwrap().wait_with_output();
println!("{:?}", res);
Expand Down
14 changes: 0 additions & 14 deletions src/ffmpeg_args_factory.rs

This file was deleted.

8 changes: 3 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use std::path::PathBuf;
use std::thread;
mod cli;
mod commanders;
mod ffmpeg_args_factory;
mod helpers;
use crate::commanders::fps_reader::get_fps;
use crate::helpers::str_helper::create_order_of_merging;
Expand Down Expand Up @@ -75,12 +74,11 @@ fn main() -> Result<(), Error> {
let ffmpeg_input_file = tmp_dir.join("ffmpeg_input_file.txt");
create(&ffmpeg_input_file, ffmpeg_input_content);

let ffmpeg_merge_args = ffmpeg_args_factory::make_ffmpeg_merge_args(
&ffmpeg_input_file.to_slash().unwrap(),
commanders::merger::merge(
ffmpeg_input_file.to_slash().unwrap(),
ffmpeg_output_file.to_slash().unwrap().to_string(),
file_format,
);

commanders::merger::merge(ffmpeg_merge_args, file_format);
}
}

Expand Down

0 comments on commit e8f7030

Please sign in to comment.