Auto-Generate Episode lengths [tracked]

old granted and denied feature requests

Moderator: AniDB

Locked
Skywalka
Posts: 889
Joined: Tue Sep 16, 2003 7:57 pm

Auto-Generate Episode lengths [tracked]

Post by Skywalka »

Hi there,

I'd like to have AniDB derive the episode lengths from the new "file length" entry you added today.

I'd love to see how long an episode is everywhere and even I was to lazy to add all those episode lengths back last year :)

If the file is more than 10% longer than a certain percentage of all files then the file most likely is a double episode and that could be another indicator for the future or whatever :-)
Build yourself a nice algorithm... maybe if 80% of all the files are withing a 1 or 2 minute range caluclate the average of those 80% of files and use that as the episode length...

Hmm... what would be a nice algorithm? Take file length of ep 1 and substract the length of file 2. Put in array[0]. Substract length 3 from length 2 and put in array[1] ... upto n files. once done go through array and take every value from -1 ot 1 (minutes) and add them all up to $lengths while $i++ for every file within -1 to 1. $eplength = $lengths devided by $i

Or something like that.

1st run: do it for all episodes and put all EP IDs with lengths +/- more than 2 minutes into a file to check later (sorta creqs).
daily run: only for episodes that have a length of 0 or over 150 (which is close to impossible, no movie is that long.

Just a thought :)
rowaasr13
Posts: 415
Joined: Sat Sep 27, 2003 4:57 am

Post by rowaasr13 »

Not possible, IMHO, because compression and container overheads do not allow you to compute ep. length from it's files size. 40Mb file could be anything from 1min to 20mins.
wahaha
AniDB Staff
Posts: 1497
Joined: Sun Nov 17, 2002 3:33 pm

Post by wahaha »

rowaasr13 wrote:Not possible, IMHO, because compression and container overheads do not allow you to compute ep.
True, but Skywalka is talking about the per-file entry for the length exp recently added (- which now luckily takes the exact time, and not just rounded to full minutes ^^)
AniDb Changes; Posted: Tue Oct 19, 2004 wrote:- added new "length" data value for files (aom 0.6 will auto creq those)
And as always: Approx Len instead of just Len - a thread in which something similar has been suggested already *eg*

EDIT:
Since I'm being evil already, let's take a look at
Skywalka wrote:Hmm... what would be a nice algorithm? Take file length of ep 1 and substract the length of file 2. Put in array[0]. Substract length 3 from length 2 and put in array[1] ... upto n files. once done go through array and take every value from -1 ot 1 (minutes) and add them all up to $lengths while $i++ for every file within -1 to 1. $eplength = $lengths devided by $i
Let's say l(i) is the length of episode i (in seconds) and we have a total of n episodes. Your first step means to calculate some d(i)=l(i) - l(i+1) with i in 1,...,n-1. Then, the total is calculated as (sum from 1 to n-1 of d(i)) / n.
With d(i) = l(i) - l(i+1), we get: (sum from 1 to n-1 of (l(i) - l(i+1))) / n.
Explicitly: ((l(1) - l(2)) + (l(2) - l(3) + ... + (l(n-1) - l(n))) / n
Which is the same as: (l(1) - l(n)) / n.
... which won't work :P
exp
Site Admin
Posts: 2438
Joined: Tue Oct 01, 2002 9:42 pm
Location: Nowhere

Post by exp »

we can think about this once at least 70% of the files in anidb have lengths added.
and my guess would be that this will take quite some time.

BYe!
EXP
Locked