From 8c3e9bb7c7f85d04933505f35ab275601aba0ae2 Mon Sep 17 00:00:00 2001 From: "gnoduoh@163.com" Date: Mon, 18 Mar 2024 14:02:16 +0800 Subject: [PATCH] ffmpeg --- docs/chapter/devops/ffmpeg.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/chapter/devops/ffmpeg.md b/docs/chapter/devops/ffmpeg.md index 9d99dba..86bde9e 100644 --- a/docs/chapter/devops/ffmpeg.md +++ b/docs/chapter/devops/ffmpeg.md @@ -52,6 +52,15 @@ ffmpeg -i input.mp4 -c:v libx264 -c:a aac -crf 23 -preset medium output.mp4 -vf "drawtext=text='水印':fontsize=24:x=(w-text_w-10):y=(h-text_h-10):fontcolor=white:box=1:boxcolor=black@0.5:fontfile=/path/to/font.ttf" ``` +## 缩略图 + +``` bash +# 多张预览 +ffmpeg -hide_banner -i input.mp4 -an -vf "select='eq(pict_type,PICT_TYPE_I)',thumbnail" -vsync vfr -frames:v 10 output_%03d.jpg +# X宫格 +ffmpeg -hide_banner -i input.mp4 -an -vf "select='eq(pict_type,PICT_TYPE_I)',thumbnail,scale=iw/2:-1,tile=2x2" -vsync vfr -frames:v 1 output.jpg +``` + ## 直播推流 ```