Hello, folks!
I need to write CLI application for checking HDR10 metadata in input video .mp4 file in hevc codec.
On input it has video file and HDR10 metadata in json format.
First of all need to check is it(video) has generated values for example such as
"BezierCurveData": {
"Anchors": [
256,
512,
767
],
"KneePointX": 0,
"KneePointY": 0
},
"DateTimeMetadataGenerated": "2018-11-15T11:04:31Z",
"LuminanceParameters": {
"AverageRGB": 581,
"LuminanceDistributions": {
"DistributionIndex": [
1,
5,
10,
25,
50,
75,
90,
95,
99
],
"DistributionValues": [
0,
14326,
88,
12,
41,
385,
1483,
2724,
14230
]
},
"MaxScl": [
0,
0,
0
]
},
"NumberOfWindows": 1,
"SceneFrameIndex": 0,
"SceneId": 0,
"SequenceFrameIndex": 0,
"TargetedSystemDisplayMaximumLuminance": 0
}
I want to use x265 library for this. My idea is to use this api function from x265.h:
int x265_encoder_encode(x265_encoder *encoder, x265_nal **pp_nal, uint32_t *pi_nal, x265_picture *pic_in, x265_picture *pic_out)
It has pic_in and pic_out pointers. If I can compare input and output frames from pic_in and pic_out objects respectively, then I can tell next:
if input video frame parameters HDR10 metadata == generated output frame HDR10 metadata, then input video file really has metadata
if input video frame parameters HDR10 metadata != generated output frame HDR10 metadata, then there is no metadata.
I saw source code for x265, well I know what pic_in depends on Frame* frame, Frame* frame in its turn depends on Slice* slice when users metadata posting calculation goes,
and posting metadata links on compressFrame() in frameencoder.cpp.
Unfortunately, I'dont know many things yet about how x265 encoding format works.
Can you tell me some hints about which types of x265.h api structure data I can use to get this things without a lot of painless work??
And if you have idea how get this mission works more easy way I'll be very gratefull to you for any shared information!!
Or maybe if you know about instruments(with open source code I mean) which can get json metadata from video, please let me know)
Many Thanks!
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 2 of 2
Thread
-
-
Okay, I founded answer by myself. In x265 generation metadata runs with toneMap array values. In x265.cpp has m_cim pointer on frame array metadata from which when encoder starts his work generated metadata values pasts to input bitstream. You can create array of generated values and check videofile byte by byte and found exactly same numbers metadata insertion accordingly with 'SceneFrameNumbers' value in json file. If you know reverse alghoritm you can get initual metadata values frame by frame from binary videofile.
Similar Threads
-
ffmpg MTS to MP4 - no metadata :(
By fabrizio.medici in forum Video ConversionReplies: 5Last Post: 19th Aug 2024, 13:23 -
ffmpeg to convert 4k/hdr10 to (i) h.264/10-bit/.mp4 (ii) h.265/10-bit/.mp4
By hydra3333 in forum Video ConversionReplies: 2Last Post: 10th Feb 2018, 19:49 -
metadata of HDR10
By namdvt in forum Newbie / General discussionsReplies: 8Last Post: 28th Sep 2017, 15:30 -
how to edit mp4/mkv metadata in windows?
By mrjayviper in forum Video ConversionReplies: 6Last Post: 30th Jun 2015, 20:13 -
Looking for a decent MP4 metadata tagger
By unsungno1 in forum Newbie / General discussionsReplies: 5Last Post: 23rd Feb 2015, 03:09