ffmpeg vstats 问题,丢失帧和误导信息!
我遇到的问题是,当使用 ffmpeg 使用 libx264 编码 YUV 时,我没有在 -vstats 输出中获得所有帧信息。这就提出了 ffmpeg 的可靠性如何的问题,因此任何基于 ffmpeg 的“编解码器基准”审查是否可信?
我正在分析编解码器以确定它们的性能。我正在使用 ffmpeg 及其 -vstats 选项来逐帧查看编码的电影。我使用的流程:
RAW YUV ->用帧编号对每个帧进行条形码 ->条形码 YUV
条形码 YUV ->编码(例如使用 libx264)-> MKV->解码为 YUV
我可以使用每个帧中的条形码来比较两个输出(“条形码 YUV”和“解码为 YUV”)。然后,我可以准确地将原始帧与使用 PSNR 等进行编码的帧进行比较。
使用 libx264 和 libdirac 进行编码时,会丢失一些帧信息。其他编解码器,例如 mpeg2video 甚至 libvpx,不存在此问题。
我发现前 40 到 50 帧缺少 libx264 vstats。我后来证明缺失的信息实际上是最后 40 到 50 帧。
它看起来也像 ffmpeg 根据 vstats 中的信息计算平均比特率。但由于存在丢失帧,平均比特率低于应有的水平。
以下是平均比特率误差示例的链接:
http://dl.dropbox.com /u/6743276/ffmpeg_probs/ffmpeg_av_bitrate_error.png
http://dl .dropbox.com/u/6743276/ffmpeg_probs/ffmpeg_av_bitrate_error.xlsx
下面是 PSNR 和 PSNR 的链接f_size图:
http://dl.dropbox.com/u/6743276/ffmpeg_probs/ frame_mismatch.png
下面是输出的链接命令行选项:
http://dl.dropbox.com/u/6743276/ffmpeg_probs /stderr.txt
我认为这也是一个错误,任何聪明到能解决这个问题的人都可能想要关注这个跟踪器: http://roundup.ffmpeg.org/issue2248
The Problem I have is when using ffmpeg to encode a YUV using libx264 I don't get all the frame information in -vstats output. It raises the question of how reliable ffmpeg is, and therefore can any 'codec benchmark' review based on ffmpeg be trusted?
I am analysing codec's to determine how they perform. I am using ffmpeg and its -vstats option to look at an encoded movie frame by frame. the process I use:
RAW YUV -> bar-code each frame with frame number -> Bar-coded YUV
Bar-coded YUV -> encoded (e.g. with libx264) -> MKV -> Decoded to YUV
I can compare the two outputs ('Bar-coded YUV' & 'Decoded to YUV') using the bar-code in each frame. I can then compare, exactly, an original frame with an encoded frame using PSNR etc.
When encoding using libx264 and libdirac, there are some frame information which is missing. Other codecs, such as mpeg2video or even libvpx, don't have this problem.
I have found that libx264 vstats are missing for the first 40 to 50 frames. I have since proved that the missing information is actually the last 40 to 50 frames.
It also looks like ffmpeg calculates average bitrate based on the information in vstats. But as there is missing frames the average bitrate is less than what it should be.
Below are links to the average bitrate error example:
http://dl.dropbox.com/u/6743276/ffmpeg_probs/ffmpeg_av_bitrate_error.png
http://dl.dropbox.com/u/6743276/ffmpeg_probs/ffmpeg_av_bitrate_error.xlsx
Below is a link to the PSNR & f_size graph:
http://dl.dropbox.com/u/6743276/ffmpeg_probs/frame_mismatch.png
Below is a link to the output & command line options:
http://dl.dropbox.com/u/6743276/ffmpeg_probs/stderr.txt
I think this is also a bug, anyone clever enough to work it out might want to follow this tracker:
http://roundup.ffmpeg.org/issue2248
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚发现了一些让我脸红的东西!很恼火,但没关系:)
一位 ffmpeg 用户指出 ffprobe 应该输出更多的帧信息,它确实做到了。这是他的实用提示的链接:
http://forums.creativecow.net/thread/291/ 71
使用此我发现以下内容:
实际平均比特率(ffprobe 数据):8355.2776056338
实际平均码率(ffmpeg vstats数据):8406.23275471698
ffmpeg -vstats avg_br:7816.3
转载如上:7816.32168421053
Ffmpeg 标准错误输出 'bitrate=': 8365.8
以下是我的工作结果的链接:
http://dl.dropbox.com/u/6743276/ffmpeg_probs/ffprobe_vs_ffmpeg-vstats.xlsx
我发现我应该使用 ffmpeg 标准错误输出中的平均比特率信息,它看起来像最可靠!
I have just discovered something which makes me very red in the face!! quite annoyed, but never mind :)
A fellow ffmpeg user pointed out that ffprobe should output more frame info, which it did. here is a link to his handy tip:
http://forums.creativecow.net/thread/291/71
Using this I found the following:
Actual average bitrate (ffprobe data): 8355.2776056338
Actual average bitrate (ffmpeg vstats data): 8406.23275471698
Ffmpeg -vstats avg_br: 7816.3
Reproduced above: 7816.32168421053
Ffmpeg standard error output 'bitrate=': 8365.8
Below is a link to my workings out:
http://dl.dropbox.com/u/6743276/ffmpeg_probs/ffprobe_vs_ffmpeg-vstats.xlsx
What I have discovered is I should have been using the average bitrate info from ffmpeg standard error output, it looks like the most reliable!