GoPro: get each frame time stamp

99封情书 提交于 2019-12-03 09:55:57

问题


I am currently trying to extract each frame time stamp from an MPEG-4 file that has been recorded using a GoPro.

I want the exact time at which the frame has been captured by the camera, to couple that with computer vision algorithms later on.

I know that the output framerate is 25 fps. I extracted the pts in different ways using ffmpeg and ffprobe, but they all show way too perfect results for me to believe them.

Each frame/packet has a precise, 0.04 sec interal (or 3600 in pts units) which conveniently enough matches a perfect 25 fps.

The commands I have used so far are:

ffmpeg -i 3_96025.MP4  -an -vf showinfo %10d.png 2> res.txt

I have also tried to use

ffmpeg -i 3_96025.MP4 **-copyts** -an -vf showinfo %10d.png 2> res.txt

but the results are exactly the same.

I also tried ffprobe:

ffprobe -i 396025.MP4 -show_packets -select_streams v

Bu the intervals I get are perfect too.

I am quite sure the gopro cannot sustain 25 fps in such a perfect manner. In addition, I recorded a timer, and I can see that each frame does not exactly match 0.04 seconds interval. So is there a way I can actually see the time each frame was captured?

Here is a part of the output I get with ffmpeg for reference :

frame=   42 fps= 26 q=0.0 size=N/A time=00:00:01.36 bitrate=N/A    
n:42 pts:151200 pts_time:1.68 pos:3232584 fmt:yuv420p sar:1/1 s:1280x960 i:P iskey:0 type:B checksum:6A83E942 plane_checksum:[1C859E55 79A4ED3E 28E25DA0]
[Parsed_showinfo_0 @ 0037dea0] n:43 pts:154800 pts_time:1.72 pos:3255334 fmt:yuv420p sar:1/1 s:1280x960 i:P iskey:0 type:B checksum:5736F4C1 plane_checksum:[ACAD00D0 06FFDE34 65FA15BD]
[Parsed_showinfo_0 @ 0037dea0] n:44 pts:158400 pts_time:1.76 pos:3083826 fmt:yuv420p sar:1/1 s:1280x960 i:P iskey:0 type:P checksum:9DD6B636 plane_checksum:[229400B3 7C0B52AF 75D162D4]
[Parsed_showinfo_0 @ 0037dea0] n:45 pts:162000 pts_time:1.8 pos:3531851 fmt:yuv420p sar:1/1 s:1280x960 i:P iskey:0 type:B checksum:2DA4E2B9 plane_checksum:[9C646B9D 16F45382 28B0239A]
[Parsed_showinfo_0 @ 0037dea0] n:46 pts:165600 pts_time:1.84 pos:3556346 fmt:yuv420p sar:1/1 s:1280x960 i:P iskey:0 type:B checksum:B4924AFE plane_checksum:[579EDD8F 94BC5C61 5B7F10FF]
[Parsed_showinfo_0 @ 0037dea0] n:47 pts:169200 pts_time:1.88 pos:3279065 fmt:yuv420p sar:1/1 s:1280x960 i:P iskey:0 type:I checksum:DBB23A0C plane_checksum:[321835C9 57E9C9FB 576B3A39]
[Parsed_showinfo_0 @ 0037dea0] n:48 pts:172800 pts_time:1.92 pos:3655246 fmt:yuv420p sar:1/1 s:1280x960 i:P iskey:0 type:B checksum:9BF3A47A plane_checksum:[4E17440B 3A059191 E394CECF]
[Parsed_showinfo_0 @ 0037dea0] n:49 pts:176400 pts_time:1.96 pos:3677897 fmt:yuv420p sar:1/1 s:1280x960 i:P iskey:0 type:B checksum:2A3167B4 plane_checksum:[78601136 0A6F8334 272ED33B]
[Parsed_showinfo_0 @ 0037dea0] n:50 pts:180000 pts_time:2 pos:3581296 fmt:yuv420p sar:1/1 s:1280x960 i:P iskey:0 type:P checksum:5A8C502E plane_checksum:[65A1FE60 0CEF07C3 F26149FC]
[Parsed_showinfo_0 @ 0037dea0] n:51 pts:183600 pts_time:2.04 pos:3773963 fmt:yuv420p sar:1/1 s:1280x960 i:P iskey:0 type:B checksum:90572E41 plane_checksum:[E9478643 B8BAE0E2 E1A7C6FE]
[Parsed_showinfo_0 @ 0037dea0] n:52 pts:187200 pts_time:2.08 pos:3797473 fmt:yuv420p sar:1/1 s:1280x960 i:P iskey:0 type:B checksum:2F206AB4 plane_checksum:[EB17F6AB 0AD1C78A E032AC61]
[Parsed_showinfo_0 @ 0037dea0] n:53 pts:190800 pts_time:2.12 pos:3700340 fmt:yuv420p sar:1/1 s:1280x960 i:P iskey:0 type:P checksum:9A91E693 plane_checksum:[72309E37 229C34FB 59A71361]
[Parsed_showinfo_0 @ 0037dea0] n:54 pts:194400 pts_time:2.16 pos:3897890 fmt:yuv420p sar:1/1 s:1280x960 i:P iskey:0 type:B checksum:BFCD3D1C plane_checksum:[13787B52 5F33F597 833ECC15]
[Parsed_showinfo_0 @ 0037dea0] n:55 pts:198000 pts_time:2.2 pos:3919440 fmt:yuv420p sar:1/1 s:1280x960 i:P iskey:0 type:B checksum:62C6ED26 plane_checksum:[E4053A80 4752E0B5 E78FD1E2]

来源:https://stackoverflow.com/questions/16934300/gopro-get-each-frame-time-stamp

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