From 8e7a5d60a2aad235326a3a3190cc64c24685089f Mon Sep 17 00:00:00 2001 From: skywind3000 Date: Wed, 27 Jan 2021 16:16:28 +0800 Subject: [PATCH] commit ffmpeg.sh --- tools/ffmpeg.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/ffmpeg.sh b/tools/ffmpeg.sh index 2eabaa7..3bb21d0 100644 --- a/tools/ffmpeg.sh +++ b/tools/ffmpeg.sh @@ -96,7 +96,8 @@ ffmpeg -i "" out.mp4 # 下载视频 ffmpeg -f lavfi -i anullsrc -i in.gif -c:v libx264 -c:a aac -shortest out.mp4 # 给 gif 加上静音音轨并转换成 mp4,兼容手机播放 -ffmpeg -f lavfi -i anullsrc -i in.gif -c:v libx264 -c:a aac -shortest -pix_fmt yuv420p out.mp4 +ffmpeg -f lavfi -i anullsrc -i in.gif -c:v libx264 -c:a aac -shortest \ + -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" out.mp4 ##############################################################################