7

我目前正在尝试从使用 GoPro 录制的 MPEG-4 文件中提取每个帧时间戳。

我想要相机捕获帧的确切时间,以便稍后将其与计算机视觉算法相结合。

我知道输出帧率为 25 fps。我使用 ffmpeg 和 ffprobe 以不同的方式提取了 pts,但它们都显示出太完美的结果,以至于我无法相信它们。

每个帧/数据包都有一个精确的 0.04 秒间隔(或 3600 以 pts 为单位),这足以匹配完美的 25 fps。

到目前为止我使用的命令是:

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

我也尝试过使用

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

但结果完全一样。

我也试过ffprobe

ffprobe -i 396025.MP4 -show_packets -select_streams v

但是我得到的间隔也很完美。

我很确定 gopro 无法以如此完美的方式维持 25 fps。另外,我记录了一个定时器,可以看到每一帧都不完全匹配0.04秒的间隔。 那么有没有一种方法可以让我真正看到每帧被捕获的时间?

这是我使用 ffmpeg 获得的输出的一部分以供参考:

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]
4

0 回答 0