Code Monkey home page Code Monkey logo

Comments (7)

cjmanca avatar cjmanca commented on June 27, 2024

Extra info: I rewrote my code to use ffmpeg to cut the video for the time I'm interested in into separate files, and fingerprint/query off those and it finds the matches perfectly using the same timestamps that I was passing in to the secondsToProcess and startAtSecond. There's definitely an issue there.

This is working for now, but I'd really rather not have to create these temporary video files just to fingerprint.

from soundfingerprinting.

AddictedCS avatar AddictedCS commented on June 27, 2024

I tried to reproduce it with a sample example but I couldn't.

The following example fingerprints the entire file, then queries only 15 seconds starting at 10'th second.

public static class Issue191
{
    public static async Task<AVQueryResult> Reproduce()
    {
        var modelService = new InMemoryModelService();
        var mediaService = new FFmpegAudioService();

        string file = "path to a 30 seconds file";
        var hashes = await FingerprintCommandBuilder.Instance
            .BuildFingerprintCommand()
            .From(file)
            .UsingServices(mediaService)
            .Hash();

        var track = new TrackInfo("1", string.Empty, string.Empty);
        
        modelService.Insert(track, hashes);

        var results = await QueryCommandBuilder.Instance
            .BuildQueryCommand()
            .From(file, secondsToProcess: 15, startAtSecond: 10)
            .UsingServices(modelService, mediaService)
            .Query();
        
        return results;
    }
}

I get the result as expected with the following properties:

TrackCoverageWithPermittedGapsLength = 14.30
TrackMatchStartsAt = 10.03

Same holds if I fingerprint just a portion of the file:

var hashes = await FingerprintCommandBuilder.Instance
            .BuildFingerprintCommand()
            .From(file, secondsToProcess: 15, startAtSecond: 10)
            .UsingServices(mediaService)
            .Hash();

In this case, I get full matches, with

TrackCoverageWithPermittedGapsLength = 15
TrackMatchStartsAt = 0

from soundfingerprinting.

AddictedCS avatar AddictedCS commented on June 27, 2024

Can you provide a sample example with expected and actual results?

from soundfingerprinting.

cjmanca avatar cjmanca commented on June 27, 2024

Mmm... I'd have to hunt for some that wouldn't be a copyright infringement, since the ones I'm using are TV shows ripped from dvd. It's not every file either. Some match fine, but some are "problem files" which don't match at all. Although, I have seen some files which "sometimes match" unreliably too when using startSeconds, but usually if it doesn't match, it'll never match.

Most of my library is mkv for the container. Audio codecs vary though, I'll see if I can see a commonality for codec type.

It may be something to do with the encoding perhaps, since normally I get back 400+ items in the results when querying the whole file against the whole series (most matches are ~1 second though), but on the files where it won't find matches, it returns no results at all, not even short ones. Those same files work fine when passing the full file in though. It only returns no results when using the startSeconds option.

from soundfingerprinting.

cjmanca avatar cjmanca commented on June 27, 2024

I see that there are logging outputs in your source, but I can't see a way to access them. How do I turn on logging?

from soundfingerprinting.

AddictedCS avatar AddictedCS commented on June 27, 2024

Both QueryCommandBuilder and FingerprintCommandBuilder can be instantiated with ILoggerFactory:

var queryCommandBuilder = new QueryCommandBuilder(loggerFactory);

Once provided it will start logging in the project configured output.

from soundfingerprinting.

AddictedCS avatar AddictedCS commented on June 27, 2024

A similar bug has been described in #207 (not exactly the same scenario but a particular use case when both Audio | Video fingerprints are generated during query).
A fix has been provided in v8.24.0.

from soundfingerprinting.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.