Browse Source

refactor ffmpeg-x265

master
VirtuBox 5 months ago
parent
commit
699f151800
Signed by: virtubox GPG Key ID: 22EB296C97BAD476
1 changed files with 14 additions and 6 deletions
  1. +14
    -6
      mybashrc

+ 14
- 6
mybashrc View File

@ -756,12 +756,20 @@ _TRANSFER_AUDIO() {
}
_x265_encode() {
if [ "$#" -eq 1 ]; then
ffmpeg -i "$1" -c:v libx265 -crf 28 -c:a aac -b:a 160k "${1%.*}-x265.mp4"
else
for i in "$PWD"/*; do
ffmpeg -i "$i" -c:v libx265 -crf 28 -c:a aac -b:a 160k "${i%.*}-x265.mp4"
done
if [ "$#" -eq 0 ]; then
echo "Usage : ffmpeg-x265 <file> <options>"
echo "Options :"
echo " -d : process all files in the current directory"
elif [ "$#" -eq 1 ]; then
if [ "$1" = "-d" ]; then
for i in "$PWD"/*; do
ffmpeg -i "$i" -c:v libx265 -crf 28 -c:a aac -b:a 160k "${i%.*}-x265.mp4"
done
else
if [ -f "$1" ]; then
ffmpeg -i "$1" -c:v libx265 -crf 28 -c:a aac -b:a 160k "${1%.*}-x265.mp4"
fi
fi
fi
}


Loading…
Cancel
Save