mirror of
https://github.com/JanJastrow/.dotfiles.git
synced 2024-11-22 02:29:57 +01:00
Add counter to function
This commit is contained in:
parent
666f8d496c
commit
2065901189
@ -20,13 +20,16 @@ function ff-mp4 () {
|
||||
rm "$temp_file" # Delete the temporary file
|
||||
|
||||
# Process each file in the file_list array
|
||||
local num_files=${#file_list[@]}
|
||||
local counter=1
|
||||
for file in "${file_list[@]}"; do
|
||||
local dir=$(dirname "$file")
|
||||
local file_name=$(basename "$file")
|
||||
local name="${file_name%.*}"
|
||||
local ext="${file_name##*.}"
|
||||
|
||||
echo "Processing file: $file_name"
|
||||
echo "Processing file [$counter/$num_files]: $file_name"
|
||||
counter=$((counter+1))
|
||||
|
||||
# Re-container the video file to mp4 using ffmpeg
|
||||
ffmpeg -hide_banner -loglevel error -i "$file" -map 0 -c copy -pix_fmt yuv420p -movflags faststart "$dir/temp_$name.mp4"
|
||||
|
Loading…
Reference in New Issue
Block a user