I would like to make a custom field with the aspect ratio of the movies, Frame width/Frame height. AMC gives you the resolution but I don't know the functions to get the width and the height separately. Some movies has a very bad ratio and I would like to know it, to be able to correct it.
This is not a question of AMC, but maybe someone can help me. Does anyone know how can I change the details information of a file?. I found out that sometimes the information of the frame size is not correct, but I don´t know how can I change it. Thank you.
Aspect ratio
-
antp
- Site Admin
- Posts: 9902
- Joined: 2002-05-30 10:13:07
- Location: Brussels
Hi,
Such field can be filled by script :
program NewScript;
uses StringUtils1;
var
s : string;
w, h: Integer;
begin
s := GetField(fieldResolution);
w := StrToInt(TextBefore(s, 'x', ''), 1);
h := StrToInt(TextAfter(s, 'x'), 1);
SetCustomField('Ratio', FloatToStr( w / h));
end.
assuming here that the custom Ratio fiend is a text field with a tag = 'Ratio'.
You could also set a float field with a fixed number of decimal, in such case you can remove the 'FloatToStr' function call.
Such field can be filled by script :
program NewScript;
uses StringUtils1;
var
s : string;
w, h: Integer;
begin
s := GetField(fieldResolution);
w := StrToInt(TextBefore(s, 'x', ''), 1);
h := StrToInt(TextAfter(s, 'x'), 1);
SetCustomField('Ratio', FloatToStr( w / h));
end.
assuming here that the custom Ratio fiend is a text field with a tag = 'Ratio'.
You could also set a float field with a fixed number of decimal, in such case you can remove the 'FloatToStr' function call.
-
al0203
- Posts: 72
- Joined: 2013-02-27 05:24:17
Thank you.antp wrote:Hi,
Such field can be filled by script :
program NewScript;
uses StringUtils1;
var
s : string;
w, h: Integer;
begin
s := GetField(fieldResolution);
w := StrToInt(TextBefore(s, 'x', ''), 1);
h := StrToInt(TextAfter(s, 'x'), 1);
SetCustomField('Ratio', FloatToStr( w / h));
end.
assuming here that the custom Ratio fiend is a text field with a tag = 'Ratio'.
You could also set a float field with a fixed number of decimal, in such case you can remove the 'FloatToStr' function call.
Another small question, where can I find the catalog of all the functions like the exponencial? Sqrt works but I don't know how to put a power like 5^3.
-
antp
- Site Admin
- Posts: 9902
- Joined: 2002-05-30 10:13:07
- Location: Brussels
-
al0203
- Posts: 72
- Joined: 2013-02-27 05:24:17
-
antp
- Site Admin
- Posts: 9902
- Joined: 2002-05-30 10:13:07
- Location: Brussels