Zahid M Shaikh
Zahid M Shaikh

Reputation: 27

How to get the key value of json generated by the ffmpeg command?

ffprobe -hide_banner -loglevel panic -show_streams -of json 01e8adee-b0f9-4569-a5f5-b2d69d1f7088.flac

output:-

 {
        "streams": [
            {
                "index": 0,
                "codec_name": "flac",
                "codec_long_name": "FLAC (Free Lossless Audio Codec)",
                "codec_type": "audio",
                "codec_tag_string": "[0][0][0][0]",
                "codec_tag": "0x0000",
                "sample_fmt": "s32",
                "sample_rate": "44100",
                "channels": 1,
                "channel_layout": "mono",
                "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": 4687872,
                "duration": "106.300952",
                "bits_per_raw_sample": "24",
                "extradata_size": 34,
                "disposition": {
                    "default": 0,
                    "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,
                    "captions": 0,
                    "descriptions": 0,
                    "metadata": 0,
                    "dependent": 0,
                    "still_image": 0
                }
            }
        ]
    }
    

How to get only sample rate as out put what modification should I do in the above command.

Upvotes: 0

Views: 992

Answers (1)

nico_lab
nico_lab

Reputation: 1194

change -show_streams to -show_entries stream=sample_rate.

ffprobe -hide_banner -loglevel panic -show_streams -of json 01e8adee-b0f9-4569-a5f5-b2d69d1f7088.flac

Upvotes: 0

Related Questions