[FFmpeg-user] how to get specified message via ffprobe

qw applemax82 at 163.com
Thu Apr 28 12:13:09 CEST 2016


Hi,

I use the following command to get source file's information:

ffprobe -print_format json -show_format -show_streams sampleClips/sample_iTunes.mov

Below is the message that ffprobe ouputs:

ffprobe version 2.8.3 Copyright (c) 2007-2015 the FFmpeg developers
  built with icc (ICC) 14.0.2 20140120
  configuration: --cc=/opt/intel/bin/icc --enable-version3 --enable-asm --enable-yasm --enable-avfilter --enable-libvidstab --disable-static --enable-shared --enable-libx264 --enable-gpl --prefix=/usr/local/ --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --enable-libfdk_aac --enable-nonfree --enable-libass --enable-libfreetype --extra-libs=-lfreetype
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
{
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sampleClips/sample_iTunes.mov':
  Metadata:
    major_brand     : qt 
    minor_version   : 537199360
    compatible_brands: qt 
    creation_time   : 2005-10-17 22:54:32
  Duration: 00:01:25.50, start: 0.000000, bitrate: 307 kb/s
    Stream #0:0(eng): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 261 kb/s, 10 fps, 10 tbr, 3k tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2005-10-17 22:54:33
      handler_name    : Apple Video Media Handler
      encoder         : 3ivx D4 4.5.1
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 32000 Hz, mono, fltp, 43 kb/s (default)
    Metadata:
      creation_time   : 2005-10-17 22:54:34
      handler_name    : Apple Sound Media Handler
    "streams": [
        {
            "index": 0,
            "codec_name": "mpeg4",
            "codec_long_name": "MPEG-4 part 2",
            "profile": "Simple Profile",
            "codec_type": "video",
            "codec_time_base": "1/25",
            "codec_tag_string": "mp4v",
            "codec_tag": "0x7634706d",
            "width": 640,
            "height": 480,
            "coded_width": 640,
            "coded_height": 480,
            "has_b_frames": 1,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "4:3",
            "pix_fmt": "yuv420p",
            "level": 1,
            "chroma_location": "left",
            "refs": 1,
            "quarter_sample": "0",
            "divx_packed": "0",
            "r_frame_rate": "10/1",
            "avg_frame_rate": "10/1",
            "time_base": "1/3000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 256500,
            "duration": "85.500000",
            "bit_rate": "261816",
            "max_bit_rate": "4096",
            "nb_frames": "855",
            "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": "2005-10-17 22:54:33",
                "language": "eng",
                "handler_name": "Apple Video Media Handler",
                "encoder": "3ivx D4 4.5.1"
            }
        },
        {
            "index": 1,
            "codec_name": "aac",
            "codec_long_name": "AAC (Advanced Audio Coding)",
            "profile": "LC",
            "codec_type": "audio",
            "codec_time_base": "1/32000",
            "codec_tag_string": "mp4a",
            "codec_tag": "0x6134706d",
            "sample_fmt": "fltp",
            "sample_rate": "32000",
            "channels": 1,
            "channel_layout": "mono",
            "bits_per_sample": 0,
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/32000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 2737152,
            "duration": "85.536000",
            "bit_rate": "43476",
            "max_bit_rate": "48000",
            "nb_frames": "2673",
            "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": "2005-10-17 22:54:34",
                "language": "eng",
                "handler_name": "Apple Sound Media Handler"
            }
        }
    ],
    "format": {
        "filename": "sampleClips/sample_iTunes.mov",
        "nb_streams": 2,
        "nb_programs": 0,
        "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
        "format_long_name": "QuickTime / MOV",
        "start_time": "0.000000",
        "duration": "85.500000",
        "size": "3284257",
        "bit_rate": "307298",
        "probe_score": 100,
        "tags": {
            "major_brand": "qt  ",
            "minor_version": "537199360",
            "compatible_brands": "qt  ",
            "creation_time": "2005-10-17 22:54:32"
        }
    }
}

But I want part of the above message. That is:

    "streams": [
        {
            "index": 0,
            "codec_name": "mpeg4",
            "codec_long_name": "MPEG-4 part 2",
            "profile": "Simple Profile",
            "codec_type": "video",
            "codec_time_base": "1/25",
            "codec_tag_string": "mp4v",
            "codec_tag": "0x7634706d",
            "width": 640,
            "height": 480,
            "coded_width": 640,
            "coded_height": 480,
            "has_b_frames": 1,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "4:3",
            "pix_fmt": "yuv420p",
            "level": 1,
            "chroma_location": "left",
            "refs": 1,
            "quarter_sample": "0",
            "divx_packed": "0",
            "r_frame_rate": "10/1",
            "avg_frame_rate": "10/1",
            "time_base": "1/3000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 256500,
            "duration": "85.500000",
            "bit_rate": "261816",
            "max_bit_rate": "4096",
            "nb_frames": "855",
            "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": "2005-10-17 22:54:33",
                "language": "eng",
                "handler_name": "Apple Video Media Handler",
                "encoder": "3ivx D4 4.5.1"
            }
        },
        {
            "index": 1,
            "codec_name": "aac",
            "codec_long_name": "AAC (Advanced Audio Coding)",
            "profile": "LC",
            "codec_type": "audio",
            "codec_time_base": "1/32000",
            "codec_tag_string": "mp4a",
            "codec_tag": "0x6134706d",
            "sample_fmt": "fltp",
            "sample_rate": "32000",
            "channels": 1,
            "channel_layout": "mono",
            "bits_per_sample": 0,
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/32000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 2737152,
            "duration": "85.536000",
            "bit_rate": "43476",
            "max_bit_rate": "48000",
            "nb_frames": "2673",
            "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": "2005-10-17 22:54:34",
                "language": "eng",
                "handler_name": "Apple Sound Media Handler"
            }
        }
    ],
    "format": {
        "filename": "sampleClips/sample_iTunes.mov",
        "nb_streams": 2,
        "nb_programs": 0,
        "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
        "format_long_name": "QuickTime / MOV",
        "start_time": "0.000000",
        "duration": "85.500000",
        "size": "3284257",
        "bit_rate": "307298",
        "probe_score": 100,
        "tags": {
            "major_brand": "qt  ",
            "minor_version": "537199360",
            "compatible_brands": "qt  ",
            "creation_time": "2005-10-17 22:54:32"
        }
    }

What command can produce the needed message without other information?

Thanks!

B.R.

Andrew




More information about the ffmpeg-user mailing list