简体   繁体   English

ffprobe - 随机帧元数据

[英]ffprobe - shuffled frame metadata

I'm using mkvmerge to combine a mp4 CFR video with a text file containing VFR timestamps.我正在使用mkvmerge将 mp4 CFR 视频与包含 VFR 时间戳的文本文件结合起来。 The command used was使用的命令是

mkvmerge --timestamps 0:timestamps.txt input_video.mp4 -o output_video.mkv

Where the textfile timestamps.txt was of a v2 timestamp format.其中文本文件timestamps.txt是 v2 时间戳格式。 Here are the first few entries这是前几个条目

# timecode format v2
0
6
21
36
53
71
87
103
123

I'm trying to print these timestamps back out with我正在尝试将这些时间戳打印出来

ffprobe -v 0 -show_entries packet=pts,duration -of compact=p=0:nk=1 -select_streams v output_video.mkv

But I receive shuffled entries但我收到打乱的条目

0|6
6|15
21|15
36|17
53|18
123|15
87|16
71|16
103|20

If I read the frames with PyAV for example, I get the values in correct order.例如,如果我使用PyAV读取帧,我会以正确的顺序获得值。

import av
c = av.open("output_video.mkv")
for frame in c.decode(video=0):
     print(frame.pts)

Output: Output:

0
6
21
36
53
71
87
103
123

Am I using ffprobe incorrectly?我是否错误地使用了ffprobe? Any help would be very welcome!非常欢迎任何帮助!

If the video stream has B-frames then future P-frames which act as reference for B-frames are encoded first and stored in that order.如果视频 stream 具有 B 帧,则作为 B 帧参考的未来 P 帧首先被编码并按该顺序存储。 They are reordered after decoding.它们在解码后重新排序。

For ffprobe, the entries in packet are arranged in decode or storage order.对于ffprobe, packet中的条目按解码或存储顺序排列。 In frames , they are decoded and arranged in presentation order.frames中,它们被解码并按呈现顺序排列。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM