{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "https://mkvtoolnix.download/doc/mkvmerge-identification-output-schema-v2.json",
    "title": "mkvmerge identification output",
    "description": "The JSON output produced by mkvmerge's file identification mode",
    "type": "object",
    "properties": {
        "attachments": {
            "description": "an array describing the attachments found if any",
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "content_type": {
                        "type": "string",
                        "minLength": 1
                    },
                    "description": {
                        "type": "string"
                    },
                    "file_name": {
                        "type": "string"
                    },
                    "id": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "size": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "properties": {
                        "type": "object",
                        "properties": {
                            "uid": {
                                "type": "integer",
                                "minimum": 0
                            }
                        },
                        "additionalProperties": false
                    },
                    "type": {
                        "type": "string"
                    }
                },
                "additionalProperties": false,
                "required": [
                    "file_name",
                    "id",
                    "properties",
                    "size"
                ]
            }
        },
        "chapters": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "num_entries": {
                        "type": "integer"
                    }
                },
                "additionalProperties": false,
                "required": [
                    "num_entries"
                ]
            }
        },
        "container": {
            "description": "information about the identified container",
            "type": "object",
            "properties": {
                "properties": {
                    "description": "additional properties for the container varying by container format",
                    "type": "object",
                    "properties": {
                        "container_type": {
                            "description": "A unique number identifying the container type that's supposed to stay constant over all future releases of MKVToolNix",
                            "type": "integer",
                            "minLength": 1
                        },
                        "duration": {
                            "description": "The file's/segment's duration in nanoseconds",
                            "type": "integer",
                            "minimum": 0
                        },
                        "is_providing_timecodes": {
                            "description": "States whether or not the container has timestamps for the packets (e.g. Matroska, MP4) or not (e.g. SRT, MP3)",
                            "type": "boolean"
                        },
                        "segment_uid": {
                            "description": "A hexadecimal string of the segment's UID (only for Matroska files)",
                            "type": "string",
                            "minLength": 32,
                            "maxLength": 32
                        },
                        "next_segment_uid": {
                            "description": "A hexadecimal string of the next segment's UID (only for Matroska files)",
                            "type": "string",
                            "minLength": 32,
                            "maxLength": 32
                        },
                        "previous_segment_uid": {
                            "description": "A hexadecimal string of the previous segment's UID (only for Matroska files)",
                            "type": "string",
                            "minLength": 32,
                            "maxLength": 32
                        },
                        "other_file": {
                            "description": "The file name of an additional file processed as well",
                            "type": "string",
                            "minLength": 1
                        },
                        "playlist": {
                            "description": "States whether or not the identified file is a playlist (e.g. MPLS) referring to several other files",
                            "type": "boolean"
                        },
                        "playlist_chapters": {
                            "description": "The number of chapters in a playlist if it is a one",
                            "type": "integer",
                            "minimum": 0
                        },
                        "playlist_duration": {
                            "description": "The total duration in nanoseconds of all files referenced by the playlist if it is a one",
                            "type": "integer",
                            "minimum": 0
                        },
                        "playlist_size": {
                            "description": "The total size in bytes of all files referenced by the playlist if it is a one",
                            "type": "integer",
                            "minimum": 0
                        },
                        "title": {
                            "type": "string"
                        }
                    },
                    "additionalProperties": false
                },
                "recognized": {
                    "description": "States whether or not mkvmerge knows about the format",
                    "type": "boolean"
                },
                "supported": {
                    "description": "States whether or not mkvmerge can read the format",
                    "type": "boolean"
                },
                "type": {
                    "description": "A human-readable description/name for the container format",
                    "type": "string",
                    "minLength": 1
                }
            },
            "additionalProperties": false,
            "required": [
                "recognized",
                "supported"
            ]
        },
        "errors": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "file_name": {
            "description": "the identified file's name",
            "type": "string",
            "minLength": 1
        },
        "global_tags": {
            "type": "array",
            "items": {}
        },
        "identification_format_version": {
            "description": "The output format's version",
            "type": "integer",
            "minimum": 1
        },
        "track_tags": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "num_entries": {
                        "type": "integer"
                    },
                    "track_id": {
                        "type": "integer"
                    }
                },
                "additionalProperties": false,
                "required": [
                    "num_entries",
                    "track_id"
                ]
            }
        },
        "tracks": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "codec": {
                        "type": "string",
                        "minLength": 1
                    },
                    "id": {
                        "type": "integer",
                        "minLength": 0
                    },
                    "type": {
                        "type": "string"
                    },
                    "properties": {
                        "type": "object",
                        "properties": {
                            "aac_is_sbr": {
                                "type": "string",
                                "enum": [
                                    "true",
                                    "false",
                                    "unknown"
                                ]
                            },
                            "audio_bits_per_sample": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "audio_channels": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "audio_sampling_frequency": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "codec_id": {
                                "type": "string"
                            },
                            "codec_private_data": {
                                "type": "string"
                            },
                            "codec_private_length": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "content_encoding_algorithms": {
                                "type": "string",
                                "minLength": 1
                            },
                            "default_duration": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "default_track": {
                                "type": "boolean"
                            },
                            "display_dimensions": {
                                "type": "string",
                                "pattern": "^[0-9]+x[0-9]+$"
                            },
                            "enabled_track": {
                                "type": "boolean"
                            },
                            "forced_track": {
                                "type": "boolean"
                            },
                            "language": {
                                "type": "string"
                            },
                            "number": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "packetizer": {
                                "type": "string",
                                "minLength": 1
                            },
                            "pixel_dimensions": {
                                "type": "string",
                                "pattern": "^[0-9]+x[0-9]+$"
                            },
                            "stereo_mode": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "stream_id": {
                                "type": "string",
                                "pattern": "^[0-9a-f]{2}$"
                            },
                            "sub_stream_id": {
                                "type": "string",
                                "pattern": "^[0-9a-f]{2}$"
                            },
                            "tag_artist": {
                                "type": "string"
                            },
                            "tag_bitsps": {
                                "type": "string"
                            },
                            "tag_bps": {
                                "type": "string"
                            },
                            "tag_fps": {
                                "type": "string"
                            },
                            "tag_title": {
                                "type": "string"
                            },
                            "text_subtitles": {
                                "type": "boolean"
                            },
                            "track_name": {
                                "type": "string"
                            },
                            "ts_pid": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "uid": {
                                "type": "integer",
                                "minimum": 0
                            }
                        },
                        "additionalProperties": false
                    }
                },
                "additionalProperties": false,
                "required": [
                    "codec",
                    "id",
                    "type"
                ]
            }
        },
        "warnings": {
            "type": "array",
            "items": {
                "type": "string"
            }
        }
    }
}