# Detect used filter?

1. Hi all,
I have video A (Source), and i encode A to B (Output) with avs, example
FFVideoSource(''A'')
Levels(16, 1, 235, 0, 255, coring=true)
So is there any solution can detect which filter was used to encode B from A? (in that case it's Levels (16,1,235,0,255,coring=true))
Thank you so much.
2. No. I added a bunch of numbers with a calculator. The result was 73. Can you tell what calculator I used?
3. @jagabo: thank you for reply. And i've got it.
But if i use only Levels(a, b, c, d , e), any chance to find out what is a, b, c, d, e?
4. You can't really tell what the values were. But given that Levels() works with integers you can get some hints by looking at a waveform monitor or histogram. For example, narrow gaps in the histogram may imply the range a-c was expanded to d-e, and narrow peaks may imply the opposite. From the distance between the peaks and gaps you can calculate by how much. Stacking at the ends of the histogram may give some hints too. Other filters may result in the same kinds of features, for example ColorYUV(). Filters run after Levels() may erase all that information. And, of course, some of those features may have been in the source.
5. Oh, I just realized asked this question in a context where you still have the source video. In that case it may be much easier to determine what values where used in the Levels() filter, especially if you didn't change the gamma. The range of values in the source and filtered video tell you how much a-c was scaled to produce d-e.
6. Originally Posted by jagabo
The range of values in the source and filtered video tell you how much a-c was scaled to produce d-e.
How can i get range of values in the source and filtered video?
7. In avisynth you can use histogram(), videoscope() , coloryuv(analyze=true)

But it's not possible to determine what happened to "B" accurately in your case with all videos, because coring=false. This means all values >235 after the levels application will become =235. All values <16 will become =16 . Only in the case where "A" started with Y' values 16-235

You can still determine it by trial and error if you have both A and B, by examining the waveform

Statistics