BRAW : Aspect Ratio meaning and Anamorphic footages

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline
User avatar

antoine

  • Posts: 466
  • Joined: Sat Nov 24, 2018 2:20 am
  • Real Name: Antoine Dornstetter

BRAW : Aspect Ratio meaning and Anamorphic footages

PostTue Aug 27, 2019 10:19 am

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!
BRAW Studio FREE and Premium for Adobe Premiere Pro and After Effects
Offline

CaptainHook

Blackmagic Design

  • Posts: 1969
  • Joined: Wed Aug 22, 2012 4:50 am
  • Location: Melbourne, Australia
  • Real Name: Hook

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostThu Aug 29, 2019 3:17 am

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.
**Any post by me prior to Aug 2014 was before i started working for Blackmagic**
Offline
User avatar

antoine

  • Posts: 466
  • Joined: Sat Nov 24, 2018 2:20 am
  • Real Name: Antoine Dornstetter

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostFri Aug 30, 2019 6:07 am

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.) ?
BRAW Studio FREE and Premium for Adobe Premiere Pro and After Effects
Offline
User avatar

antoine

  • Posts: 466
  • Joined: Sat Nov 24, 2018 2:20 am
  • Real Name: Antoine Dornstetter

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostSat Aug 31, 2019 12:17 pm

In Resolve 16.1 Beta 2 :

Addressed an issue where the pixel aspect ratio would not be read correctly from Blackmagic RAW files
BRAW Studio FREE and Premium for Adobe Premiere Pro and After Effects
Offline
User avatar

antoine

  • Posts: 466
  • Joined: Sat Nov 24, 2018 2:20 am
  • Real Name: Antoine Dornstetter

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostFri Oct 25, 2019 12:06 pm

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!
BRAW Studio FREE and Premium for Adobe Premiere Pro and After Effects
Offline
User avatar

antoine

  • Posts: 466
  • Joined: Sat Nov 24, 2018 2:20 am
  • Real Name: Antoine Dornstetter

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostSun Nov 24, 2019 3:07 pm

Any news ?
BRAW Studio FREE and Premium for Adobe Premiere Pro and After Effects
Offline
User avatar

antoine

  • Posts: 466
  • Joined: Sat Nov 24, 2018 2:20 am
  • Real Name: Antoine Dornstetter

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostSat Oct 10, 2020 6:43 am

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
BRAW Studio FREE and Premium for Adobe Premiere Pro and After Effects
Offline
User avatar

antoine

  • Posts: 466
  • Joined: Sat Nov 24, 2018 2:20 am
  • Real Name: Antoine Dornstetter

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostFri Oct 29, 2021 11:37 am

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.
BRAW Studio FREE and Premium for Adobe Premiere Pro and After Effects
Offline

CaptainHook

Blackmagic Design

  • Posts: 1969
  • Joined: Wed Aug 22, 2012 4:50 am
  • Location: Melbourne, Australia
  • Real Name: Hook

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostFri Oct 29, 2021 7:58 pm

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.
**Any post by me prior to Aug 2014 was before i started working for Blackmagic**
Offline

taranwaran

  • Posts: 1
  • Joined: Thu Nov 04, 2021 9:50 am
  • Real Name: kamaran salih

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostThu Nov 04, 2021 9:52 am

Aspect ratio is the ratio for the frame guides
www.soran.edu.iq
Offline
User avatar

antoine

  • Posts: 466
  • Joined: Sat Nov 24, 2018 2:20 am
  • Real Name: Antoine Dornstetter

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostFri Nov 18, 2022 4:12 pm

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
BRAW Studio FREE and Premium for Adobe Premiere Pro and After Effects
Offline

CaptainHook

Blackmagic Design

  • Posts: 1969
  • Joined: Wed Aug 22, 2012 4:50 am
  • Location: Melbourne, Australia
  • Real Name: Hook

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostFri Nov 18, 2022 10:54 pm

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).
**Any post by me prior to Aug 2014 was before i started working for Blackmagic**
Offline
User avatar

antoine

  • Posts: 466
  • Joined: Sat Nov 24, 2018 2:20 am
  • Real Name: Antoine Dornstetter

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostSat Nov 19, 2022 2:52 pm

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 ?
BRAW Studio FREE and Premium for Adobe Premiere Pro and After Effects
Offline
User avatar

Chris Hocking

  • Posts: 682
  • Joined: Wed Aug 22, 2012 4:23 am
  • Location: Melbourne, Australia

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostSun Nov 20, 2022 12:08 am

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);
Offline

CaptainHook

Blackmagic Design

  • Posts: 1969
  • Joined: Wed Aug 22, 2012 4:50 am
  • Location: Melbourne, Australia
  • Real Name: Hook

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostMon Nov 21, 2022 4:21 am

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.
**Any post by me prior to Aug 2014 was before i started working for Blackmagic**
Offline
User avatar

Chris Hocking

  • Posts: 682
  • Joined: Wed Aug 22, 2012 4:23 am
  • Location: Melbourne, Australia

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostMon Nov 21, 2022 4:29 am

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!
Offline
User avatar

Nicolas from Autokroma

  • Posts: 15
  • Joined: Thu Oct 10, 2019 9:47 pm
  • Real Name: Nicolas Favre

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostThu Nov 24, 2022 8:49 am

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
Autokroma BRAW Studio - FREE plugin for Premiere, After Effect & Media Encoder
Offline

CaptainHook

Blackmagic Design

  • Posts: 1969
  • Joined: Wed Aug 22, 2012 4:50 am
  • Location: Melbourne, Australia
  • Real Name: Hook

Re: BRAW : Aspect Ratio meaning and Anamorphic footages

PostFri Nov 25, 2022 1:07 am

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.
**Any post by me prior to Aug 2014 was before i started working for Blackmagic**

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 9 guests