Page 1 of 1
Importing multiple parts problem from media films
Posted: 2013-04-16 10:25:34
by Teebee
Hello,
Can someone help me? Maybe i'm overlooking things, but when i want to use "Merge info of media in multi parts/disks" i run into a problem.
It works fine for single and 2 part movies, but sometimes i have movies consisting of 3 of 4 parts, and then the total File Size goes negative.
Is there way to fix that, or am i overlooking something ?
Also, when importing this info, is it also possible now to show decimal points ?[/img]
Posted: 2013-04-16 12:39:44
by soulsnake
Hi,
This is crazy, you use Bytes unit to store size of videos...
File size is stored in an Integer (max value = 2^32/2 = 2 147 483 648) so if you have 4 files of 700 MB, this will not work.
Do you really need so precision ?
You should use KB at least, MB is the default unit.
You can change this in preferences > Media files importation > change unit to MB or KB at least.
I give you a little script to convert values in Bytes to Kilobytes on all your existing movies.
Divide by 1024*1024 to convert to Megabytes.
Code: Select all
program ConvertFileSizeBytesToKilobytes;
var
s: string;
i: Integer;
begin
// Get field size
s := GetField(fieldSize);
// Convert size value
i := StrToInt(s, -1);
if i > 0 then
begin
i := Trunc(i / 1024); // to KB
//i := Trunc(i / (1024 * 1024)) // to MB
s := IntToStr(i);
// Set fields
SetField(fieldSize, s);
end;
end.
To use it go to Menu > Tools > Scripting > do not select a script > go to Editor tab > paste the script > execute on all your movies only one time > done

.
Soulsnake.
Posted: 2013-04-17 08:36:09
by Teebee
yeah, thats my problem, i like to be that precise.
When exporting the data filesize in KB doesnt make sense, and in MB it is way to inaccurate for me.
Maybe i can modify the script so it convert the values from KB to Bytes (multiply x1000) to get the correct values, but then in bytes.
Now i need to find out which command to use in the script to add decimal points to the filesize.
Posted: 2013-04-17 13:17:57
by antp
soulsnake wrote:
File size is stored in an Integer (max value = 2^32/2 = 2 147 483 648)
In the database it is a string, so for the value in the list maybe use Int64 like what is done for statistics?
Posted: 2013-04-17 14:33:20
by soulsnake
Hi,
Yes, I will see to use an Int64 in next version

.
The only problem I see is in scripting. You can not use Int64 in scripts so if you have a too big value and you want to convert the unit to a bigger unit, this will not work

.
Soulsnake.
Posted: 2013-04-17 14:53:14
by antp
You could store that in a double rather than an int in scripting, no?
Posted: 2013-04-17 15:54:33
by soulsnake
It seems to work great with a double in scripts

.
I test with a value of 40 Gigabytes in the code bellow and it works.
Code: Select all
program NewScript;
var
d: double;
s: string;
begin
s := '42949672960';
d := StrToFloat(s);
s := FloatToStr(d);
ShowMessage(s + ' Bytes');
d := Round(d / (1024 * 1024 * 1024));
s := FloatToStr(d);
ShowMessage(s + ' Gigabytes');
end.
Soulsnake.
Posted: 2013-04-19 07:33:29
by Teebee
Does this mean that the next version could possibly solve my issue?
Great work nonetheless of the both of you.
Been using amc for a decade now, and so far havent found a replacement yet. And the only reason i've been looking for a replacement is the lack of changing background color
Posted: 2013-04-19 11:27:47
by soulsnake
Does this mean that the next version could possibly solve my issue?
Yes, I already fix this for the next version 4.2.0

.
Soulsnake.