使用ffmpeg的图像使用低fps视频在VLC中播放问题 [英] Playback issues in VLC with low fps video from images using ffmpeg

查看:181
本文介绍了使用ffmpeg的图像使用低fps视频在VLC中播放问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ffmpeg从100个图像序列创建一个短视频。有几篇文章帮助我组建了一个命令,但是我使用的是直接从 ffmpeg图像到视频脚本任何人?



以下命令产生在我拥有的所有视频播放器(OS)中播放的视频文件X)。

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

但是如果我更改到,

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

它在所有 VLC媒体播放器。 VLC显示初始的1到3张图像,然后刚刚冻结在框架上。我已经测试了几种不同的帧速率,似乎断开VLC中的视频播放位于1.125和1.175之间。



在这里处理的m将非常感谢。

解决方案

同时使用 -framerate -r



例如,要有最终的视频看起来像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



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



VLC然后能够播放视频正常



在Ubuntu 16.10,VLC 2.2.4, ffmpeg 3.0.5中,在具有10个PNG。


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?.

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

But if I change it to,

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

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.

解决方案

Use both -framerate and -r

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

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

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 is then able to play the video normally.

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

这篇关于使用ffmpeg的图像使用低fps视频在VLC中播放问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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