VLC冻结从ffmpeg图像创建的低1 FPS视频 [英] VLC freezes for low 1 FPS video created from images with ffmpeg

查看:191
本文介绍了VLC冻结从ffmpeg图像创建的低1 FPS视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ffmpeg从100个图像序列中创建一个简短的视频.有几篇文章帮助我编写了一个命令,但是我正在使用的文章直接取自

I am creating a short video from a sequence of 100 images using ffmpeg. There are several articles that helped me put together a command, but the one I'm using is directly taken from ffmpeg images-to-video script anyone?.

以下命令生成的视频文件可以在我拥有的所有视频播放器(OS X)中正常播放.

The following command produces a video file that plays well in all video players I have (OS X).

cat input/*.jpg | ffmpeg -f image2pipe -r 10 -vcodec mjpeg -i - out.mp4

但是如果我将其更改为

cat input/*.jpg | ffmpeg -f image2pipe -r 1 -vcodec mjpeg -i - out.mp4

它在所有 VLC媒体播放器中都能正常播放. VLC显示最初的1到3幅图像,然后在帧上冻结.我已经测试了几种不同的帧速率,看来中断VLC中视频播放的截止点位于1.125和1.175之间.

It plays well in all but VLC media player. VLC displays the initial 1 to 3 images, then just freezes on the frame. I've tested a few different frame rates, and it seems the cutoff that breaks the video playback in VLC lies somewhere between 1.125 and 1.175.

对于我在这里处理的任何建议,将不胜感激.

Any advice on what I'm dealing with here would be much appreciated.

推荐答案

同时使用-framerate-r

Use both -framerate and -r

例如,制作一个看起来像1FPS的最终视频:

E.g., to have a final video that looks like 1FPS:

ffmpeg -framerate 1 -pattern_type glob -i '*.png' \
    -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4

这在Wiki上提到: http://trac.ffmpeg.org/wiki /Slideshow#Framerates

This is mentioned on the wiki at: http://trac.ffmpeg.org/wiki/Slideshow#Framerates

它将输出帧速率设置为VLC可以处理的30,并复制每个图像30次,以使输出视频看起来为1 FPS.

It sets the output framerate to 30, which VLC can handle, and copies each images 30 times, so that the output video appears to be at 1 FPS.

然后VLC可以正常播放视频.

VLC is then able to play the video normally.

另请参阅: https://unix.stackexchange. com/questions/68770/converting-png-frames-to-video-at-1-fps

在具有10个PNG的目录中的Ubuntu 16.10,VLC 2.2.4,ffmpeg 3.0.5上进行了测试.

Tested on Ubuntu 16.10, VLC 2.2.4, ffmpeg 3.0.5, in a directory with 10 PNGs.

ffplay

ffplay

我还将尝试使用ffmpeg的ffplay播放视频,我希望它更加健壮并能够处理这样的帧率.这是非常裸露的骨头,但是对于您可能以2 FPS使用的测试视频类型来说应该没问题. TODO进行测试.

I would also try to play the video with ffplay from ffmpeg, I would expect it to be more robust and be able to handle such framerates. It is very bare bones, but it should be fine for the type of test video that you are likely to be using at 2 FPS. TODO test it out.

这篇关于VLC冻结从ffmpeg图像创建的低1 FPS视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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