mirror of
https://github.com/JanJastrow/.dotfiles.git
synced 2024-11-21 18:19:56 +01:00
Compare commits
3 Commits
df32e13ee1
...
d76591cf66
Author | SHA1 | Date | |
---|---|---|---|
|
d76591cf66 | ||
|
51865ae6c7 | ||
|
7846f1a0d9 |
38
zsh/ffmpeg
38
zsh/ffmpeg
@ -78,6 +78,44 @@ ff-x264-scale540p() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Recompress input MP4 to 720p x265 MP4 (copy audio)
|
||||||
|
ff-x265-scale720p() {
|
||||||
|
local crf=${1-20}
|
||||||
|
for input in *.mp4; do
|
||||||
|
if [[ -f "$input" ]]; then
|
||||||
|
tempfile="temp_${input%.mp4}"
|
||||||
|
ffmpeg -hide_banner -loglevel info -i "$input" -map 0 -c:v libx265 -x265-params strong-intra-smoothing=0:rect=0:aq-mode=1:rd=4:psy-rd=0.75:psy-rdoq=4.0:rdoq-level=1:rskip=2 -vf scale=1280:-2 -crf "$crf" -tag:v hvc1 -c:s copy -c:a copy -movflags faststart "$tempfile.mp4"
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
mv "$input" "_$input"
|
||||||
|
mv "$tempfile.mp4" "$input"
|
||||||
|
echo "Conversion successful: $input"
|
||||||
|
else
|
||||||
|
echo "Conversion failed for: $input"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
pushover "FFmpeg done ✔"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Recompress input MP4 to 720p x265 MP4 (copy audio)
|
||||||
|
ff-x265-scale720p() {
|
||||||
|
local crf=${1-20}
|
||||||
|
for input in *.mp4; do
|
||||||
|
if [[ -f "$input" ]]; then
|
||||||
|
tempfile="temp_${input%.mp4}"
|
||||||
|
ffmpeg -hide_banner -loglevel info -i "$input" -map 0 -c:v libx265 -x265-params strong-intra-smoothing=0:rect=0:aq-mode=1:rd=4:psy-rd=0.75:psy-rdoq=4.0:rdoq-level=1:rskip=2 -vf scale=1280:-2 -crf "$crf" -tag:v hvc1 -c:s copy -c:a copy -movflags faststart "$tempfile.mp4"
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
mv "$input" "_$input"
|
||||||
|
mv "$tempfile.mp4" "$input"
|
||||||
|
echo "Conversion successful: $input"
|
||||||
|
else
|
||||||
|
echo "Conversion failed for: $input"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
pushover "FFmpeg done ✔"
|
||||||
|
}
|
||||||
|
|
||||||
# Recompress input MP4 to 720p AV1 MP4 (copy audio)
|
# Recompress input MP4 to 720p AV1 MP4 (copy audio)
|
||||||
ff-av1-scale720p() {
|
ff-av1-scale720p() {
|
||||||
local crf=${1-23}
|
local crf=${1-23}
|
||||||
|
Loading…
Reference in New Issue
Block a user