4

Q1. Which ffmpeg command should I use to extract each frame number associated with its timestamp (time in ms from the starting of the video) ?

Expected result :

frame, ts
1, 34
2, 67
3, 101
4, 123
...

Q2. Are those timestamps safe to use as a key to point to a frame ?

In other terms, if I use other tools than ffmpeg to do the same thing, will I get exactly the same timestamps.


Material: http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4

1 Answer 1

10

A1. You can get close by running

ffprobe video.mp4 -select_streams v -show_entries frame=coded_picture_number,pkt_pts_time -of csv=p=0:nk=1 -v 0

Output is

0.000000,0
0.040000,3
0.080000,2
0.120000,4
0.160000,1
0.200000,7
0.240000,6
0.280000,8
0.320000,5

where presented frame n is on line n (starting from 1).

The first column is the timestamp in seconds; the 2nd column is the encoding and decoding and file storage order of the frames.

A2. Should be. Other s/w may remove starting offset - ffprobe doesn't. Other s/w may adjust timings taking into account audio delay or edit lists..etc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .