Is there a database anywhere that counts how many unique frames an episode has?

Is there a database anywhere that counts how many unique frames an episode has?

Just use ffmpeg, retard.

Rude

that's not the way because it won't be accurate
Multiple identical frames can look different in digital format due to artifacts etc

I'm sure you could so a fuzzy match by comparing the frames with some error tolerance. This would break on visual effects applied as preprocessing steps though. It might be good enough if you want pre 2000s anime only.

How do you feel about pans over a single image, is that more than 1 frame or no? I figure you are trying to extract the number of drawn images in the episode so that probably wouldn't count. If you wanted to be really robust to this stuff, I would generate a small labeled training set to handle visual effects, then bootstrap that into a larger set by including translations and rotations of the original images. I would train an SVM on these images to label them as same or different. With the trained model you just run a sliding window of 2 frames over the input video and find all the image changes.

The problem is that new video frames and new animation frames are completely different concept.

Imagine an animation where character 1 walks toward the camera over a gradually zooming background with a 6-frame walk cycle, then is joined by character 2 with an 8-frame. Then it zooms in on their faces.
We can easily count how many animation frames there are: 14, and can PROBABLY count how many drawings there are: 15 or 16, depending on background detail, but a sufficiently complex background may be anbiguous. (We can also count how many shots in photography there would be, but that's an obsolete measure in digital where rehanging character 1 frame 1 with character 2 frame 1 every 36 frames can just be automatically recomposited rather than pulled back out of the stack to save film and effort.)
But if we try to do it programmatically...

Previous-next compares are obviously out. They'll tick up 6 "new frames" per second for character 1.

So store an entire screen state and compare?
Because their walking cycles are out of sync, while it works at first, on the 9th animation frame you get:
1,2,3,4,5,6,1,2,3 :C1
1,2,3,4,5,6,7,8,1 :C2
1,1,1,1,1,1,1,1,0 :New animation
1,1,1,1,1,1,1,1,1 :New screen state
So it's obviously wrong. You need to isolate each element on screen as foreground or background.

But you can't even rely on static/slowpan as background, because you'll have situations where the face zoom is first. So in essence, you need to find every single graphical element in an episode and compare it to every other graphical element at a wide range of zoom sizes. Then you have to do this for the entire show because bank footage is still a thing that exists. And then you have to pare out the VFX, with plenty of false positives if you only use outline and plenty of false negatives if you involve have luminance or chroma.

Essentially, completely reverse engineering it was only a reasonable ask back in the old days when it was plausible to simply pick every single cel out of the studio's dumpster, place them in a stack, and count them.

If you get very lucky there may be rough planned counts noted in places like storyboards, or lineart may be labeled "frame x of y" rather than just "frame x", But for that latter one you'd still need to find absolutely all the lineart.

Uh you're right that it's not simple for viewers to count how many unique frames are in an anime video file but picking cel's out of a studio's dumpster is the opposite of reverse engineering.

Export every frame, put them into some folder, run a duplicate image finder and get rid of anything with 95% or higher similarity. Count the number of files left. I'm sure there's a command line tool for this somewhere

Maybe an illustration would help you understand the problem with that.

It's the quickest way to approximate and get a decent result. What do you even need an exact count for?

DId you even read my post. I said you would train an SVM to classify "is-same" of two images. The training data would include translations, and rotations of the original image. You could also throw in skews and zooms. By running the classifier over pair-wise video frames, you would find that any gradual transition, like zoom or pan, would still yield a True; however, an actual new frame would not. Do you actually care to deduplicate walking cycle frames? What is your actual goal?

The problem with your logic is that the "original" image is itself a composite. And while the uses of knowing how many pre-composited images existed are very limited to practical training for animators or budget estimation, there are no uses to knowing how many post-composited unique images exist now that we've moved away from physical photography.

You didn't answer my question though: what is the actual goal? The number of unique images drawn?

I don't know what OP's goal is, but yes, that's the only definition of "how many frames" that has any use.
That's why it's significantly more complicated than just finding unique video frames, because each video frame is composed of zero to several dozen (massive outlier) drawings which may or may not be contiguous, are often heavily filtered, and can step through several magnitudes of zoom or complete replacement panning.

I understand the distinction between video frames and drawings. I guess you would need to figure out what entities are actually independently animated which seems hard in the general case.

With enough processing power and training something couple probably at least nail down the number of independently updating objects x the number of unique updates each one showed, but it'd never be guaranteed.

And at the end of the day, while it's the only not-completely-useless definition of the question, it's still pretty useless across episodes. From a budgetary perspective, after considering scrapped drawings that appear zero times and variances in pay rate, a perfect count will land you within half-or-double, which is around the accuracy of just guessing by what time of day something airs.
And in terms of studying HOW to make something look good with fewer drawings, and becoming a more efficient animator, you're already subconsciously framecounting while watching anyway; programmatic isolation of cheap scenes will just give you a wasteland of still monologues to pick through, while you can tell "expensive" vs. "clever" in the first second or two by eye and then you have to pick it apart manually anyway.

I'm mainly just in thread to keep OP or FP from starting a thread tomorrow crowing that a framedump+dedupe of their favorite show left 12k pngs and therefore it's obviously better animated than Ghibli.

No. A quick glance of how animation works (specially limited animation) will tell that it is not only insanely hard work (or essentially imposible for a computer to discern in a right method) to do so, it is also completely irrelevant to anything. For example, let's check an example: we have character A doing a walk cycle a 3s while the BG is going around at 2s. If the production's nearly competent, the timing will be placed so that the character's movement would fit when the background is not moving and the BG's movement would fit when the character is not, effectively making different frames out of nothing for the whole shot not to be jerky shit. And this is not counting reused character animations in different backgrounds (which could ALSO be reused from somewhere before, having a huge database of filler movements/effects is ESSENTIAL to anime's profitability), which would also serve a new frame when counted mechanically.

A far more interesting question is how many unique character animations/FX or backgrounds are used or repeated from episode to episode, which would be even harder and this because it involves having the babilonic memory to discern among thousands of cuts every single episode. And this work could be done translating or remastering.

> not counting them on your fingers as you watch it
Lazy faggot

brb doing just that

I'd like to break apart two things you're talking about, though.
On the one hand you have bank footage, which is essential to budgeting but which quickly becomes obvious.

But on the other hand, the rest of the reuse cases you're talking about tend to be hoarded references or practiced styles that individual animators can draw rapidly and tend to apply project after project. These are important to projects, but apart from edge cases like Gundam SEED which had an extremely unusual focus on preserving and sharing materials internally (which was why it's still the only digital-SD series with a true HD remaster) these improve quality at the same price rather than improving price at the same quality.

The animator memorizes his take on an uppercut or swallow of tea or missile spiral so than he can crank out thirty frames of it in a day rather than twenty and earn enough extra to cover smokes for the week, and takes it from sub-sub-contract to sub-sub-contract. The initially contracting studio, or even the episode subcontractor, doesn't usually formally maintain a set thereof to trace and speed work up (and speeding work up would cost rather than save them money, because almost all pay is piecework!), especially because they rarely maintain copyright to anything they do.

I was exclusively talking about bank footage, since it's what would count as something being nearly "the same frame". Your comment on stylistic shortcuts wouldn't really matter since it's not "exactly" the same frame in any case (same could be said about things like tracing), but it is a particularly concise take on the phenomenon and how it relates to the industry's economics. You should keep it in store, since most around genuinely don't know.

The thing is, are you applying it to layout artists (who are the ones that compose the shot and so on), key animators (there is huge overlap between those for budget reasons), both of which are usually contracted, or in-betweeners, that are the usually subcontracted? Differenciation is key.