Menu

Names of output parameters for color spaces

Help
Helg
2020-11-01
2020-11-01
  • Helg

    Helg - 2020-11-01

    Hi!
    Please tell me where I can get the names of all output MediaInfo values for parameters:

    • color primaries (smpte170m, bt470bg, bt470m, smpte240m, film, smpte428, smpte431, smpte432)

    • color matrix (fcc, bt470bg, smpte170m, smpte240m, GBR, YCgCo, bt2020c, smpte2085, chroma-derived-nc, chroma-derived-c, ICtCp)

    • transfer characteristics (bt470m, bt470bg, smpte170m, smpte240m, linear, log100, log316, iec61966-2-4, bt1361e, iec61966-2-1, bt2020-10, bt2020-12, smpte2084, smpte428)

    Thanks!

     
  • Jerome Martinez

    Jerome Martinez - 2020-11-01

    colour_primaries, transfer_characteristics, matrix_coefficients.

    Generaly speaking, you can get the name of the fields with the command line option --Language=raw or with the XML/JSON outputs.

     
  • Helg

    Helg - 2020-11-01

    No, I mean what will these parameters be called in Mediainfo? I am making a video encoder in c++ and I need to correctly decrypt the information about these parameters in order to re-encode the file and save the information.

    For example, I know that bt2020nc - is BT. 2020 non-constant
    bt709 - is BT.709

     

    Last edit: Helg 2020-11-01
  • Jerome Martinez

    Jerome Martinez - 2020-11-01

    ha.

    //---------------------------------------------------------------------------
    extern const char* Mpegv_colour_primaries(int8u colour_primaries)
    {
        switch (colour_primaries)
        {
            case  1 : return "BT.709";
            case  4 : return "BT.470 System M";
            case  5 : return "BT.601 PAL";
            case  6 : return "BT.601 NTSC";
            case  7 : return "SMPTE 240M"; //Same as BT.601 NTSC
            case  8 : return "Generic film";
            case  9 : return "BT.2020";                                     //Added in HEVC
            case 10 : return "XYZ";                                         //Added in HEVC 2014
            case 11 : return "DCI P3";                                      //Added in HEVC 2016
            case 12 : return "Display P3";                                  //Added in HEVC 2016
            case 22 : return "EBU Tech 3213";                               //Added in HEVC 2016
            default : return "";
        }
    }
    
    //---------------------------------------------------------------------------
    extern const char* Mpegv_transfer_characteristics(int8u transfer_characteristics)
    {
        switch (transfer_characteristics)
        {
            case  1 : return "BT.709"; //Same as BT.601
            case  4 : return "BT.470 System M";
            case  5 : return "BT.470 System B/G";
            case  6 : return "BT.601";
            case  7 : return "SMPTE 240M";
            case  8 : return "Linear";
            case  9 : return "Logarithmic (100:1)";                         //Added in MPEG-4 Visual
            case 10 : return "Logarithmic (316.22777:1)";                   //Added in MPEG-4 Visual
            case 11 : return "xvYCC";                                       //Added in AVC
            case 12 : return "BT.1361";                                     //Added in AVC
            case 13 : return "sRGB/sYCC";                                   //Added in HEVC
            case 14 : return "BT.2020 (10-bit)"; //Same a BT.601            //Added in HEVC, 10/12-bit difference is in ISO 23001-8
            case 15 : return "BT.2020 (12-bit)"; //Same a BT.601            //Added in HEVC, 10/12-bit difference is in ISO 23001-8
            case 16 : return "PQ";                                          //Added in HEVC 2015
            case 17 : return "SMPTE 428M";                                  //Added in HEVC 2015
            case 18 : return "HLG";                                         //Added in HEVC 2016
            default : return "";
        }
    }
    
    //---------------------------------------------------------------------------
    extern const char* Mpegv_matrix_coefficients(int8u matrix_coefficients)
    {
        switch (matrix_coefficients)
        {
            case  0 : return "Identity";                                    //Added in AVC
            case  1 : return "BT.709";
            case  4 : return "FCC 73.682";
            case  5 : return "BT.470 System B/G";
            case  6 : return "BT.601"; //Same as BT.470 System B/G
            case  7 : return "SMPTE 240M";
            case  8 : return "YCgCo";                                       //Added in AVC
            case  9 : return "BT.2020 non-constant";                        //Added in HEVC
            case 10 : return "BT.2020 constant";                            //Added in HEVC
            case 11 : return "Y'D'zD'x";                                    //Added in HEVC 2016
            case 12 : return "Chromaticity-derived non-constant";           //Added in HEVC 2016
            case 13 : return "Chromaticity-derived constant";               //Added in HEVC 2016
            case 14 : return "ICtCp";                                       //Added in HEVC 2016
            default : return "";
        }
    }
    
     
  • Helg

    Helg - 2020-11-01

    Thanks!

     

Log in to post a comment.