FFmpeg在启动时卡住了几秒钟 [英] FFmpeg stucks for few seconds on start
问题描述
我正在尝试在Android上剪切视频并调整大小(但在MacOS上却类似),但是当我运行ffmpeg命令时,它会返回我
I'm trying to cut and resize video on Android(but it is similar on MacOS) , but when I run the ffmpeg command it returns me
frame = 0 fps = 0.0 q = 0.0 size = 0kB时间= 00:00:00.00比特率= N/A速度=
frame= 0 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed=
它重复大约20秒(我有3K持续时间的4K视频).
It repeats for about 20 sec (I have 4K video with 3 sec duration).
有什么方法可以提高处理速度吗?这是我的ffmpeg命令的示例
Is there any way to improve process speed? Here is example of my ffmpeg command
ffmpeg -y -i input.mp4 -ss 00:01.82 -to 00:02.94 -vf scale = 500:1024 -c:v libx264 -c:a aac -b:v 500k -b:a 96k输出. mp4
ffmpeg -y -i input.mp4 -ss 00:01.82 -to 00:02.94 -vf scale=500:1024 -c:v libx264 -c:a aac -b:v 500k -b:a 96k output.mp4
推荐答案
在输入执行解码的帧查找之后使用-ss
,这比较慢.切换到解复用器搜索
Use of -ss
after the input performs a decoded frame seek, which is slower. Switch to demuxer seek
ffmpeg -y -ss 00:01.82 -to 00:02.94 -i input.mp4 -vf scale=500:1024 -c:v libx264 -c:a aac -b:v 500k -b:a 96k output.mp4
用于Demuxer的
-to
是最近才添加的,因此获取当前的git版本.否则,在计算出的持续时间中使用-t
.
-to
for demuxer was only recently added, so get a current git version. Else, use -t
with the calculated duration.
这篇关于FFmpeg在启动时卡住了几秒钟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!