Page 1 of 1

BRAW : Aspect Ratio meaning and Anamorphic footages

PostPosted: Tue Aug 27, 2019 10:19 am
by antoine
Hi,
I don't understand the meaning of the "aspect_ratio" metadata field in the BRAW API. For example with the given SDK Samples A056_08251956_C074.braw we have :
Code: Select all
A056_08251956_C074.braw
Aspect Ratio :  2.35:1
Image Size (Width x Height): 4608 x 2592
==> Width/Height = 16:9
Stretch Factor = Aspect Ratio / ( Width/Height  ) = 1.321875

A056_08251956_C074.braw shown in square pixels looks perfectly fine. So the correct Aspect Ratio should be 16:9. Not sure about the meaning of 2.35, should we stretch horizontally the footage by the computed Stretch Factor ? That wouldn't make sense for this footage because it already looks fine in square pixels.

But then if I have a look at a BMPCC6K sample footage A001_06260425_C006.braw shot in anamorphic :
Code: Select all
A001_06260425_C006.braw
Aspect Ratio : 2.40:1
Image Size (Width x Height): 3728 x 3104
==> Width/Height = 1.201
Stretch Factor = Aspect Ratio / ( Width/Height  ) = 1.998
Corrected Stretch Factor = 2.0

So the Stretch factor would be 2.0 (almost, but let's take into account that the Blackmagic camera had to take a resolution multiple of 8) and it would make sense here (i.e. footage doesn't look fine in square pixels, but does look fine after taking into account the Corrected Stretch factor)

What am I missing ? And how does the camera know that the user is shooting anamorphic ?

Thanks!

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostPosted: Thu Aug 29, 2019 3:17 am
by CaptainHook
Aspect ratio is actually the ratio for the frame guides, this metadata field is not really in use currently and may change names in the future to more correctly represent the value it stores. There is also a currently known bug that the ratio is stored in the metadata even when the frame guide is not in use.

Anamorphic is/will be indicated by the tag "anamorphic" - currently the P4K and P6K do not write the tags but we hope to in a future update. The UMP G1/G2 already writes the anamorphic tag.

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostPosted: Fri Aug 30, 2019 6:07 am
by antoine
Thanks for this info.
Would you have a footage with the "anamorphic" tag so that we can plan ahead this feature ?
Will one be able to know the exact anamorphic horizontal stretch value ? (since we only have it approximately due do the resolution rounding to a multiple of 8)
Or is there a fixed list of all anamorphic values out there ( 1.33 , 1.5 , 2.0 etc.) ?

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostPosted: Sat Aug 31, 2019 12:17 pm
by antoine
In Resolve 16.1 Beta 2 :

Addressed an issue where the pixel aspect ratio would not be read correctly from Blackmagic RAW files

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostPosted: Fri Oct 25, 2019 12:06 pm
by antoine
Hello,
Is there any news related to that ? There is a new Camera Update bringing more anamorphic crops so I guess now is the time to have the new metadata ?

Thanks!

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostPosted: Sun Nov 24, 2019 3:07 pm
by antoine
Any news ?

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostPosted: Sat Oct 10, 2020 6:43 am
by antoine
Is there any update here and files we can test ? We really want to improve our plugins in that regard. Would be great to help us

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostPosted: Fri Oct 29, 2021 11:37 am
by antoine
CaptainHook wrote:Aspect ratio is actually the ratio for the frame guides, this metadata field is not really in use currently and may change names in the future to more correctly represent the value it stores. There is also a currently known bug that the ratio is stored in the metadata even when the frame guide is not in use.

Anamorphic is/will be indicated by the tag "anamorphic" - currently the P4K and P6K do not write the tags but we hope to in a future update. The UMP G1/G2 already writes the anamorphic tag.

Hi, do we have any news on that ? Nobody told us anything and we keep asking for this information over and over.

There is more info in DaVinci Resolve 17.4.1

https://www.blackmagicdesign.com/suppor ... 48ab51a666


> Addressed incorrect PAR values on some Blackmagic RAW clips.

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostPosted: Fri Oct 29, 2021 7:58 pm
by CaptainHook
As per the changelog for 2.2
• Internal metadata key name change of “aspect_ratio” to “frameguide_aspect_ratio”.

Resolve uses the anamorphic metadata tag for automatic PAR transforms as mentioned previously in this thread. There's no other 'news' to be shared at this time or it would have been already.

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostPosted: Thu Nov 04, 2021 9:52 am
by taranwaran
Aspect ratio is the ratio for the frame guides

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostPosted: Fri Nov 18, 2022 4:12 pm
by antoine
Hi ! New info from BRAW v2.8, can anybody confirm this should solve our issue here ? We shouldn't use the old metadata anymore ?


Code: Select all
/* Enum BlackmagicRawAnamorphicRatio -  */

typedef [v1_enum] enum _BlackmagicRawAnamorphicRatio {
    blackmagicRawAnamorphicRatioDefault                          = /* 'dflt' */ 0x64666C74,
    blackmagicRawAnamorphicRatioDisabled                         = /* 'dsbl' */ 0x6473626C,
    blackmagicRawAnamorphicRatio133x                             = /* '133x' */ 0x31333378,
    blackmagicRawAnamorphicRatio15x                              = /* '15x_' */ 0x3135785F,
    blackmagicRawAnamorphicRatio166x                             = /* '166x' */ 0x31363678,
    blackmagicRawAnamorphicRatio18x                              = /* '18x_' */ 0x3138785F,
    blackmagicRawAnamorphicRatio2x                               = /* '2x__' */ 0x32785F5F
} BlackmagicRawAnamorphicRatio;

interface IBlackmagicRawClipGeometry : IUnknown
{
    HRESULT GetAnamorphicRatio ([out] BlackmagicRawAnamorphicRatio* anamorphic);
    HRESULT SetAnamorphicRatio ([in] BlackmagicRawAnamorphicRatio anamorphic);
};




taranwaran wrote:Aspect ratio is the ratio for the frame guides


Thanks for the information ! I should try to confirm that with different options in the camera

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostPosted: Fri Nov 18, 2022 10:54 pm
by CaptainHook
The new anamorphic features in Blackmagic RAW 2.8 allow the SDK itself to desqueeze the image. By default it is disabled as applications like Resolve/Premiere handle this automatically already via the existing metadata, but the currently supported desqueeze options the SDK can apply are the ones listed in the enum should an app developer want to make use of it (by using the ratio from metadata or overriding it with a supported ratio from the enum list). It also now enables our finder previews and standalone Blackmagic RAW player to desqueeze clips also.

Also take note of `SetApplyAnamorphicRatioFromMetadata` (and similar getter) - This sets if anamorphic ratio metadata should be applied by the SDK when clips are opened (as mentioned this defaults to false).

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostPosted: Sat Nov 19, 2022 2:52 pm
by antoine
CaptainHook wrote:The new anamorphic features in Blackmagic RAW 2.8 allow the SDK itself to desqueeze the image. By default it is disabled as applications like Resolve/Premiere handle this automatically already via the existing metadata, but the currently supported desqueeze options the SDK can apply are the ones listed in the enum should an app developer want to make use of it (by using the ratio from metadata or overriding it with a supported ratio from the enum list). It also now enables our finder previews and standalone Blackmagic RAW player to desqueeze clips also.

Also take note of `SetApplyAnamorphicRatioFromMetadata` (and similar getter) - This sets if anamorphic ratio metadata should be applied by the SDK when clips are opened (as mentioned this defaults to false).

Thanks for the info, will look into it. Do you know what algorithm is used for desqueezing inside the BRAW SDK and if it's better quality than Adobe's builtin desqueezers ?

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostPosted: Sun Nov 20, 2022 12:08 am
by Chris Hocking
This isn't working for me with the latest SDK:

Code: Select all
IBlackmagicRawClipGeometry* geometry = nullptr;
result = clip->QueryInterface(IID_IBlackmagicRawClipGeometry, (void**)&geometry);


Am I doing something silly?

This works fine on the same clip:

Code: Select all
result = clip->QueryInterface(IID_IBlackmagicRawClipEx, (void**)&clipEx);

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostPosted: Mon Nov 21, 2022 4:21 am
by CaptainHook
Hey Chris,

Good catch. That's a bug and we'll fix it in the next release - there is a way right now though and perhaps more preferable anyway which is to use GetGeometry() / CloneWithGeometry().

Thanks.

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostPosted: Mon Nov 21, 2022 4:29 am
by Chris Hocking
Legend, thanks Hook! Thanks for the fast reply! Good to know I'm not going completely crazy!

I'll have a play with GetGeometry() and CloneWithGeometry(), however I think for my particular use case, I can just get the anamorphic details from the metadata iterator, which seems to work well.

FWIW - It would be really awesome if you could update the SDK PDF which each release too!

Thanks again for all your amazing work with BRAW!

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostPosted: Thu Nov 24, 2022 8:49 am
by Nicolas from Autokroma
Hello,

I have an example clip with Anamorphic Ratio set. I can see it in Metadata : "Anamorphic" : "x2".

Also the BMD plugin in Premiere Pro well report the Anamorphic Metadata to Premiere Pro (indicated inside Interpreted Footage, so the image looks desqueezed then).

If I try to use SetApplyAnamorphicRatioFromMetadata the footage is still squeezed : it does nothing. (Following tests give the same result with this method called before or not).

If I try to use OpenClip, then GetGeometry and GetAnamorphicRatio, the result is : blackmagicRawAnamorphicRatioDisabled

Then If I change this BlackmagicRawAnamorphicRatio and set it to blackmagicRawAnamorphicRatioDefault, then call SetAnamorphicRatio, OpenClipWithGeometry on it and re-call : GetGeometry and GetAnamorphicRatio => The result is still blackmagicRawAnamorphicRatioDisabled (But I asked default !) and of course the image is still displayed squeezed (not desqueezed by the BMD SDK).

At the end, if I do the same thing than before but set to blackmagicRawAnamorphicRatio2x instead of blackmagicRawAnamorphicRatioDefault it works.

Is it the expected behavior ? Maybe it is because the footage has been shot with a firmware too old ? In the Metadata of the footage, Firmware version is 7.9.1

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostPosted: Fri Nov 25, 2022 1:07 am
by CaptainHook
Hi Nicolas,

blackmagicRawAnamorphicRatioDefault should mean "follow the metadata of the file" - is it possible the file you have has metadata with anamorphic_enable set to false?

You could also try create a sidecar for your test clip with something like:
Code: Select all
{
   "anamorphic": "1.33x",
   "anamorphic_enable": 1,
}

We could also consider making blackmagicRawAnamorphicRatioDefault ignore the state of anamorphic_enable in the next release if its too confusing, we will discuss it.