TeamB 2386 Posted November 27, 2020 Posted November 27, 2020 The best way to check it would be to do an A B comparison between the output from both the python and the c# @samuelqwe are you able to supply some sample input and output data so @chef can do a direct compare 1
samuelqwe 316 Posted November 27, 2020 Posted November 27, 2020 (edited) 15 minutes ago, TeamB said: The best way to check it would be to do an A B comparison between the output from both the python and the c# @samuelqwe are you able to supply some sample input and output data so @chef can do a direct compare I can, what exactly do you need @chef? Just the fingerprints or the video/audio samples? Also, I am in the process of testing some more and I’ve noticed there are occasionally a few small issues in the findContiguousRegion function that can accidentally extend the intro end time stamp if a few bits fall below the threshold later in the audio comparison, but it should be possible to fix. Edited November 27, 2020 by samuelqwe
chef 3788 Posted November 27, 2020 Posted November 27, 2020 (edited) 13 minutes ago, samuelqwe said: I can, what exactly do you need @chef? Just the fingerprints or the video/audio samples? (Im stuck at work until tonight...) But I think once I make the appropriate code changes you guy mentioned, I should be able to test both code bases, test the results and make sure both are similar. I do have a python ide installed so I have the command prompt. If this works... It's going to be amazing. Edited November 27, 2020 by chef 1
chef 3788 Posted November 28, 2020 Posted November 28, 2020 (edited) Hmm... everything works up until it tries to get the best offset. The error might actually trace to the "compareFingerprint" function. Edited November 28, 2020 by chef
samuelqwe 316 Posted November 28, 2020 Posted November 28, 2020 (edited) 1 hour ago, chef said: Hmm... everything works up until it tries to get the best offset. The error might actually trace to the "compareFingerprint" function. In compareFingerprint, the score variable is supposed to be a float, because it’s supposed to give a value between 0 and 1. Maybe that’s where the issue is, as it tries casting a float to an int? EDIT: Along with what I said above, I think figured out the issue. It seems getRange takes two arguments, index and count. But in Python it would be index1 and index2. So in both of the getRanges, the second argument should just be upper Alternatively, I think you could do something like f1[a..a+upper] based on what I saw online Edited November 28, 2020 by samuelqwe 1
chef 3788 Posted November 28, 2020 Posted November 28, 2020 (edited) 45 minutes ago, samuelqwe said: In compareFingerprint, the score variable is supposed to be a float, because it’s supposed to give a value between 0 and 1. Maybe that’s where the issue is, as it tries casting a float to an int? EDIT: Along with what I said above, I think figured out the issue. It seems getRange takes two arguments, index and count. But in Python it would be index1 and index2. So in both of the getRanges, the second argument should just be upper Alternatively, I think you could do something like f1[a..a+upper] based on what I saw online Ah right, the total count of the Range... Thank you. Edited November 28, 2020 by chef
samuelqwe 316 Posted November 28, 2020 Posted November 28, 2020 35 minutes ago, chef said: So close.. Does that mean fprint1 somehow gets emptied? Because you should at least have a float for seconds per sample
chef 3788 Posted November 28, 2020 Posted November 28, 2020 1 hour ago, samuelqwe said: Does that mean fprint1 somehow gets emptied? Because you should at least have a float for seconds per sample Yes, I found it! you are right. It took a moment to follow the data, but the "secondsPerSample" wasn't calculating properly when dividing 300/ fprint1. 1
samuelqwe 316 Posted November 28, 2020 Posted November 28, 2020 18 minutes ago, chef said: Sorry, that it isn't quick... There is quite a bit to grasp. Following the data... after the fingerprints are parsed, it moves into the "getBestOffset" function. Here the index return 0. But, perhaps it should be the length of the output array? I also notice that "y" is equal to 2401, which maybe incorrect. I think I need brackets "(length/2)-1" There's a lot to wrap your head around, I totally get it. It's pretty complex stuff. So at the beginning, both diff and y should start with the same values, something like 1200 I think. If it's following the order of operations you shouldn't need the parentheses, but it may be wise to add them just in case. The index variable should return the position of the largest element in the output list. Check those two things and let me know if anything changes.
chef 3788 Posted November 28, 2020 Posted November 28, 2020 Does "getBestOffset" return a whole number or a float?
samuelqwe 316 Posted November 28, 2020 Posted November 28, 2020 (edited) 20 minutes ago, chef said: Does "getBestOffset" return a whole number or a float? It should be a whole number. You might also want to print the values for a, b, x and output[i] after every iteration of the for loop to see if the values do slide accordingly. Edited November 28, 2020 by samuelqwe 1
crusher11 897 Posted November 28, 2020 Posted November 28, 2020 Psych also includes one-off themed variations of its opening sequence, which would obviously wreak havoc with this method.
chef 3788 Posted November 28, 2020 Posted November 28, 2020 5 hours ago, crusher11 said: Psych also includes one-off themed variations of its opening sequence, which would obviously wreak havoc with this method. Do they recap prior episodes in that show?
chef 3788 Posted November 28, 2020 Posted November 28, 2020 (edited) Wow, finally. Sorry it took so long. That was some serious science stuff... LOL. I just have to test these numbers against the python to make sure I science'd it properly. But at first glance the data looks legit. C# is really stingy about using doubles, floats and decimals properly. Edited November 28, 2020 by chef
crusher11 897 Posted November 28, 2020 Posted November 28, 2020 1 hour ago, chef said: Do they recap prior episodes in that show? Rarely. Why?
chef 3788 Posted November 28, 2020 Posted November 28, 2020 1 hour ago, crusher11 said: Rarely. Why? Just was wondering if we could use the blackdetect and silence detect as an option when the fingerprinting doesn't find a match for intros.
chef 3788 Posted November 28, 2020 Posted November 28, 2020 (edited) It works! @samuelqwe well done! @TeamB @PenkethBoy Edited November 28, 2020 by chef 3
chef 3788 Posted November 28, 2020 Posted November 28, 2020 Here it is working again, I'll try it on another series next: 5
chef 3788 Posted November 28, 2020 Posted November 28, 2020 @crusher11 I'm just waiting to test the series you mentioned above. I should be able to see what happens today.
chef 3788 Posted November 28, 2020 Posted November 28, 2020 Oh, Game of Thrones is a bit tricky. Because the episodes have an HBO screen at the very beginning, I think it causes some issues with finger print alignment. I encoded 10minutes of audio and fpcalc because the intro doesn't actually start until 7-7.5 minutes into an episode.
samuelqwe 316 Posted November 28, 2020 Posted November 28, 2020 2 minutes ago, chef said: Oh, Game of Thrones is a bit tricky. Because the episodes have an HBO screen at the very beginning, I think it causes some issues with finger print alignment. I encoded 10minutes of audio and fpcalc because the intro doesn't actually start until 7-7.5 minutes into an episode. I suppose that if there are multiple regions with similar audio it might confuse the script and not know which one to pick, but I haven’t tested GoT. In terms of the length of audio to analyze, I think picking a longer segment for shows with longer episodes could be a good idea, and we could also pick a shorter time for those with shorter episodes. I’d be interested to see how the script reacts with GoT and other shows and that could have potentially tricky intro situations.
chef 3788 Posted November 28, 2020 Posted November 28, 2020 (edited) 11 minutes ago, samuelqwe said: I suppose that if there are multiple regions with similar audio it might confuse the script and not know which one to pick, but I haven’t tested GoT. In terms of the length of audio to analyze, I think picking a longer segment for shows with longer episodes could be a good idea, and we could also pick a shorter time for those with shorter episodes. I’d be interested to see how the script reacts with GoT and other shows and that could have potentially tricky intro situations. I was able to get a perfect match after switching a couple episodes. 4 seconds later the episode starts. It's right on. When ever Disney+, Netflix does this they will minus a couple seconds from the "End" so you can see the series logo and stuff which usually ends the intro. So if we minus 2 seconds from the "commonRegionEnd" it would be a cool feature. I can see that if there is an issue aligning finger prints the "commonRegions" will be a negative number. Perhaps there is a way to catch a mis-aligned finger print prior to the completed task. This way, there can be another attempt to align the episode. Edited November 28, 2020 by chef
samuelqwe 316 Posted November 28, 2020 Posted November 28, 2020 4 minutes ago, chef said: I was able to get a perfect match after switching a couple episodes. 4 seconds later the episode starts. It's right on. When ever Disney+, Netflix does this they will minus a couple seconds from the "End" so you can see the series logo and stuff which usually ends the intro. So if we minus 2 seconds from the "commonRegionEnd" it would be a cool feature. I can see that if there is an issue aligning finger prints the "commonRegions" will be a negative number. Perhaps there is a way to catch a mis-aligned finger print prior to the completed task. This way, there can be another attempt to align the episode. If it can’t find a suitable region it’ll return -1 -1, and if it returns a region which is too short (I put it at 10 seconds for now) it’ll also get rejected at the end. As far as taking off a few seconds to show the end of the intro, I was thinking the same, but I think that should be up to whatever is actually doing the skipping to skip to a few seconds before the end of the intro region. This way we can leave the intro region as it is. 1
Recommended Posts