ffprobe 分析视频信息

版权声明:本文为博主原创文章,未经博主允许不得转载。(能力有限,仅供参考) https://blog.csdn.net/wangmanjie/article/details/85243997
ffprobe -i 1.mp4  -v quiet  -print_format json -show_streams -select_streams v:0

{
    "streams": [
        {
            "index": 0,
            "codec_name": "h264",
            "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
            "profile": "High",
            "codec_type": "video",
            "codec_time_base": "1001/120000",
            "codec_tag_string": "avc1",
            "codec_tag": "0x31637661",
            "width": 540,
            "height": 960,
            "coded_width": 544,
            "coded_height": 960,
            "has_b_frames": 2,
            "pix_fmt": "yuv420p",
            "level": 32,
            "chroma_location": "left",
            "refs": 1,
            "is_avc": "true",
            "nal_length_size": "4",
            "r_frame_rate": "60000/1001",
            "avg_frame_rate": "60000/1001",
            "time_base": "1/60000",
            "start_pts": 2760,
            "start_time": "0.046000",
            "duration_ts": 906906,
            "duration": "15.115100",
            "bit_rate": "1855532",
            "bits_per_raw_sample": "8",
            "nb_frames": "906",
            "disposition": {
                "default": 1,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            },
            "tags": {
                "language": "und",
                "handler_name": "VideoHandler"
            }
        }
    ]
}
ffprobe  -i 1.mp4 -print_format json -show_frames

{
    "frames": [
        {
            "media_type": "audio",
            "stream_index": 1,
            "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": 1024,
            "pkt_duration_time": "0.023220",
            "pkt_pos": "25943",
            "pkt_size": "371",
            "sample_fmt": "fltp",
            "nb_samples": 1024,
            "channels": 2,
            "channel_layout": "stereo"
        },
        {
            "media_type": "audio",
            "stream_index": 1,
            "key_frame": 1,
            "pkt_pts": 1024,
            "pkt_pts_time": "0.023220",
            "pkt_dts": 1024,
            "pkt_dts_time": "0.023220",
            "best_effort_timestamp": 1024,
            "best_effort_timestamp_time": "0.023220",
            "pkt_duration": 1024,
            "pkt_duration_time": "0.023220",
            "pkt_pos": "51484",
            "pkt_size": "372",
            "sample_fmt": "fltp",
            "nb_samples": 1024,
            "channels": 2,
            "channel_layout": "stereo"
        }
}
ffprobe  -i 1.mp4 -print_format json -show_packets

{
    "packets": [
        {
            "codec_type": "audio",
            "stream_index": 1,
            "pts": 0,
            "pts_time": "0.000000",
            "dts": 0,
            "dts_time": "0.000000",
            "duration": 1024,
            "duration_time": "0.023220",
            "size": "371",
            "pos": "25943",
            "flags": "K_"
        },
        {
            "codec_type": "video",
            "stream_index": 0,
            "pts": 2760,
            "pts_time": "0.046000",
            "dts": 758,
            "dts_time": "0.012633",
            "duration": 1001,
            "duration_time": "0.016683",
            "size": "25170",
            "pos": "26314",
            "flags": "K_"
        },

猜你喜欢

转载自blog.csdn.net/wangmanjie/article/details/85243997