worldveil / dejavu

Audio fingerprinting and recognition in Python
MIT License
6.36k stars 1.43k forks source link

Streaming urls #224

Open skipperstrange opened 4 years ago

skipperstrange commented 4 years ago

Hi, I’m still a bit of a new comer to djv. I was wondering if there is in anyway i can stream a livestream link or playlist other than microphone or file such as mp3u or icecast link as an input to dejavu and how to do so?

Thanks in advance

mickaelmonsieur commented 1 year ago

I'm also interested. Too bad no one answered you.

alffykasum commented 1 year ago

One way you could potentially use Dejavu with a live stream is by continuously recording the stream to a file, and then running the audio fingerprinting process on small chunks of the file as they are recorded. You would then need to store these fingerprints in a database and continuously match them to new fingerprints as they are generated.

Another approach could be to run the audio fingerprinting process on the client side, meaning on the user's browser using some JavaScript libraries and sending the audio chunks to the server for storage and matching.

mickaelmonsieur commented 1 year ago

I understood the principle. On the other hand, I don't find it very optimized to store records on disk 24 hours a day, it creates unnecessary disk wear. Especially with the new storages, the SSD, which is cycle-limited over time.

If it is possible to listen to a microphone, so in real time, it should be technically possible to listen to an HTTP audio stream right?

alffykasum commented 1 year ago

@mickaelmonsieur Yes, you're right that listening to the microphone in real-time would be a more optimized approach. It would also avoid the issue of storing and managing large amounts of recorded audio files, which can take up a lot of storage space and require additional processing resources. However, it may also require a more complex and powerful infrastructure to handle real-time audio processing and matching. Additionally, there may be limitations in terms of the quality of the audio and the ability to process it in real-time, depending on the specific use case and the technology being used.

mickaelmonsieur commented 1 year ago

I know that with libVLC it's relatively easy to grab an audio stream, and with a large combination of accepted codecs. It is simply enough for the user to have VLC installed on the system.

alffykasum commented 1 year ago

There you go :) .However, it may still require a powerful infrastructure to handle real-time audio processing and matching, and there may be limitations in terms of audio quality and processing speed depending on the specific use case and technology being used. but that is a good start.