Identify the song playing in any audio or video file, right from your terminal.
Project description
songid
Identify the song playing in any audio or video file, right from your terminal.
Ever download a TikTok/Instagram clip and wonder what the music is? songid extracts
the audio with ffmpeg, fingerprints it, and asks Shazam's recognition service what it is.
$ songid Download.mp4
Download.mp4: SABI & MIA BOYKA — Базовый минимум (Slow Version)
https://www.shazam.com/track/852590911/...
Works on anything ffmpeg can read: .mp4, .mkv, .webm, .mp3, .m4a, .wav, .ogg, voice memos, screen recordings…
Install
Requires Python 3.10–3.12 and ffmpeg on your PATH.
# ffmpeg (if you don't have it)
winget install Gyan.FFmpeg # Windows
brew install ffmpeg # macOS
sudo apt install ffmpeg # Debian/Ubuntu
# songid — pipx or uv keeps it isolated
pipx install songid
# or, from a checkout:
uv tool install .
Why Python ≤ 3.12? The
shazamiodependency ships prebuilt wheels up to 3.12; on 3.13+ it tries to compile Rust from source.uv tool install --python 3.12 .handles this for you automatically.
Usage
songid clip.mp4 # identify one file
songid *.mp4 # batch — one line per file
songid song.mp3 --json # machine-readable output
songid movie.mkv -s 3600 -d 15 # sample 15s starting at the 1-hour mark
| Flag | Meaning | Default |
|---|---|---|
-s, --offset SEC |
Start sampling this many seconds into the file | 0 |
-d, --duration SEC |
Length of the audio sample | 12 |
--json |
JSON output (keyed by file path) | off |
Exit codes: 0 match found · 1 file/ffmpeg error · 2 ran fine but no match.
Tips
- No match? Try a different
--offset— aim for a part where the music is loud and vocals/melody are clear, not crowd noise or talking. - 10–15 seconds of sample is the sweet spot; more isn't better.
- Low-bitrate audio (social media rips) still matches fine — Shazam's fingerprinting is robust to compression.
How it works
- ffmpeg decodes a short sample (mono, 44.1 kHz WAV) from your file — video streams are ignored.
- shazamio generates a spectral fingerprint of the sample and queries Shazam's recognition API.
- The match (title, artist, album, genre, Shazam link) is printed.
Your file never leaves your machine — only the derived audio fingerprint is sent.
Limitations
- Uses Shazam's unofficial API via shazamio; heavy batch use may get rate-limited. Be reasonable.
- Instrumental covers, live edits, and sped-up/slowed "nightcore" versions may match the altered version or nothing at all.
- Needs an internet connection.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file songid-0.1.0.tar.gz.
File metadata
- Download URL: songid-0.1.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1a498471ddbb5126a874b41d0755f1066750ed6f9ccc25e5f952bad001e0aeb
|
|
| MD5 |
2e669f00381c6d164564e46d81936e2d
|
|
| BLAKE2b-256 |
55723e5d7e4d3aad2b5652010fb4c78e40208cbc9d2dc0b757b2c02de4df7a55
|
Provenance
The following attestation bundles were made for songid-0.1.0.tar.gz:
Publisher:
publish.yml on HakubaCode/songid
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
songid-0.1.0.tar.gz -
Subject digest:
a1a498471ddbb5126a874b41d0755f1066750ed6f9ccc25e5f952bad001e0aeb - Sigstore transparency entry: 2342243628
- Sigstore integration time:
-
Permalink:
HakubaCode/songid@0edd3a4d96bb61d6dc35a0385a7f712b91dce14a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/HakubaCode
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0edd3a4d96bb61d6dc35a0385a7f712b91dce14a -
Trigger Event:
release
-
Statement type:
File details
Details for the file songid-0.1.0-py3-none-any.whl.
File metadata
- Download URL: songid-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebaa3ee8d0a7fbb6c9ca19adf87baef93c339bd5e9d169b805994ee0acf6d3c7
|
|
| MD5 |
329c1ac267ccf81950467d2610b1ca0a
|
|
| BLAKE2b-256 |
ab356667efecc9a287ebec63f28db5254d5fd7fb6b626cadeb44fc560f4dee8f
|
Provenance
The following attestation bundles were made for songid-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on HakubaCode/songid
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
songid-0.1.0-py3-none-any.whl -
Subject digest:
ebaa3ee8d0a7fbb6c9ca19adf87baef93c339bd5e9d169b805994ee0acf6d3c7 - Sigstore transparency entry: 2342243634
- Sigstore integration time:
-
Permalink:
HakubaCode/songid@0edd3a4d96bb61d6dc35a0385a7f712b91dce14a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/HakubaCode
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0edd3a4d96bb61d6dc35a0385a7f712b91dce14a -
Trigger Event:
release
-
Statement type: