Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > High Efficiency Video Coding (HEVC)

Reply
 
Thread Tools Search this Thread Display Modes
Old 22nd January 2019, 19:58   #41  |  Link
buratino
Registered User
 
Join Date: Jan 2019
Posts: 2
hi,

i create json data in DaVinci Resolve for my hdr video.
How to implement the JSON data in the video?
buratino is offline   Reply With Quote
Old 22nd January 2019, 22:42   #42  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
--dhdr10-info <foo>.json
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 23rd January 2019, 00:38   #43  |  Link
buratino
Registered User
 
Join Date: Jan 2019
Posts: 2
Quote:
Originally Posted by benwaggoner View Post
--dhdr10-info <foo>.json
sorry...
I just started to study this topic. what utility should i use?
buratino is offline   Reply With Quote
Old 23rd January 2019, 01:01   #44  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
Quote:
Originally Posted by buratino View Post
sorry...
I just started to study this topic. what utility should i use?
That's the syntax for x265.exe. That will inject the JSON into the SEI messages while encoding the video.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 25th January 2019, 23:55   #45  |  Link
mini-moose
Registered User
 
Join Date: Oct 2007
Posts: 385
Quote:
Originally Posted by benwaggoner View Post
That's the syntax for x265.exe. That will inject the JSON into the SEI messages while encoding the video.
Do you have definite opinion if this should be used with --dhdr10-opt or not?
mini-moose is offline   Reply With Quote
Old 26th January 2019, 08:04   #46  |  Link
mariner
Registered User
 
Join Date: Nov 2005
Posts: 583
Quote:
Originally Posted by quietvoid View Post
Hi, since HDR10+ titles started coming out I've been working on extracting the metadata from them.
For now the only purpose is to generate JSON files that x265 can use when reencoding these sources.

So I've made a tool which does just that, extracts the metadata and creates a compatible JSON file for x265.
It outputs a .log file with the raw bytes of every SEI message as well as a .json file with metadata formatted for HDR10+ LLC (not legacy).
HDR10+ LLC is what most current titles have been formatted like for now.

The tool is available on GitHub here: https://github.com/quietvoid/hdr10plus_parser
HDR10+ samples are available in the assets folder, they're also used for regression tests.

Hopefully this is useful for anyone wanting to retain HDR10+ after reencode as well as developers who have ideas about reusing the metadata on decode
Thank you, quietvoid.
mariner is offline   Reply With Quote
Old 3rd February 2019, 16:58   #47  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
okay so far we can:
  • verify whether a HEVC file contains HDR-10+ dynamic data (using hdr10plus_parser)
  • extract existing HDR-10+ dynamic data from a file (using hdr10plus_parser + ffmpeg, in case the video isn't available as raw video)
  • convert to HDR-10+ using x265 and the corresponding dynamic data
tested the above and they all seem to work fine.

Next question is: How to playback such content on a pc?

Cu Selur

Ps.: Thanks to quietvoid for hdr10plus_parser. Really useful!
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 3rd February 2019, 17:41   #48  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,346
I'm working on making the HDR10+ metadata available to a renderer when decoding with LAV Video, so eg. madVR could then make use of it. madshi has already expressed interest in making use of it. A timeframe for that is however not available.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old 3rd February 2019, 18:57   #49  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
@nevcairiel: Thanks for the info. Happy to hear someone is working on it.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 4th February 2019, 09:31   #50  |  Link
jlpsvk
Registered User
 
Join Date: Dec 2014
Posts: 240
Another question. Can we crop video, while encoding with HDR10+ metadata?
__________________
AMD Ryzen 9 5950X, 32GB DDR4-3200 CL16, RTX 3060, 2TB NVMe PCIE4.0, NAS with 8x16TB HDD
jlpsvk is offline   Reply With Quote
Old 4th February 2019, 10:58   #51  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,346
The HDR10+ metadata references areas of the video, so if you scale or crop it (ie. change its size in any way), you would need to update the metadata accordingly.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders

Last edited by nevcairiel; 4th February 2019 at 11:02.
nevcairiel is offline   Reply With Quote
Old 4th February 2019, 13:03   #52  |  Link
quietvoid
Registered User
 
Join Date: Jan 2019
Location: Canada
Posts: 574
I'm thinking it's all mostly based on luminance.
There's info about every luminance percentile for a frame and a value associated to it.
However I'm not sure what these values refer to, nor what Average Max RGB is about either.
quietvoid is offline   Reply With Quote
Old 4th February 2019, 13:43   #53  |  Link
jlpsvk
Registered User
 
Join Date: Dec 2014
Posts: 240
anyone know, how to update those metadata for cropped encode?
__________________
AMD Ryzen 9 5950X, 32GB DDR4-3200 CL16, RTX 3060, 2TB NVMe PCIE4.0, NAS with 8x16TB HDD
jlpsvk is offline   Reply With Quote
Old 4th February 2019, 17:59   #54  |  Link
mini-moose
Registered User
 
Join Date: Oct 2007
Posts: 385
Quote:
Originally Posted by Selur View Post
[*]extract existing HDR-10+ dynamic data from a file (using hdr10plus_parser + ffmpeg, in case the video isn't available as raw video)
How is it done with ffmpeg? Example would be much appreciated!
mini-moose is offline   Reply With Quote
Old 4th February 2019, 20:08   #55  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
to output the data:
Code:
ffmpeg -i "E:\Output\HDR-10+.mp4" -vcodec copy -an -sn -vbsf hevc_mp4toannexb -f rawvideo - | hdr10plus_parser.exe -
just to check whether dynamic data is present
Code:
ffmpeg -i "E:\Output\HDR-10+.mp4" -vcodec copy -an -sn -vbsf hevc_mp4toannexb -f rawvideo - | hdr10plus_parser.exe - --verify
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 5th February 2019, 00:54   #56  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
Quote:
Originally Posted by jlpsvk View Post
anyone know, how to update those metadata for cropped encode?
If you cropped out any image data, it would need to be recalculated.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 5th February 2019, 10:23   #57  |  Link
jlpsvk
Registered User
 
Join Date: Dec 2014
Posts: 240
Quote:
Originally Posted by benwaggoner View Post
If you cropped out any image data, it would need to be recalculated.
seems like a bad idea to crop and resize then. would stick with uncropped.
__________________
AMD Ryzen 9 5950X, 32GB DDR4-3200 CL16, RTX 3060, 2TB NVMe PCIE4.0, NAS with 8x16TB HDD
jlpsvk is offline   Reply With Quote
Old 5th February 2019, 13:05   #58  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
Quote:
Originally Posted by jlpsvk View Post
seems like a bad idea to crop and resize then. would stick with uncropped.
Resizing is a low-pass filter, and can reduce peak brightness significantly if it is from small details like stars.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 5th February 2019, 13:18   #59  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,346
Cropping alone wouldn't change the primary image information (assuming you only crop black bars). However, the metadata also references spatial windows in the image, which would get displaced if you crop, so those would at the very least need to be re-positioned.
Without proper tool support to do all of this, I would not bother trying to crop yet.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old 5th February 2019, 13:45   #60  |  Link
jlpsvk
Registered User
 
Join Date: Dec 2014
Posts: 240
yeah. i was meaning cropping, not resizing. so hdr10+ encodes without cropping for now.
__________________
AMD Ryzen 9 5950X, 32GB DDR4-3200 CL16, RTX 3060, 2TB NVMe PCIE4.0, NAS with 8x16TB HDD
jlpsvk is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 20:32.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.