ffmpeg CLI设置-r 30(如果输入=> 30 fps,如果<<则为-r以获取输入fps. 30帧/秒 [英] ffmpeg CLI set -r 30 if input => 30 fps, else -r to take input fps if < 30 fps

查看:490
本文介绍了ffmpeg CLI设置-r 30(如果输入=> 30 fps,如果<<则为-r以获取输入fps. 30帧/秒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里发布了原始问题.尝试了建议的解决方案.但这并不能解决我的问题.

I posted my original question here. Tried suggested solution. But it does not solve my question.

这就是我所做的.从YouTube下载此视频作为测试.使用ffprobe给出:

Here's what I did. Download this video from Youtube as a test. Using ffprobe gives:

Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 59.94 fps, 59.94 tbr, 1k tbn, 119.88 tbc (default)

我使用的ffmpeg命令:

The ffmpeg command I used:

ffmpeg -i Iron_Man_1080p_60fps.mp4 -vf "select='eq(n,0)+if(gt(t-prev_selected_t,1/30.01),1,0)'" -vsync 0 -c:v libx265 -crf 28 -c:a aac -b:a 64k Iron_Man_1080p_60fps_CONVERTED.mp4

ffprobe我的输出文件Iron_Man_1080p_60fps_CONVERTED.mp4:

ffprobe my output file Iron_Man_1080p_60fps_CONVERTED.mp4:

Stream #0:0(und): Video: hevc (Main) (hev1 / 0x31766568), yuv420p(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 454 kb/s, 20.49 fps, 59.94 tbr, 19001 tbn, 59.94 tbc (default)

如您所见,fps从59.94 fps下降到20.49 fps.

As you can see, the fps dropped from 59.94 fps to 20.49 fps.

我不确定为什么建议的解决方案不起作用.

I'm not sure why the suggested solution does not work.

ffmpeg -i 120.mp4 -vf "select='eq(n,0)+if(gt(t-prev_selected_t,1/30.01),1,0)'" -vsync 0 out.mp4

也许-vf没有设置固定的帧率?

Perhaps -vf does not set a fixed framerate?

有人可以使用-r标志提供替代解决方案吗?

Could someone provide an alternative solution using the -r flag please?

这里是重新陈述的问题:

Here's re-stating question:

  • 如果输入fps => 30 fps,则设置-r 30
  • 如果输入fps<设置-r input_fps. 30 fps

谢谢!

推荐答案

示例视频的time_base很粗糙,因此该视频实际上是VFR.将间隔更改为1/30.5,以保持刚好超出1/30.01

The time_base for the sample video is coarse, so the video is actually VFR. Change the interval to 1/30.5 to keep frames which are just beyond the threshold for 1/30.01

-vf "select='eq(n,0)+if(gt(t-prev_selected_t,1/30.50),1,0)'"

这篇关于ffmpeg CLI设置-r 30(如果输入=&gt; 30 fps,如果&lt;&lt;则为-r以获取输入fps. 30帧/秒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆