首页 > 代码库 > FFmpeg查看媒体文件信息

FFmpeg查看媒体文件信息

ffprobe64.exe -v quiet -print_format json -show_streams -show_format content.mp4

{
    "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": "1/30",
            "codec_tag_string": "avc1",
            "codec_tag": "0x31637661",
            "width": 1920,
            "height": 1080,
            "coded_width": 1920,
            "coded_height": 1088,
            "has_b_frames": 0,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "16:9",
            "pix_fmt": "yuv420p",
            "level": 40,
            "color_range": "tv",
            "color_space": "bt709",
            "color_transfer": "bt709",
            "color_primaries": "bt709",
            "chroma_location": "left",
            "refs": 4,
            "is_avc": "1",
            "nal_length_size": "4",
            "r_frame_rate": "15/1",
            "avg_frame_rate": "15/1",
            "time_base": "1/15000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 5585000,
            "duration": "372.333333",
            "bit_rate": "219954",
            "bits_per_raw_sample": "8",
            "nb_frames": "5585",
            "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
            },
            "tags": {
                "creation_time": "2014-04-07 07:36:29",
                "language": "eng",
                "handler_name": "Video Media Handler",
                "encoder": "AVC Coding"
            }
        },
        {
            "index": 1,
            "codec_name": "aac",
            "codec_long_name": "AAC (Advanced Audio Coding)",
            "profile": "LC",
            "codec_type": "audio",
            "codec_time_base": "1/44100",
            "codec_tag_string": "mp4a",
            "codec_tag": "0x6134706d",
            "sample_fmt": "fltp",
            "sample_rate": "44100",
            "channels": 2,
            "channel_layout": "stereo",
            "bits_per_sample": 0,
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/44100",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 16421888,
            "duration": "372.378413",
            "bit_rate": "53583",
            "nb_frames": "16037",
            "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
            },
            "tags": {
                "creation_time": "2014-04-07 07:36:29",
                "language": "eng",
                "handler_name": "Sound Media Handler"
            }
        }
    ],
    "format": {
        "filename": "content.mp4",
        "nb_streams": 2,
        "nb_programs": 0,
        "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
        "format_long_name": "QuickTime / MOV",
        "start_time": "0.000000",
        "duration": "372.377533",
        "size": "12830296",
        "bit_rate": "275640",
        "probe_score": 100,
        "tags": {
            "major_brand": "mp42",
            "minor_version": "1",
            "compatible_brands": "M4V mp42isom",
            "creation_time": "2014-04-07 07:36:29"
        }
    }
}

 

FFmpeg查看媒体文件信息