ffprobeを使用してH264ビデオのmp4ファイルをテストしています。 次のコマンドを使用してフレーム情報を取得しています。なぜ私のストリームでPTSとDTSが同じですか?
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フレームがあるときは、それらが異なるはずだと思います。
誰か理解してください。
ffmpegを使ってPTSとDTSを取得する方法はありますか? – MayurK
はい、 'ffmpeg -i in.mp4 -dump -map 0:v -f null''を使用してください。 – Mulvya
@Mulvya:ありがとうございます!わかった。私はDを押す必要があり、それはptsとdtsを表示します。もう一つ質問があります。この印刷でも "coded_picture_number"または "display_picture_number"を印刷できますか? – MayurK