Search code examples
ffmpegffprobe

What does "probe_score" mean in ffprobe output?


Given a media file, after running ffprobe -i input.mp4 -show_format -print_format json, I got something like this:

{
    "format": {
        "filename": "ooxx.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": "231.210000",
        "size": "65133325",
        "bit_rate": "2253650",
        "probe_score": 100,
        "tags": {
            "major_brand": "isom",
            "minor_version": "512",
            "compatible_brands": "isomiso2avc1mp41",
            "encoder": "Lavf55.33.100",
        }
    }
}

I'm wondering what does probe_score mean here? How does it get calculated?


Solution

  • An input (a file in this case) can have an extension (say ".avi") and be of a different format (a wav file for example). FFmpeg can detect the real format of an input (with ffprobe). In order to do this, it opens the file and read it (the first 5 seconds, set by option analyzeduration if I recall correctly). Then, it assign a score to each format: a low score if the data have nothing to do with the input, a high score if the format seems the right one.

    The format returned is the one with the highest score. probe_score is this score.

    100 is the maximum score, meaning that FFmpeg is sure that the format is the real one. With a score below 25, it is recommanded to increase probe duration.