Importing multiple parts problem from media films

If you need help on how to use the program
Post Reply
Teebee
Posts: 111
Joined: 2005-06-04 10:46:56

Importing multiple parts problem from media films

Post 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 ?


Image



Also, when importing this info, is it also possible now to show decimal points ?[/img]
soulsnake
Posts: 756
Joined: 2011-03-14 15:42:20
Location: France

Post 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.
Teebee
Posts: 111
Joined: 2005-06-04 10:46:56

Post 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.
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post 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?
soulsnake
Posts: 756
Joined: 2011-03-14 15:42:20
Location: France

Post 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.
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

You could store that in a double rather than an int in scripting, no?
soulsnake
Posts: 756
Joined: 2011-03-14 15:42:20
Location: France

Post 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.
Teebee
Posts: 111
Joined: 2005-06-04 10:46:56

Post by Teebee »

Does this mean that the next version could possibly solve my issue?

Great work nonetheless of the both of you. :clapping:

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
soulsnake
Posts: 756
Joined: 2011-03-14 15:42:20
Location: France

Post 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.
Post Reply