termux中使用ffmpeg打中文水印,不能完全显示中文内容,求大佬帮忙
#!/bin/bash echo
">>>获取今天的照片列表"
# 循环调用ffmpeg处理文件
find ./ -type f -daystart -ctime -1 -name "*.jpg" -print0 | while IFS= read -r -d '' file; do
name=$(exiftool -s -s -s -FileName $file)
width=$(exiftool -s -s -s -ImageWidth $file)
height=$(exiftool -s -s -s -ImageHeight $file)
creation_time=$(exiftool -s -s -s -CreateDate $file)
date_part=$(echo $creation_time |sed 's/:/-/g' | cut -d' ' -f1)
# 提取时间部分
time_part=$(echo $creation_time | cut -d' ' -f2 | cut -d'+' -f1 |sed 's/:/\\\:/'g)
time_font=$(echo "$height*0.1")
date_font=$(echo "$height*0.05")
date_y=$(echo "$height-$date_font")
time_y=$(echo "$date_y-$time_font")
ffmpeg -i $file -vf "drawtext=text='$time_part':x=(w-text_w)/2:y=$time_y:fontsize=$time_font:fontcolor=white :fontfile=./static/NotoSansSC-Regular.ttf, drawtext=text='$date_part 今天天气真好' :x=(w-text_w)/2:y=$date_y:fontsize=$date_font:fontcolor=white:fontfile=./static/NotoSansSC-Regular.ttf, drawtext=text='水印相机DF':x=w-text_w:y=h-text_h-10:fontsize=h*0.025:fontcolor=white :fontfile=./static/NotoSansSC-Regular.ttf" "DF_$name"
done
echo "水印标记成功<<<
#!/bin/bash echo
">>>获取今天的照片列表"
# 循环调用ffmpeg处理文件
find ./ -type f -daystart -ctime -1 -name "*.jpg" -print0 | while IFS= read -r -d '' file; do
name=$(exiftool -s -s -s -FileName $file)
width=$(exiftool -s -s -s -ImageWidth $file)
height=$(exiftool -s -s -s -ImageHeight $file)
creation_time=$(exiftool -s -s -s -CreateDate $file)
date_part=$(echo $creation_time |sed 's/:/-/g' | cut -d' ' -f1)
# 提取时间部分
time_part=$(echo $creation_time | cut -d' ' -f2 | cut -d'+' -f1 |sed 's/:/\\\:/'g)
time_font=$(echo "$height*0.1")
date_font=$(echo "$height*0.05")
date_y=$(echo "$height-$date_font")
time_y=$(echo "$date_y-$time_font")
ffmpeg -i $file -vf "drawtext=text='$time_part':x=(w-text_w)/2:y=$time_y:fontsize=$time_font:fontcolor=white :fontfile=./static/NotoSansSC-Regular.ttf, drawtext=text='$date_part 今天天气真好' :x=(w-text_w)/2:y=$date_y:fontsize=$date_font:fontcolor=white:fontfile=./static/NotoSansSC-Regular.ttf, drawtext=text='水印相机DF':x=w-text_w:y=h-text_h-10:fontsize=h*0.025:fontcolor=white :fontfile=./static/NotoSansSC-Regular.ttf" "DF_$name"
done
echo "水印标记成功<<<