我正在使用ffprobe测试一个带有H264视频的mp4文件。 我使用以下命令获取帧信息。
ffprobe -i <input_mp4_file> -show_frames -select_streams v
我得到了以下输出。
[FRAME]
media_type=video
stream_index=0
key_frame=1
pkt_pts=0
pkt_pts_time=0.000000
pkt_dts=0
pkt_dts_time=0.000000
best_effort_timestamp=0
best_effort_timestamp_time=0.000000
pkt_duration=512
pkt_duration_time=0.033333
pkt_pos=48
pkt_size=513516
width=1920
height=1920
pix_fmt=yuv420p
sample_aspect_ratio=1:1
pict_type=I
coded_picture_number=0
display_picture_number=0
interlaced_frame=0
top_field_first=0
repeat_pict=0
[/FRAME]
[FRAME]
media_type=video
stream_index=0
key_frame=0
pkt_pts=512
pkt_pts_time=0.033333
pkt_dts=512
pkt_dts_time=0.033333
best_effort_timestamp=512
best_effort_timestamp_time=0.033333
pkt_duration=512
pkt_duration_time=0.033333
pkt_pos=513564
pkt_size=3299
width=1920
height=1920
pix_fmt=yuv420p
sample_aspect_ratio=1:1
pict_type=P
coded_picture_number=1
display_picture_number=0
interlaced_frame=0
top_field_first=0
repeat_pict=0
[/FRAME]
[FRAME]
media_type=video
stream_index=0
key_frame=0
pkt_pts=1024
pkt_pts_time=0.066667
pkt_dts=1024
pkt_dts_time=0.066667
best_effort_timestamp=1024
best_effort_timestamp_time=0.066667
pkt_duration=512
pkt_duration_time=0.033333
pkt_pos=823989
pkt_size=40971
width=1920
height=1920
pix_fmt=yuv420p
sample_aspect_ratio=1:1
pict_type=B
coded_picture_number=4
display_picture_number=0
interlaced_frame=0
top_field_first=0
repeat_pict=0
[/FRAME]
[FRAME]
media_type=video
stream_index=0
key_frame=0
pkt_pts=1536
pkt_pts_time=0.100000
pkt_dts=1536
pkt_dts_time=0.100000
best_effort_timestamp=1536
best_effort_timestamp_time=0.100000
pkt_duration=512
pkt_duration_time=0.033333
pkt_pos=784312
pkt_size=38785
width=1920
height=1920
pix_fmt=yuv420p
sample_aspect_ratio=1:1
pict_type=B
coded_picture_number=3
display_picture_number=0
interlaced_frame=0
top_field_first=0
repeat_pict=0
[/FRAME]
[FRAME]
media_type=video
stream_index=0
key_frame=0
pkt_pts=2048
pkt_pts_time=0.133333
pkt_dts=2048
pkt_dts_time=0.133333
best_effort_timestamp=2048
best_effort_timestamp_time=0.133333
pkt_duration=512
pkt_duration_time=0.033333
pkt_pos=516886
pkt_size=267344
width=1920
height=1920
pix_fmt=yuv420p
sample_aspect_ratio=1:1
pict_type=P
coded_picture_number=2
display_picture_number=0
interlaced_frame=0
top_field_first=0
repeat_pict=0
[/FRAME]
我的mp4文件包含 I、P 和 B 帧。我知道DTS是解码时间戳,它将在解码器输入流中按递增顺序出现。PTS是演示时间戳,在解码器输出流中也将按递增顺序出现。
但是我不明白为什么所有帧的PTS和DTS值都相同。我认为当流中有B帧时它们应该是不同的。
请有经验的人帮我理解这个问题好吗?