ffmpeg 视频转动图

Tags
multimediawebffmpeg
Created
Jul 22, 2018 4:06 AM

转 avif: https://web.dev/avif-updates-2023/#animated-avif

// 不写输出参数就是查看信息

转 webp 需要使用非默认选项安装(brew)libwebp 编码器:

brew install ffmpeg $(brew options ffmpeg | grep -vE '\s' | grep -- '--with-' | tr '\n' ' ')

ffmpeg 文档:https://ffmpeg.org/ffmpeg.html

  • t duration (input/output) 指定时长
  • ss position (input/output) 指定开始位置
  • to position (input/output) 指定结束为止
  • i url (input) 输入文件
  • f fmt (input/output) 文件格式,会自动识别
  • y (global) 强制覆盖输出文件
  • c[:stream_specifier]/codec (input/output) 指定单个流的 codec,-c:v === -vcodec
  • an (output) 禁用声音
  • r[:stream_specifier] fps (input/output) 设置帧率
  • filter[:stream_specifier] (output) 设置滤镜,视频滤镜缩写 -vf
    • crop=1200:800
    • scale=600:400

ffmpeg 编解码器文档:https://ffmpeg.org/ffmpeg-codecs.html

转 webp:

  • loop // 循环次数
  • lossless boolean // 是否无损
  • compression_level integer // 0~6 默认 4
  • qscale float // 0~100 默认 75

转 apng:

  • plays integer // 循环次数,0 表示无限
SuperMade with Super