SongRec
SongRec copied to clipboard
[Feature Request] Ability to delimit which part of the file is fingerprinted
I wanted to use SongRec with unsplit, several hours long, DJ mixes without having to cut the file for each track. Would it be possible to add a delimiter, letting the user explicitely set the beginning and the ending of what will be fingerprinted?
Something like songrec recognize --starts 00:02:14 --ends 00:03:45 file.wav
You could try using third-party libs to do that: for example, ffmpeg or sox:
ffmpeg -ss 60 -i input.mp3 -t 15s -c copy /tmp/output.mp3 && songrec recognize /tmp/output.mp3 ; rm -f/tmp/output.mp3
This means: "start from second 60 and give me 15 seconds". Check ffmpeg's documentation or stackoverflow posts to get an idea.
This has the disadvantage of creating a temp file but it's feasible.
If the input file could be - for stdin, then you could pipe ffmpeg directly into songrec, perhaps allow stdin as a reader source https://github.com/marin-m/SongRec/blob/22a329b70532aaaf0d4f206b4fc8299776a69fe5/src/fingerprinting/algorithm.rs#L42
I'm about to attempt to do something with a dj mix, where I'll split the track into 30 second samples, skipping a minute between samples, which should give me a bunch of recognitions throughout the mix.
Related: https://github.com/marin-m/SongRec/issues/44 Related: https://github.com/marin-m/SongRec/issues/11
This might or might not be related but maybe someone can shed some light.
I'm trying to detect the songs used in certain radio stations. Because SongRec detects songs from 12 second samples, I get a lot of hits from tracks used during commercial breaks.
In src/fingerprinting/algorithm.rs there's a comment in line 55 that mentions the 12 second sample size. I tried modifying that value to 30 seconds and recompiling, but songs still get recognized at around 12 seconds.
Is there any simple way to change the sample size or would that entail messing with the algorithm too much?
If the input file could be
-for stdin, then you could pipe ffmpeg directly into songrec, perhaps allow stdin as a reader sourcehttps://github.com/marin-m/SongRec/blob/22a329b70532aaaf0d4f206b4fc8299776a69fe5/src/fingerprinting/algorithm.rs#L42
I'm about to attempt to do something with a dj mix, where I'll split the track into 30 second samples, skipping a minute between samples, which should give me a bunch of recognitions throughout the mix.
any news on this? :)