Last active
December 10, 2024 12:23
-
-
Save oddmario/d0b2b0651af9d97ad0cba7aa35976ba0 to your computer and use it in GitHub Desktop.
Revisions
-
oddmario revised this gist
Dec 10, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,6 +19,6 @@ if [ -z "$track" ]; then fi # Use the detected audio track index ffmpeg -i "$input" -vn -acodec aac -map 0:"$track" "$output" echo "File processed successfully: $output" -
oddmario created this gist
Dec 10, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ #!/bin/bash # Check if the correct number of arguments is provided if [ "$#" -ne 2 ]; then echo "Usage: $0 <input_file> <output_file>" exit 1 fi input="$1" output="$2" # Find the "original" audio track dynamically track=$(ffprobe -i "$input" -v error -select_streams a \ -show_entries stream=index:stream_tags=title -of csv=p=0 | grep -i "original" | cut -d ',' -f1) if [ -z "$track" ]; then echo "No 'original' audio track found!" exit 1 fi # Use the detected audio track index ffmpeg -i "$input" -vn -acodec aac -map 0:a:"$track" "$output" echo "File processed successfully: $output"