[Cin] DAR, PAR and SAR, again

Andrea paz gamberucci.andrea at gmail.com
Sun Jan 21 11:13:34 CET 2024


I propose two variations to the manual. I also attach the relative
text if anyone feels like reviewing it.

@Phyllis
The part about "Aspect ratio (Theory)" I can't reduce it any more than
that. You choose whether to use all of it or remove the part of the
Super 35 mm example (from "For example to obtain an aspect ratio of
Super 35 mmm (2.35)..." to "...1080 - 816 = 264 lines of pixels from
top and bottom") Or finally, do not update this section. (You will
have to redo the corrections you had already made...).

@Terje
For the part on anamorphic video, I have reached an impasse: on some
definitions of PAR, SAR and DAR but, most importantly, on how CinGG
works. I will see if I can elaborate further, but for now I do not
propose an addition to the manual.

@Andrew
Thanks for the explanations about the code. One question: if all the
code with sar that I found was added by you, then where do I see how
ffmpeg works with the aspect ratio?
-------------- next part --------------
W/H Ratio [Chapter 3.2]


[W/H Ratio] Sets the ratio of the new canvas size (Width, Height) from the old (previous) canvas size (Width, Height).

W Ratio = Wf/Wi and H Ratio = Hf/Hi

with Wf/Hf: final Width and Height; Wi/Hi: initial Width and Height.

The new canvas size is recalculated based upon a certain factor in the W Ratio, H Ratio fields. A practical use-case: the current resolution is 640 x 480, and for some reason you want Width to be 1.33 times bigger. You don't have to calculate what 640 x 1.33 is; you type 1.33 into the Width input instead, and CinGG calculates it for you. W/H Ratio work as local calculator. Warning: if you vary W/H Ratio without adjusting Display aspect ratio, we may get non-square pixels resulting in anamorphic frame distortion.





Aspect ratio (Theory) [Chapter 2.2.4]

The aspect ratio is the ratio of the sides of the frame (Width and Height). For example, classically broadcast TV was 4:3 (= 1.33), whereas today it has changed to 16:9 (= 1.78); in cinema we use the 35 mm aspect ratio of 1.375 (Academy aperture), academy flat (1.85 or widescreen) but even more so the super 35 mm (from 1.33 to 2.39). There are also anamorphic formats, i.e. that have no square pixels, like Cinemascope (2.39). The projection must be normalized to have an undistorted view.

From the film or digital sensors of the cameras, we can extract any frame size we want. We are talking about \textit{viewports}, which we will examine shortly. Also important is the output of the video that will be rendered, because it is what we will see at the cinema, or on TV, or on the monitor of the PC, tablet or smartphone. Referring to figure 2.12, you can see these two possibilities: with the Camera tool you choose the size and aspect ratio of the source file (regardless of the original size); while with the Projector tool you choose the size and aspect ratio of the output. Other ways of changing the aspect ratio of assets or tracks we have seen previously (Resize track; Match Output Size; Resize assett). A method of changing the size of the entire project (canvas) is via the Set Format window. The following formula is used to vary the aspect ratio:

W/H = frame aspect ratio (pixels/pixels)

For example to obtain an aspect ratio of Super 35 mmm (2.35) starting from a FullHD file (1920x1080) whose base extension (1920) we want to keep:

1920/H = 2.35

from which: H = 816 pixels

At the same time as changing the Height parameter we also need to set Display Aspect ratio to 2.35. In fact, the parameters in Canvas Size are not related to those in Display Aspect ratio, unless we keep the Auto option checked, and we need to set both before we act on Apply button. To set the aspect ratio to 2.35:1 we can choose from the drop-down menu the value 2.35 or set the value directly in the two input fields. Or again, it can be done automatically via the Auto option. Finally we can act on the Apply button to complete the calculations. Now we have arrived at the desired result: typical Super 35 mm dimensions and aspect ratio, although starting from a 16:9 FullHD. The new canvas, however, lost the pixels of a part of the initial video (crop), to be precise 1080 - 816 = 264 lines of pixels from top and bottom.

CinGG allows you to vary the input and output aspect ratio in the ways indicated in the previous section: by varying the pixels of the sides (Width/Height) or by setting a multiplication coefficient (W/H Ratio; in this example: placing H Ratio = 816 : 1080 = 0.7556) which performs the calculation automatically. If you set W Ratio and H Ratio at the same time with the same values, they work as multipliers and you get a resizing of the canvas, without altering the initial aspect ratio. If you change them to two different values or change only one of the two parameters, leaving the other at 1, you get an anamorphic video, with the pixels no longer being square (1:1) but becoming rectangular, deforming the image. To avoid anamorphosis, the Display Aspect ratio must also be adjusted at the same time, for example, with the Auto option. Anamorphic format is a complex field that is discussed in the Raffaella Traniello's guide: http://www.g-raffa.eu/Cinelerra/HOWTO/anamorphic.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aspect_ratio.tar.gz
Type: application/gzip
Size: 115156 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20240121/dc9c47bd/attachment-0001.bin>


More information about the Cin mailing list