博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ffmpeg视频压缩速度_使用ffmpeg修改视频速度
阅读量:2515 次
发布时间:2019-05-11

本文共 2076 字,大约阅读时间需要 6 分钟。

ffmpeg视频压缩速度

I watch a lot of sports and recently I've become fascinated with some of the methodologies they use to illustrate events within the game.  I don't have their advanced TV software or hardware, of course, but I do have a love for ffmpeg, which allows me to do everything from  to change , , and more.

我看了很多体育比赛,最近我对他们用来说明比赛中事件的一些方法很着迷。 我当然没有他们先进的电视软件或硬件,但是我确实喜欢ffmpeg,这使我能够做所有事情,从到更改 , ,以及更多。

One of my favorite TV sports illustration techniques is speeding video up (time-lapse) or slowing it way down (slo-mo replay); naturally I wanted to know how to manipulate video speed with ffmpeg.  It turns out all you need to do is pass in filter with a PTS () value:

我最喜欢的电视体育插画技术之一是提高视频播放速度(延时)或降低视频播放速度(慢动作回放)。 自然,我想知道如何使用ffmpeg操纵视频速度。 事实证明,您需要做的只是传递带有PTS( )值的过滤器:

更快的视频速度 (Faster Video Speed)

ffmpeg -i input.mp4 -filter:v "setpts=0.5*PTS" output.mp4

较慢的视频速度 (Slower Video Speed)

ffmpeg -i input.mp4 -filter:v "setpts=2*PTS" output.mp4

The lower the PTS value, the faster the time-lapse video is generated.  If you use a larger value, the video will display in slower motion.

PTS值越低,延时视频生成越快。 如果使用较大的值,视频将以慢动作显示。

调整视频和音频 (Adjust video and audio)

If you care to sync the audio speed with the video speed, things get a bit more complicated:

如果您想将音频速度与视频速度同步,事情会变得更加复杂:

ffmpeg -i input.mp4 -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output.mp4

More confusing is that the atempo setting seems to require reverse logic to setpts ; i.e. doubling speed seems to require a different multiple.

更令人困惑的是, atempo设置似乎需要对setpts进行逆向逻辑; 即倍增速度似乎需要不同的倍数。

I recently used this slow-mo technique on a highlights video downloaded from YouTube to draw my own conclusions about a specific play.  The ability to manipulate video so easily, without a UI, also makes for easy automation of media, especially when you combine this technique with -- you get just the frames you want at the speed you want.  ffmpeg FTW!

最近,我在从YouTube下载的精彩视频中使用了这种慢动作技术,得出了自己对特定游戏的结论。 在没有UI的情况下如此轻松地操作视频的能力也使媒体的自动化变得容易,尤其是当您将此技术与结合使用时-您可以以所需的速度获得所需的帧。 ffmpeg FTW!

翻译自:

ffmpeg视频压缩速度

转载地址:http://ufvwd.baihongyu.com/

你可能感兴趣的文章
采访吴岳师兄有感 by 王宇飞
查看>>
LVS简略介绍
查看>>
hdu 1021 Fibonacci Again
查看>>
JVM架构_XmnXmsXmxXss有什么区别:转
查看>>
PHPExcel 使用心得
查看>>
洛谷 P3374 【模板】树状数组 1(单点加,区间和)
查看>>
verilog 代码编写小记
查看>>
PyQT的安装和配置
查看>>
从 docker 到 runC
查看>>
python基础学习笔记(十一)
查看>>
守护进程
查看>>
第十二周作业
查看>>
php数组
查看>>
Linux 防火墙
查看>>
android 自定义图片圆形进度条
查看>>
互联网金融P2P主业务场景自动化测试
查看>>
array_filter函数的应用
查看>>
梅西确定代言 中国首秀牵手Mate 8
查看>>
html,body
查看>>
一个Brushes笔画应用ios源码完整版
查看>>