{"id":13906495,"url":"https://github.com/quietvoid/hdr10plus_tool","last_synced_at":"2025-04-12T21:26:39.054Z","repository":{"id":37635991,"uuid":"165569024","full_name":"quietvoid/hdr10plus_tool","owner":"quietvoid","description":"CLI utility to work with HDR10+ in HEVC files.","archived":false,"fork":false,"pushed_at":"2024-05-29T01:49:31.000Z","size":1463,"stargazers_count":278,"open_issues_count":1,"forks_count":32,"subscribers_count":12,"default_branch":"main","last_synced_at":"2024-05-29T03:09:50.245Z","etag":null,"topics":["dynamic-metadata","ffmpeg","hdr","hdr10plus"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quietvoid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-14T00:10:31.000Z","updated_at":"2024-06-15T18:41:50.582Z","dependencies_parsed_at":"2023-02-15T04:01:34.662Z","dependency_job_id":"538b2b30-6d71-4c6b-9aff-475535f35cf2","html_url":"https://github.com/quietvoid/hdr10plus_tool","commit_stats":{"total_commits":122,"total_committers":3,"mean_commits":"40.666666666666664","dds":"0.040983606557377095","last_synced_commit":"91d4723bfa7a647e04ee3f727c037cea0a956bb2"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quietvoid%2Fhdr10plus_tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quietvoid%2Fhdr10plus_tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quietvoid%2Fhdr10plus_tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quietvoid%2Fhdr10plus_tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quietvoid","download_url":"https://codeload.github.com/quietvoid/hdr10plus_tool/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248633544,"owners_count":21136886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dynamic-metadata","ffmpeg","hdr","hdr10plus"],"created_at":"2024-08-06T23:01:36.987Z","updated_at":"2025-04-12T21:26:39.026Z","avatar_url":"https://github.com/quietvoid.png","language":"Rust","funding_links":[],"categories":["HarmonyOS","Rust","Media Tools"],"sub_categories":["Windows Manager","Color Science \u0026 Histogram Analysis"],"readme":"# hdr10plus_tool [![CI](https://github.com/quietvoid/hdr10plus_tool/workflows/CI/badge.svg)](https://github.com/quietvoid/hdr10plus_tool/actions/workflows/ci.yml) [![Artifacts](https://github.com/quietvoid/hdr10plus_tool/workflows/Artifacts/badge.svg)](https://github.com/quietvoid/hdr10plus_tool/actions/workflows/release.yml)\nCLI utility to work with HDR10+ in HEVC files.  \nPreviously named `hdr10plus_parser`, now it's more than just a parser.\n\n\u0026nbsp;\n\n## **Building**\n### **Toolchain**\n\nThe minimum Rust version to build **`hdr10plus_tool`** is 1.85.0.\n\n### **Dependencies**\nOn Linux systems, [fontconfig](https://github.com/yeslogic/fontconfig-rs#dependencies) is required.  \nAlternatively, system fonts can be bypassed by building with `--no-default-features --features internal-font`.\n\n\u0026nbsp;\n\nOptions that apply to the commands:\n* `--verify` Checks if input file contains dynamic metadata.\n* `--skip-validation` Skip profile conformity validation. Invalid metadata is set to profile `N/A`.\n\n## Commands\n* ### **extract**\n    Extracts the HDR10+ metadata from a HEVC file to a JSON file.  \n    Also calculates the scene information for compatibility with Samsung tools.  \n\n    If no output is specified, the file is only parsed partially to verify presence of metadata.\n\n    Input file:\n    - HEVC bitstream\n    - Matroska (experimental): MKV file containing a HEVC video track.\n\n\n    **Flags**:\n    * `--skip-reorder` Skip metadata reordering after extracting.\n        - [Explanation on when to use `--skip-reorder`](README.md#wrong-metadata-order-workaround).\n    * `-l`, `--limit` Number of frames to process from the input. Processing stops after N frames.\n\n    **Examples**:\n    ```console\n    hdr10plus_tool extract video.hevc -o metadata.json\n\n    # Experimental\n    hdr10plus_tool extract video.mkv -o metadata.json\n    ```\n    ```console\n    ffmpeg -i input.mkv -map 0:v:0 -c copy -bsf:v hevc_mp4toannexb -f hevc - | hdr10plus_tool extract -o metadata.json -\n    ```\n\n    **Extract without validating**:\n    ```console\n    hdr10plus_tool --skip-validation extract video.hevc -o metadata.json\n    ```\n\n\u0026nbsp;\n* ### **inject**\n    Interleaves HDR10+ metadata NAL units before slices in an HEVC encoded bitstream.  \n    `--verify` has no effect with this command.\n    \n    **Example**:  \n    ```console\n    hdr10plus_tool inject -i video.hevc -j metadata.json -o injected_output.hevc\n    ```\n\n\u0026nbsp;\n* ### **remove**\n    Removes HDR10+ metadata NAL units (or SEI messages) in an HEVC encoded bitstream.  \n    `--verify` has no effect with this command.\n    \n    **Example**:  \n    ```console\n    hdr10plus_tool remove video.hevc -o hdr10plus_removed_output.hevc\n    ```\n    ```console\n    ffmpeg -i input.mkv -map 0:v:0 -c copy -bsf:v hevc_mp4toannexb -f hevc - | hdr10plus_tool remove -\n    ```\n\u0026nbsp;\n* ### **plot**\n    Allows plotting the HDR10+ brightness metadata into a graph.\n    The output is a PNG image.\n\n    **Flags**:\n    - `-t`, `--title` The title to set at the top of the plot\n    - `-p`, `--peak-source` How to extract the peak brightness for the metadata [default: `histogram`]      \n        Possible values: `histogram`, `histogram99`, `max-scl`, `max-scl-luminance`\n    - `-s`, `--start` Set frame range start\n    - `-e`, `--end` Set frame range end (inclusive)\n\n    **Example**:\n    ```console\n    hdr10plus_tool plot metadata.json -t \"HDR10+ plot\" -o hdr10plus_plot.png\n    ```\n\u0026nbsp;\n* ### **editor**\n    Allow adding and removing frames\n    \n    **edits.json**\n    The editor expects a JSON config like the example below:\n    ```json5\n    {\n        // List of frames or frame ranges to remove (inclusive)\n        // Frames are removed before the duplicate passes\n        \"remove\": [\n            \"0-39\"\n        ],\n\n        // List of duplicate operations\n        \"duplicate\": [\n            {\n                // Frame to use as metadata source\n                \"source\": int,\n                // Index at which the duplicated frames are added (inclusive)\n                \"offset\": int,\n                // Number of frames to duplicate\n                \"length\": int\n            }\n        ]\n    }\n    ```\n    \n    **Example**\n    ```console\n    hdr10plus_tool editor metadata.json -j edits.json -o metadata_modified.json\n    ```\n\u0026nbsp;\n\n### Wrong metadata order workaround\nThe `skip-reorder` option should only be used as a workaround for misauthored HEVC files.  \nSome rare retail discs use an incorrect workflow where the original metadata is inserted sequentially in the final video, which causes issues when B frames exist.  \nAs the metadata is inserted for every frame in **decode order**, on playback it is likely that the **presentation order** is different.  \nIn playback, this means that the metadata associated with the image presented may be wrong.\n\nA simple way to tell if the metadata is in the wrong order is by looking at the `SceneFrameNumbers` list in the JSON.  \nIf there are many entries where scenes only contain 1 to 3 frames, it is likely that the video has wrong order.  \nThe `SceneFirstFrameIndex` values should also be aligned with scene cuts in the video.  \nIf the scenes are small and misaligned, `skip-reorder` must be used when using `extract` to keep the order correct.\n\n\u0026nbsp;\n\n## Sample files\nTears of Steel samples encoded with x265 using `--dhdr10-info` for tests.\n\nSample JSON metadata available here: https://bitbucket.org/multicoreware/x265_git/downloads/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquietvoid%2Fhdr10plus_tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquietvoid%2Fhdr10plus_tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquietvoid%2Fhdr10plus_tool/lists"}