1. 觀察frame編號(coded_picture_number),資料大小(pkt_size),編碼類型IPB(pict_type), 播放時間順(pkt_pts_time), 解碼時間順(pkt_dts_time)
ffprobe -select_streams v:0 -show_entries frame=coded_picture_number,pkt_size,pict_type,pkt_pts_time,pkt_dts_time video.mp4 -of compact > result.txt
觀察結果
#檔案result.txt
frame|pkt_pts_time=0.000000|pkt_dts_time=0.000000|pkt_size=13695|pict_type=I|coded_picture_number=0
frame|pkt_pts_time=0.033367|pkt_dts_time=0.033367|pkt_size=630|pict_type=P|coded_picture_number=1
frame|pkt_pts_time=0.066733|pkt_dts_time=0.066733|pkt_size=827|pict_type=P|coded_picture_number=2
frame|pkt_pts_time=0.100100|pkt_dts_time=0.100100|pkt_size=1832|pict_type=P|coded_picture_number=3
frame|pkt_pts_time=0.133467|pkt_dts_time=0.133467|pkt_size=367|pict_type=P|coded_picture_number=4
frame|pkt_pts_time=0.166833|pkt_dts_time=0.166833|pkt_size=1544|pict_type=P|coded_picture_number=5
2. 找出所有I畫面幀
cat result.txt | grep 'type=I'
觀察結果
frame|pkt_pts_time=0.000000|pkt_dts_time=0.000000|pkt_size=13695|pict_type=I|cod
ed_picture_number=0
frame|pkt_pts_time=2.002000|pkt_dts_time=2.002000|pkt_size=17793|pict_type=I|cod
ed_picture_number=60
frame|pkt_pts_time=3.636967|pkt_dts_time=3.636967|pkt_size=15824|pict_type=I|cod
ed_picture_number=109
frame|pkt_pts_time=5.638967|pkt_dts_time=5.638967|pkt_size=15158|pict_type=I|cod
ed_picture_number=169
frame|pkt_pts_time=7.640967|pkt_dts_time=7.640967|pkt_size=11380|pict_type=I|cod
ed_picture_number=229
frame|pkt_pts_time=9.642967|pkt_dts_time=9.642967|pkt_size=16336|pict_type=I|cod
ed_picture_number=289
沒有留言:
張貼留言