【问题标题】:How to get the key value of json generated by the ffmpeg command?如何获取ffmpeg命令生成的json的key值?
【发布时间】:2022-01-04 08:42:50
【问题描述】:

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

输出:-

 {
        "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
                }
            }
        ]
    }
    

如何仅获取采样率作为输出我应该在上述命令中进行哪些修改。

【问题讨论】:

    标签: json ffmpeg flac sample-rate


    【解决方案1】:

    -show_streams 更改为-show_entries stream=sample_rate

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-01-16
      • 2017-11-14
      • 1970-01-01
      • 2017-06-06
      • 1970-01-01
      • 2017-08-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多