"Format value" calculation question

I am trying to create a calculation but cannot seem to figure it out and would welcome any advice...

My intent is to create an action that automatically multiplies the height and width of a video and then populates the result into a custom %Pixels% metatag.

Here is what I have done so far:

  1. Created a new Column, %Pixels%
  2. Convert > Actions
  3. New Action Group named Calculate Pixels.
  4. New Action in that group, "Format value"
  5. For "Field:", I defined %Pixels%.
  6. For "Format string:", I defined $mul(%_video_width%,%_video_height%) based on the values documentation found here: Format Strings and Placeholders – Mp3tag Documentation

However, when I saved and ran the custom action, nothing appeared within the %Pixels% column.
Any ideas what I am doing wrong?

What I expected:
1920x1080=2073600

It should be plain PIXELS.
Check the extended tags dialogue Alt-T whether you have a field called %PIXELS% (and not as expected PIXELS)

Is it really necessary to save this information in a tag field or would you need it just for the display?
The you could enter as "Value" for the column definition what you have used in the action:

Thanks @ohrenkino - Changing the Field name fixed it!
Regarding your question as to whether it is really necessary to save this information in a tag field, my ultimate goal is to leverage the "Pixel" values to automatically calculate the resolution of the video file within MP3Tag using an If/Then function that leverages the logic below. Please let me know if you have any suggestions on how to do this better or cleaner?

If PIXELS =1757184 AND "%_video_height%" equals 858, then populate RESOLUTION with 2K DCI CinemaScope
If PIXELS = 2073600 AND "%_video_height%" equals 1080, then populate RESOLUTION with Full HD
If PIXELS = 2157840 AND "%_video_height%" equals 1080, then populate RESOLUTION with 2K DCI Flat
If PIXELS = 2211840 AND "%_video_height%" equals 1080, then populate RESOLUTION with 2K DCI Native
If PIXELS = 2304000 AND "%_video_height%" equals 1200, then populate RESOLUTION with WUXGA
If PIXELS = 2359296 AND "%_video_height%" equals 1152, then populate RESOLUTION with QWXGA
If PIXELS = 3145728 AND "%_video_height%" equals 1536, then populate RESOLUTION with QXGA
If PIXELS = 4147200 AND "%_video_height%" equals 1080, then populate RESOLUTION with 4K
If PIXELS = 6144000 AND "%_video_height%" equals 1600, then populate RESOLUTION with 4K
If PIXELS = 7028736 AND "%_video_height%" equals 1716, then populate RESOLUTION with 4K DCI CinemaScope
If PIXELS = 7372800 AND "%_video_height%" equals 1440, then populate RESOLUTION with 5K
If PIXELS = 8294400 AND "%_video_height%" equals 2160, then populate RESOLUTION with 4K UHD
If PIXELS = 8294400 AND "%_video_height%" equals 3840, then populate RESOLUTION with 4K
If PIXELS = 8631360 AND "%_video_height%" equals 2160, then populate RESOLUTION with 4K DCI Flat
If PIXELS = 8847360 AND "%_video_height%" equals 2160, then populate RESOLUTION with 4K DCI Full Frame
If PIXELS = 9216000 AND "%_video_height%" equals 2400, then populate RESOLUTION with WQUXGA

I would suggest an action of the type "Format value" for RESOLUTION and
Format string: $replace($mul(%_video_width%,%_video_height%),9216000,WQUXGA,8847360,4K DCI Full Frame)
and so on for each of the pixel values.
No need to save an implicid information twice.

2 Likes

Brilliant, and thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.