Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fingerprint result with force fpcalc is other than with default settings #68

Open
garlontas opened this issue Oct 14, 2021 · 3 comments

Comments

@garlontas
Copy link

garlontas commented Oct 14, 2021

Hello!
I'm developing an application using your library and I had the problem that I didn't get any result with the default fingerprinting. (acoustid.match(self.__API_KEY, self.__file)) 😞
Then I used acoustid.match(self.__API_KEY, self.__file, force_fpcalc=True) and I received the data I needed. 👍
Maybe you could take a look at this problem.
A possible solution would be setting fpcalc as the default finger printer.

PS: It also occurs using your aidmatch.py script

@sampsyo
Copy link
Member

sampsyo commented Oct 14, 2021

Is there a way you can describe to reproduce the problem?

@garlontas
Copy link
Author

garlontas commented Oct 14, 2021

So first I had this code:

        try:
            results = acoustid.match(self.__API_KEY, self.__file)
        except acoustid.NoBackendError:
            raise error.ChromaprintNotFoundException(
                "Chromaprint library/tool not found")
        except acoustid.FingerprintGenerationError:
            raise error.FingerprintGenerationError(
                "Fingerprint could not be calculated")
        except acoustid.WebServiceError as exc:
            raise error.WebServiceError("Web service request failed:", exc.message)
        try:
            result = next(results)
        except StopIteration as exc:
            raise error.FingerprintGenerationError(
                "Fingerprint could not be calculated") from exc
        self.__id = result[1]
        return self.__id

When I run that code, your pyacoustid calculates the fingerprint with the default calculator, and it fails with the StopIteration error because the generator is empty.

Afterwards I changed the code and wrote this:

        try:
            results = acoustid.match(self.__API_KEY, self.__file, force_fpcalc=True)
        except acoustid.NoBackendError:
            raise error.ChromaprintNotFoundException(
                "Chromaprint library/tool not found")
        except acoustid.FingerprintGenerationError:
            raise error.FingerprintGenerationError(
                "Fingerprint could not be calculated")
        except acoustid.WebServiceError as exc:
            raise error.WebServiceError("Web service request failed:", exc.message)
        try:
            result = next(results)
        except StopIteration as exc:
            raise error.FingerprintGenerationError(
                "Fingerprint could not be calculated") from exc
        self.__id = result[1]
        return self.__id

Now everything worked, and I got no errors (fpcalc version 1.4.3)

The file I tested with has the fpcalc result:
result.txt

@garlontas garlontas changed the title Fingerprint result with fpcalc is other than with ffmpeg Fingerprint result with force fpcalc is other than with default settings Oct 14, 2021
@swanux
Copy link

swanux commented Oct 27, 2021

I can confirm this issue, I have the exact same problem.

OS: elementaryOS 6 (Ubuntu 20.04)
chromaprint: 1.4.3 (distribution provided)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants