Add ffmpeg-batch-compress-videos.sh
This commit is contained in:
18
scripts/shell/ffmpeg-batch-compress-videos.sh
Executable file
18
scripts/shell/ffmpeg-batch-compress-videos.sh
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Create a new directory for processed files
|
||||||
|
[[ -d processed_videos ]] && rm -rf processed_videos
|
||||||
|
mkdir processed_videos
|
||||||
|
|
||||||
|
# Loop through each video file in the current directory
|
||||||
|
for file in *.mkv *.ts *.mov; do
|
||||||
|
# Check if the file is a video file
|
||||||
|
if [[ -f "$file" ]]; then
|
||||||
|
# Extract the filename without extension
|
||||||
|
# filename=$(basename -- "$file")
|
||||||
|
# filename_no_ext="${filename%.*}"
|
||||||
|
|
||||||
|
# Compress the video to 1080p MP4 using AMD h264_amf hardware acceleration
|
||||||
|
'/mnt/e/programs/ffmpeg-2024-08-15-git-1f801dfdb5-full_build/bin/ffmpeg.exe' -i "$file" -c:v hevc_amf -rc cqp -qp_i 32 -qp_p 32 "processed_videos/${file}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user