VideoHelp Forum
+ Reply to Thread
Results 1 to 18 of 18
Thread
  1. Member
    Join Date
    Jul 2020
    Location
    Moldova
    Search PM

    Program description


    Cine Encoder is an application, uses the FFmpeg, MKVToolNix and MediaInfo utilities, that allows to convert media files while preserving HDR metadata. Supported hardware encoding NVENC for codecs H265, H264 and Intel QSV (for Windows and experimental for Linux) for codecs H264, MPEG-2. The following encoding modes are implemented: H265, H264, VP9, MPEG-2, XDCAM, DNxHR, ProRes. The program can also be used to change the HDR metadata, such as Master Display, maxLum, minLum, and other parameters.


    Download

    https://github.com/CineEncoder/cine-encoder/releases

    Linux versions:

    https://www.pling.com/p/1406740/


    Report a bug

    https://github.com/CineEncoder/cine-encoder/issues
    Last edited by Helg1980; 25th Aug 2021 at 11:39.
    Quote Quote  
  2. The first program for Linux for encoding HDR videos appeared.
    What about all programs which support x265 or NVEncC, which both support HDR encoding fine for quite a while?

    I want to know your opinion about the program.
    Personally I don't like the black theme.
    Looks like a simple Qt based GUI which uses MediaInfo to analyse video and ffmpeg for decoding and encoding.
    So another ffmpeg gui.

    Problems I see are:
    • afaik ffmpeg doesn't allow to set light levels, master displaying information and chroma sample location.
      You only set "-sei hdr -color_primaries {colorprim} -color_trc {transfer} -colorspace {colormatrix} -color_range tv" so 'while preserving HDR signals' also seems a big far fetched.
    • you hardcode tv luma range
    • only support HDR10, no HDR10+, HLG or DolbyVision.
    • rather limited usage due to the restricted HDR support and no additional filtering&co
    Also why Linux only? Seeing that you base your code on Qt, why not support Windows and MacOS?

    -> Which you the best with your tool! Linux can always use some more coders.
    Sadly it but it doesn't seem to offer anything to me which wasn't available before so for me it's a pass.

    Cu Selur

    Ps.: Why the mediainfo dependency? Why not use ffmpeg to analyse the source if you don't set stuff like light levels&co?
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  3. Member
    Join Date
    Jul 2020
    Location
    Moldova
    Search PM
    Hi!

    As far as I know, there is no support for HDR signals in Linux programs yet (we are only talking about Linux programs).
    I tried running Hybrid, it has an experimental mode, but it doesn't work for me.

    To add brightness signals I used the mkvmerge utility as recommended by Google:
    https://developers.google.com/media/vp9/hdr-encoding

    HLG mode is also supported, you can see it in the Advanced section of program.
    Other modes are in development.

    I know about your Hybrid program for a long time, it is a very good program,
    but it works stably only for Windows for me (I haven't tried it under MacOS)
    and an excessive number of settings, as it seems to me.
    So I was forced to use my own program.

    The version of my program under Windows and MacOS I don't know when it will appear, it is still only in my plans.
    Quote Quote  
  4. To add brightness signals I used the mkvmerge utility as recommended by Google
    Good catch, I totally forgot about that method, but this does limit the output to mkv(webm) only right?
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  5. Member
    Join Date
    Jul 2020
    Location
    Moldova
    Search PM
    Yes, this is the only problem when using this method.
    Quote Quote  
  6. Small suggestion, you could:
    a. encode the video with x265 (decode with ffmpeg pipe to x265)
    b. encoder audio and add passthrough video using ffmpeg
    this way at least for H.265 you would have proper HDR signaling and you wouldn't be bound to mkv as container.
    Yes, it would add one additional step to the processing, but this way the stream would have the proper signaling.

    I'm wondering if you add the signaling through mkvmerge why not add all (colorprime, transfer, colormatrix, luma range) the signaling this way?

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  7. Member
    Join Date
    Jul 2020
    Location
    Moldova
    Search PM
    why not add all (colorprime, transfer, colormatrix, luma range)
    I also add these signals using mkvmerge


    mkvmerge \
    -o HDR_strobe_scientist_18Mbps.mkv\
    --colour-matrix 0:9 \
    --colour-range 0:1 \
    --colour-transfer-characteristics 0:16 \
    --colour-primaries 0:9 \
    --max-content-light 0:1000 \
    --max-frame-light 0:300 \
    --max-luminance 0:1000 \
    --min-luminance 0:0.01 \
    --chromaticity-coordinates 0:0.68,0.32,0.265,0.690,0.15,0.06 \
    --white-colour-coordinates 0:0.3127,0.3290 \
    HDR_strobe_scientist_18Mbps.webm
    Quote Quote  
  8. ARGH!
    I fust looked at your code:
    Code:
    cmd = f'mkvmerge -o "{output_file}" --colour-matrix 0:9 --colour-range 0:1 ' \
                              f'--colour-transfer-characteristics 0:{trc} --colour-primaries 0:9 --max-content-light 0:1000 ' \
                              f'--max-frame-light 0:300 --max-luminance 0:1000 --min-luminance 0:0.01 ' \
                              f'--chromaticity-coordinates 0:0.68,0.32,0.265,0.690,0.15,0.06 --white-colour-coordinates ' \
                              f'0:0.3127,0.3290 "{temp_file}" '
    WTF? Do you even know what you are doing?
    Code:
    --colour-primaries 0:9 --max-content-light 0:1000 ' \
                              f'--max-frame-light 0:300 --max-luminance 0:1000 --min-luminance 0:0.01 ' \
                              f'--chromaticity-coordinates 0:0.68,0.32,0.265,0.690,0.15,0.06 --white-colour-coordinates ' \
                              f'0:0.3127,0.3290 "
    are source dependent, those should not be hardcoded!
    You should either let the user decide their values and/or take those values from the source.

    For a source with for example values like:
    Code:
    colour_description_present               : Yes
    colour_description_present_Source        : Stream
    Color range                              : Limited
    colour_range_Source                      : Stream
    Color primaries                          : BT.2020
    colour_primaries_Source                  : Stream
    Transfer characteristics                 : PQ
    transfer_characteristics_Source          : Stream
    Matrix coefficients                      : BT.2020 non-constant
    matrix_coefficients_Source               : Stream
    Mastering display color primaries        : BT.2020
    MasteringDisplay_ColorPrimaries_Source   : Stream
    Mastering display luminance              : min: 0.0020 cd/m2, max: 1000 cd/m2
    MasteringDisplay_Luminance_Source        : Stream
    Maximum Content Light Level              : 992 cd/m2
    MaxCLL_Source                            : Stream
    Maximum Frame-Average Light Level        : 518 cd/m2
    MaxFALL_Source                           : Stream
    you would totally change the HDR signaling!
    Those values on the google VP9 page were an example not a 'always use these'.
    If those values were always the same signaling them would make no sense.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  9. When reading the MediaInfo data:

    MediaInfo-Data -> mkvmerge parameters
    'Mastering display luminance' -> gives you 'min-luminance' and 'max-luminance'
    'Maximum Content Light Level' -> gives you 'max-content-light'
    'Maximum Frame-Average Light Level' -> gives you 'max-frame-light'
    'Color primaries' -> gives you 'colour-primaries'
    'Color range' -> gives you 'colour-range'
    'Mastering display color primaries' -> gives you 'chromaticity-coordinates' and 'white-colour-coordinates'

    => with those values you should be able to fix your tool

    For help interpreting the 'Mastering display luminance' data, here's a short code snippet from Hybrid source code:
    Code:
      if (line == QString("Display P3")) {
        line = QString("R(x=0.680, y=0.320), G(x=0.265, y=0.690), B(x=0.150, y=0.060), White point(x=0.3127, y=0.3290)"); // DCI-P3 D65
      } else if (line == QString("DCI P3")) {
        line = QString("R(x=0.680, y=0.320), G(x=0.265, y=0.690), B(x=0.150, y=0.060), White point(x=0.314, y=0.3510)"); // DCI-P3 Theater
      } else if (line == QString("BT.2020")) {
        line = QString("R(x=0.708, y=0.292), G(x=0.170, y=0.797), B(x=0.131, y=0.046), White point(x=0.3127, y=0.3290)"); // Rec. ITU-R BT.2020-2
      }
      QRegExp reg("^R\\(x=(.*), y=(.*)\\), G\\(x=(.*), y=(.*)\\), B\\(x=(.*), y=(.*)\\), White point\\(x=(.*), y=(.*)\\)$");
      if (!reg.exactMatch(line)) {
        reg = QRegExp("^R: x=(.*) y=(.*), G: x=(.*) y=(.*), B: x=(.*) y=(.*), White point: x=(.*) y=(.*)$");
        if (!reg.exactMatch(line)) {
          sendMessage(HANALYSE | HPOPUP, QString("Unknown 'Mastering display color primaries'-format, please report to Selur.Thanks!\n%1").arg(line));
          return;
        }
      }
    The info about how to parse the 'Mastering display luminance' data from MediaInfo can also be found somewhere over at doom9s in the MediaInfo-thread iirc.


    Cu Selur
    Last edited by Selur; 1st Aug 2020 at 09:55.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  10. Member
    Join Date
    Jul 2020
    Location
    Moldova
    Search PM
    Yes, you are absolutely right. I'll need to fix it.
    Quote Quote  
  11. Member
    Join Date
    Jul 2020
    Location
    Moldova
    Search PM
    Hi,

    I completely rewritten the program. Now everything clearly works.
    Last edited by Helg1980; 15th Nov 2020 at 05:09.
    Quote Quote  
  12. Good for you.
    Looking at the code and since you use ffmpeg for decoding you might want to support gpu decoding.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  13. Member
    Join Date
    Jul 2020
    Location
    Moldova
    Search PM
    After several months of work, a new version of the Cine Encoder v3.0 was released.
    In the new version:

    - changed the design,
    - added batch mode,
    - added 2-pass mode,
    - added a mode for working with presets,
    - added a pause function during conversion.

    There are packages for the main distributions: Debian, Ubuntu 20.04, Fedora 32, CentOS 7.8, Arch Linux, Manjaro Linux.
    Last edited by Helg1980; 15th Nov 2020 at 05:47.
    Quote Quote  
  14. Member
    Join Date
    Jul 2020
    Location
    Moldova
    Search PM
    In new version 3.1:

    - released a package for Windows,
    - fixed some bugs,
    - improved design.
    Last edited by Helg1980; 25th Aug 2021 at 11:37.
    Quote Quote  
  15. Member
    Join Date
    Jul 2020
    Location
    Moldova
    Search PM
    In new version 3.2:

    - added new features: metadata editing, audio track selection, subtitle selection, clip cropping, clip sorting,
    - added presets,
    - fixed some bugs,
    - improved design.
    Last edited by Helg1980; 25th Aug 2021 at 11:37.
    Quote Quote  
  16. Member
    Join Date
    Jul 2020
    Location
    Moldova
    Search PM
    In new version 3.3:

    - the interface has been redesigned into dock widgets,
    - added new features: additional settings for presets.
    - added presets for Intel QSV, XDCAM,
    - fixed some bugs.
    Last edited by Helg1980; 25th Aug 2021 at 11:36.
    Quote Quote  
  17. Member
    Join Date
    Jul 2020
    Location
    Moldova
    Search PM
    In new version 3.4:

    - added log window,
    - added a light theme,
    - added the ability to minimize the program to the tray,
    - apply the preset with a double left click,
    - change a preset's names in the preset window,
    - added the ability to convert the color primary, color matrix, transfer,
    - fixed some bugs.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!