ffmpegffprobestream-analytics

ffprobe Fastest way to read video packets


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?


Solution

  • 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)