1. 查看音视频信息
1.1 查看基本信息
ffprobe 1280x720_h264_8mbps_30fps.mp4
Input
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.37.101
Duration: 00:00:10.12, start: 0.000000, bitrate: 8046 kb/s
Stream
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
1.2 查看详细信息
ffprobe -show_streams 1280x720_h264_8mbps_30fps.mp4
Input
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.37.101
Duration: 00:00:10.12, start: 0.000000, bitrate: 8046 kb/s
Stream
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=Main
codec_type=video
codec_tag_string=avc1
codec_tag=0x31637661
width=1280
height=720
coded_width=1280
coded_height=720
closed_captions=0
has_b_frames=2
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuv420p
level=31
color_range=unknown
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=left
field_order=unknown
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=30/1
avg_frame_rate=960000/31999
time_base=1/16000
start_pts=0
start_time=0.000000
duration_ts=159995
duration=9.999688
bit_rate=8096674
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=300
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=und
TAG:handler_name=VideoHandler
TAG:vendor_id=[0][0][0][0]
[/STREAM]
[STREAM]
index=1
codec_name=aac
......
1.3 查看帧信息
ffprobe -show_frames 1280x720_h264_8mbps_30fps.mp4 > frames.info
[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=533
pkt_duration_time=0.033313
pkt_pos=48
pkt_size=337284
width=1280
height=720
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
color_range=unknown
color_space=unknown
color_primaries=unknown
color_transfer=unknown
chroma_location=left
[SIDE_DATA]
side_data_type=H.26[45] User Data Unregistered SEI message
[/SIDE_DATA]
[/FRAME]
2. 统计I帧数量
keyframe=1 : key frame
pict_type=I : I-frame
cat frames.info | grep "pict_type=I" |wc -l
3. 统计视频帧数量
cat frames.info | grep "media_type=video" |wc -l
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)