目的
参考
- https://joshneri.us/converting-video-from-a-hubsan-h107d-using-handbrake-cli/
实现
先下载
单命令行实验
将下载的HandBrakeCLI 放到 /usr/local/bin或echo $PATH能访问的地方
HandBrakeCLI --preset "Very Fast 720p30" -i input.mp4 -o output.mp4
批量处理的script
#!/bin/bash
DEST_EXT=mp4
HANDBRAKE_CLI=HandBrakeCLI
for FILE in `ls $1`
do
filename=$(basename $FILE)
extension=${filename##*.}
filename=${filename%.*}
$HANDBRAKE_CLI --preset "Very Fast 720p30" -i $1/$FILE -o $1/$filename.output.$DEST_EXT && rm $1/$FILE
done
chmod +x HandBrakeCLI-Folder-RemoveOrigin.sh
测试