Conditional based on metadata

Questions and answers on how to get the most out of FFAStrans
Post Reply
Conniver
Posts: 36
Joined: Thu Jan 12, 2023 8:32 am

Conditional based on metadata

Post by Conniver »

Is it possible to use a conditional node to check the metadata of the footage?

I'm trying to create a proxy encoding workflow for several types of cameras, which need different settings depending on the cameras way of storing the audio tracks.

Lets take two examples, the Sony Fx6/9 creates 8 tracks of audio stream like this
Audio #1
ID : 3
Format : PCM
Format settings : Little
Format settings, wrapping mode : Frame (AES)
Codec ID : 0D01030102060300-0402020101000000
Duration : 36 s 880 ms
Bit rate mode : Constant
Bit rate : 1 152 kb/s
Channel(s) : 1 channel
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 24 bits
Stream size : 5.06 MiB (1%)
Delay_SDTI : 32042600
Locked : Yes
While the Arri Amira creates 1 steram with 5 channels, like this
Audio
ID : 2
Format : PCM
Format settings : Little / Signed
Codec ID : in24
Duration : 11 s 560 ms
Bit rate mode : Constant
Bit rate : 5 760 kb/s
Channel(s) : 5 channels
Sampling rate : 48.0 kHz
Bit depth : 24 bits
Stream size : 7.94 MiB (2%)
Language : English
Encoded date : UTC 2022-03-25 13:29:09
Tagged date : UTC 2022-03-25 13:29:20
Best option would probably be to make conditionals based of audio channels, but there is some camera identifying metadata as well that could be used.

For the arri this could be used
com.arri.camera.CameraModel : ARRI AMIRA
And for the Sony
CameraAttributes_FirstFrame : PXW-FX9V 4002569 Version3.01
I see MediaInfo is bundled in FFAStrans, but I am unable to find information on how it can be used.
Other suggestions for filtering settings depending on the footage is very welcome.
emcodem
Posts: 1631
Joined: Wed Sep 19, 2018 8:11 am

Re: Conditional based on metadata

Post by emcodem »

Sure, we have mediainfo, exiftool and ffprobe inbuilt for this, the tools are executed automatically internally as soon as you access a related variable, e.g. %s_info_mediainfo%. Additionally there are the "Media properties" Variables you can choose from the variable selector, they contain frequently accessed information for easy access, e.g. audio layout.

"metadata variables":
https://www.ffastrans.com/wiki/doku.php ... es&sf=1&q=

"jsonget":
https://www.ffastrans.com/wiki/doku.php ... []=jsonget

"count":
https://www.ffastrans.com/wiki/doku.php ... _functions

Example quick and dirty check if ARRI AMIRA is contained in the mediainfo probe:
IF $count("%s_info_mediainfo%","ARRI AMIRA") = 1

If you want something more sophisticated, you can use jsonget.

Let me know if this example workflwo is helpful for you:
emcodem, wrapping since 2009 you got the rhyme?
Conniver
Posts: 36
Joined: Thu Jan 12, 2023 8:32 am

Re: Conditional based on metadata

Post by Conniver »

Well, that just works perfectly.
I'm going to test a workflow based on your "jsonget" example.

Thanks for the detailed information.
Post Reply