// Detect It Easy: detection rule file
// Author: BJNFNE <bjnfne@web.de>

// https://wiki.multimedia.cx/index.php/VMD
meta("format", "Video and Media Data (.VMD)");

function detect() {
    if (Binary.compare("2e03000001")) {
        sVersion = "Adi2/Adibou1/Playtoons/Woodruff";
        sOptions = "Video+Sound";
        bDetected = true;
    } else if (Binary.compare("2e0300000700a4030000000040018800011002003003000069763332")) { // 69763332 = iv32
        sOptions = "Indeo 3 (compressed)";
        sVersion = "3.24.01.01";
        bDetected = true;
    } else if (Binary.compare("2e0302000700........00004001f000000001003003000049563332")) { // 49563332 = IV32
        sOptions = "Indeo 3 (compressed)";
        sVersion = "3.24.15.03";
        bDetected = true;
    } else if (Binary.compare("2e030105000200000000008007e001")) {
        bDetected = true;
    } else if (Binary.compare("2e03..000100....000000008002")) {
        sOptions = "Video+Sound";
        sVersion = "Adi4/Adibou2";
        bDetected = true;
    } else if (Binary.compare("2e030200000015")) {
        sOptions = "Adibou2 (Sciences)";
        bDetected = true;
    } else if (Binary.compare("2e0302000000..000000000000000000001101004403")) {
        sOptions = "Sound only";
        sVersion = "Adiboud'chou";
        bDetected = true;
    } else if (Binary.compare("2e0302000d00")) {
        sOptions = "Video+Sound";
        sVersion = "Adibou2 (Sciences)/Adi4";
        bDetected = true;
    } else if (Binary.compare("3200..000000")) {
        sOptions = "Sound only";
        sVersion = "Adi5/Adibou3";
        bDetected = true;
    } else if (Binary.compare("2e0302001d00..00..00..00")) {
        sOptions = "Video+Sound";
        bDetected = true;
    } else if (Binary.compare("2e0302..........00000000000000000010..003003")) {
        sOptions = "Sound only";
        bDetected = true;
    } else if (Binary.compare("32000200..00..0000000000..00..00......0034")) {
        sOptions = "Animation only";
        sVersion = "Adibou3";
        bDetected = true;
    } else if (Binary.compare("2e0301000100........................02003003")) {
        sOptions = "Animation+Sound";
        sVersion = "Adibou2";
        bDetected = true;
    } else if (Binary.compare("2e0301000100......................1001003003")) {
        sOptions = "Sound only";
        sVersion = "Adibou2";
        bDetected = true;
    }

    return result();
}