ffmpeg # 利用vfrdet filter判断一个素材是否

2019-08-10  本文已影响0人  FlyingPenguin

vfr

Variable framerate is the practice of encoding video with different framerates for different parts of the movie.
This practice was nearly unheard of until the high-definition (HD) movies came to prominence. Some common HD video formats will use a variable framerate to enhance compression and reduce file sizes.
The basic method of this practice is increasing rate during high movement and decreasing rate during static scenes.
A variable framerate system will lower the framerate during slow parts and increase the rate during fast parts.

变帧率的话,视频不同的部分,采用不同的帧率。
运动剧烈时,提高帧率;静态画面时,降低帧率。

vfrdet

Detect variable frame rate video.

This filter tries to detect if the input is variable or constant frame rate.

At end it will output number of frames detected as having variable delta pts, and ones with constant delta pts.
If there was frames with variable delta, than it will also show min and max delta encountered.

vfrdet是ffmpeg的一个video filter,可以用来判断一个素材,是cfr还是vfr。

image.png

FFMPEG has introduced a new filter in FFMPEG 4.0 called vfrdet. Using this filter you can easily check if the video is with CFR (constant frame rate) or VFR (variable frame rate). The syntax of the command is:

ffmpeg -i input.mp4 -vf vfrdet -f null -

And the output of this command should give you an idea whether you have any deviation of the frame duration or not. This is an exemplary output of the above mentioned command:

[Parsed_vfrdet_0 @ 0x56518fa3f380] VFR:0.400005 (15185/22777) min: 1801 max: 3604)

It means that 15818 frames have variable frame rate and 22777 have constant bitrate, and 40.005% of all the frames in the video (1585 + 22777 = 37962) have variable frame rate. If there was frames with variable delta, than it will also show min and max delta encountered.

References:

https://www.swgde.org/documents/Current%20Documents/SWGDE%20Technical%20Notes%20on%20FFmpeg
https://superuser.com/questions/1373156/ffmpeg-x265-video-encode-options
https://ffmpeg.org/ffmpeg-filters.html#vfrdet
https://github.com/stoyanovgeorge/ffmpeg/wiki/Variable-Frame-Rate
https://www.wisegeek.com/what-is-variable-framerate.htm

上一篇下一篇

猜你喜欢

热点阅读