ffprobe Fastest way to read video packets

感情迁移 提交于 2019-12-20 06:30:27

问题


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?

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


回答1:


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

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



来源:https://stackoverflow.com/questions/53265181/ffprobe-fastest-way-to-read-video-packets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!