[FFmpeg-user] Questions about readout important metadata from DPX files ("logarthmic/linear") and recreate DPX with same metadata

FFMPEG_UL ffmpeg at rgbaz.eu
Mon Mar 9 18:05:41 CET 2015


Hi Chris,

On 09-03-15 13:30, Christoph Gerstbauer wrote:
> Hello
>
> I am testing longterm archiving of DPX sequences with ffv1. (DPX 
> encoding to FFV1 and recreating DPX from the FFV1 archivemaster)
>
> As far as I tested I can say (for the ffv1-supported pixelformats 
> "gbrp10le" and "gbrp12le") it works lossless. All FrameMD5s are equal:
>
> Original DPX (RGB 10bit log,  pix_fmt=gbrp10le)
> -> transcoded to ffv1 - FrameMD5 OK (pix_fmt=gbrp10le)
> -> transcode back to DPX (gbrp10le) but LINEAR, not logarthmic (I have 
> no idea how to save metadata "logarthmic" into DPX) - FrameMD5 OK
>
> Now I have a problem with the lost metadata of interpretation of the 
> RGB values.
> The Original has LOGARITHMIC 10bit (RGB 10bit log), the ffmpeg created 
> DPX has LINEAR 10bit (RGB 10bit) as can be seen here:
>
> Original DPX:
>
> C:\Users\gersti>mediainfo "I:\DPX\_DPX examples\ARRI 
> SCAN\LOG_ORIGINAL.dpx"
> General
> Complete name                            : I:\DPX\_DPX examples\ARRI 
> SCAN\LOG_ORIGINAL.dpx
> Format                                   : DPX
> Format version                           : Version 2
> File size                                : 25.3 MiB
> Encoded date                             : 2011:06:03:19:25:40+10
> Writing library                          : ARRISCAN084
>
> Image
> Format                                   : DPX
> Format version                           : Version 2
> Width                                    : 3 072 pixels
> Height                                   : 2 160 pixels
> Display aspect ratio                     : 1.422
> Bit depth                                : 10 bits
> Compression mode                         : Lossless
> Stream size                              : 25.3 MiB (100%)
> Writing library                          : ARRISCAN084
> Encoded date                             : 2011:06:03:19:25:40+10
> Color primaries                          : Logarithmic
>
>
> Recreated DPX:
>
> C:\Users\gersti>mediainfo "I:\DPX\_DPX examples\ARRI 
> SCAN\LOG_ORIGINAL_To_FFv1_to_DPX.dpx"
> General
> Complete name                            : I:\DPX\_DPX examples\ARRI 
> SCAN\LOG_ORIGINAL_To_FFv1_to_DPX.dpx
> Format                                   : DPX
> Format version                           : Version 2
> File size                                : 25.3 MiB
> Writing library                          : Lavc56.13.100
>
> Image
> Format                                   : DPX
> Format version                           : Version 2
> Width                                    : 3 072 pixels
> Height                                   : 2 160 pixels
> Display aspect ratio                     : 1.422
> Bit depth                                : 10 bits
> Compression mode                         : Lossless
> Stream size                              : 25.3 MiB (100%)
> Writing library                          : Lavc56.13.100
> Color primaries                          : Linear
>
>
> Therefore my questions are:
>
> 1.) How can I read out the "logarthmic" or "linear" metadata 
> information with ffprobe?
> ffprobes "-show_streams", "-show_format"  or "-show_frames" shows me 
> nothing I can use:
>     color_space=unknown (should this be RGB at gbrp10le?)
>     color_transfer=unknown
>     color_primaries=unknown (should this be "logarithmic" or "linear" 
> like in the mediainfo information block?)
> used ffmpeg version:
> ffmpeg version 2.5.4 Copyright (c) 2000-2015 the FFmpeg developers
> built on Feb 16 2015 15:15:26 with gcc 4.8 (GCC)
>
>
I don't know about ffprobe's internals but i guess it's not implemented.
Not many of DPX specs are.
>
> 2.) If ffmpeg is able to read out this information from the original 
> DPX how can I save it back into the recreated DPX?
>     Maybe with -color_primaries <value>?
ffmpeg's DPX encode is hardcoded to write 'linear' into the header.

for now, if you want to write 'logarithmic' into the header, you can change
and compiled ffmpeg yourself, here's a manual change:

in this file:
     <ffmpeg src>/libavcodec/dpxenc.c
change (around line 217):
     buf[801] = 2; /* linear transfer */
to:
     buf[801] = 3; /* linear transfer */
then recompile.
All DPX headers you create will then be considered to contain log pixeldata.

>
> 3.) How can I read out the DPX Version information like mediainfo 
> does? (Version 2)

Colorimetrics is not the right name.
Color primaries are the settings for where for instance the Red, Green 
and Blue
values are defined in a certain colourspace.
Lin/Log says is about the gamma.

>
> Thanks for your help!

i hope this helps you out a bit...

>
> Best Regards
> Christoph
>
>

greets
ArnoB



More information about the ffmpeg-user mailing list