使用ffmpeg来改变帧率 [英] Using ffmpeg to change framerate

查看:2886
本文介绍了使用ffmpeg来改变帧率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将视频剪辑(MP4,yuv420p)从30 fps转换为24 fps。帧数是正确的,所以我的输出应该从30fps的20分钟变化到24fps的25分钟。一切都应该保持不变。

I am trying to convert a video clip (MP4, yuv420p) from 30 fps to 24 fps. The number of frames is correct so my output should change from 20 minutes at 30fps to 25 minutes at 24fps. Everything else should remain the same.

尽可能的尝试一下,我用ffmpeg来尝试转换帧速率,但是改变帧数以保持相同的持续时间或改变持续时间

Try as I might everything I try with ffmpeg converts the frame rate but changes the number of frames to keep the same duration or changes the duration without altering the framerate.

所以我一直在尝试像

ffmpeg -y -r 30 -i seeing_noaudio.mp4 -r 24 seeing.mp4

我在Windows上这样做,但通常会在linux上)。这会转换帧率,但是丢弃帧,所以总持续时间不会改变。

(I'm doing this on windows but normally would be on linux). That converts the framerate but drops frames so the total duration is unaltered.

或者我尝试过

ffmpeg -y -i seeing_noaudio.mp4 -filter:v "setpts=1.25*PTS" seeing.mp4

哪个更改持续时间但不是帧率。

Which changes the duration but not the framerate.

当然,我应该能够使用一个ffmpeg命令,而不必重新编码或即使有人建议回到原始的框架。

Surely I should be able to do this with a single ffmpeg command without having to reencode or even as some people suggested going back to the original raw frames.

帮助请

推荐答案

使用重新编码:

ffmpeg -y -i seeing_noaudio.mp4 -vf "setpts=1.25*PTS" -r 24 seeing.mp4

无需重新编码:

第一步 - 将视频提取到原始比特流

First step - extract video to raw bitstream

ffmpeg -y -i seeing_noaudio.mp4 -c copy -f h264 seeing_noaudio.h264

使用新的帧速率重新配置

Remux with new framerate

ffmpeg -y -r 24 -i seeing_noaudio.h264 -c copy seeing.mp4

这篇关于使用ffmpeg来改变帧率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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