ffprobe读取视频数据包的最快方法 [英] ffprobe Fastest way to read video packets

查看:598
本文介绍了ffprobe读取视频数据包的最快方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用ffprobe从视频流中读取数据包进行分析.但是,它的速度很慢. 30分钟的720p视频大约需要8分钟的阅读时间. 我目前正在使用以下命令:

I've been using ffprobe to read packets from video streams for analysis. However it's painfully slow. A 30min 720p video takes roughly 8min to read. I'm using the following command at the moment:

ffprobe.exe -i video.mp4 -show_entries packet=size,pts_time,flags,duration_time

这为我提供了每个数据包的以下信息:

This gives me the following information for every packet:

[PACKET]
pts_time=1981.392000
duration_time=0.032000
size=1536
flags=K_
[/PACKET]

我确实阅读了文档中的一些内容,但看起来仅仅是这样,还是有办法使其更快?

I did read a fair bit in the documentation but it looks like this is just it or is there a way to make this faster?

或者是否会有其他CLI工具可以更快地从视频中获取上述信息?

Or would there be any alternative CLI tool to get the above information from a video faster?

推荐答案

所花费的时间是由于在控制台上打印了日志.如果您重定向到文件,则30分钟的文件应花费几秒钟.

The time taken is due to the printing of the log on the console. If you redirect to a file, a 30 min file should take a few seconds.

ffprobe.exe -i video.mp4 -show_entries packet=size,pts_time,flags,duration_time > packets.log

(您的命令也会探测音频数据包(如果存在).添加-select_streams v仅用于视频)

(Your command will probe audio packets as well, if present. Add -select_streams v for video only)

这篇关于ffprobe读取视频数据包的最快方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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