ffmpeg的一些用法,不定期更新

本文档汇总了FFmpeg的多种用法,包括:调整视频尺寸以保持长宽比,添加文字和阴影,理解H.264 profile,设置线程数,实现流式播放,增大处理缓存,理解qscale,音频变速,合并不同比例视频,硬件加速,延长视频,显示媒体信息,查看设备信息等。这些技巧涵盖了FFmpeg在视频处理中的常见应用场景。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ffmpeg的一些用法,不定期更新

1.宽度占一半,贴图
ffmpeg.exe -i .\7200.mp4 -i .\640.png -filter_complex "[1]scale=360:-2[a],[0][a]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -y out7200.mp4
2.FFmpeg drawtext添加文字和阴影样式
drawtext=fontcolor=white:fontsize=40:fontfile=msyh.ttf:text='Hello World':x=w*0.4:y=h*0.6:shadowx=5:shadowy=5:alpha=0.5
3.缩放图片保持长宽比,且防止libx264报比例不能被2整除的错误
[1]scale=640:-2[a]
原理如下:If one and only one of the values is -n with n >= 1, the scale filter will use a value that maintains the aspect ratio of the input image, calculated from the other specified dimension. After that it will, however, make sure that the calculated dimension is divisible by n and adjust the value if necessary —来自FFmpeg.org
4.H.264 profile

H.264有四种画质级别,分别是baseline, extended, main, high:
  1、Baseline Profile:基本画质。支持I/P 帧,只支持无交错(Progressive)和CAVLC;
  2、Extended profile:进阶画质。支持I/P/B/SP/SI 帧,只支持无交错(Progressive)和CAVLC;(用的少)
  3、Main pro

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值