Recipe

Check a video for copyrighted music before you upload it

For creators and small teams: list the commercial recordings in a video file and where they play, with the AudD command-line tool and no code. What a scan of a 10-minute video costs, how to read the results, and what a match does and doesn't tell you.

view .md auddcopyrighted musiccheck video before uploadcli

If you want to know which songs are playing in your video before you upload it, you can scan it with audd, our command-line tool. You’ll get a list of the songs, with the time when each of them starts and ends in the video. No code is required.

audd login
audd recognize my-video.mp4 --enterprise --limit 50 --tracklist
0:00 – 0:08        Ali Angel — Tou patou II
0:00 – 0:08        Future Shock — Dance Floor
0:00 – 0:07        Anthony Acosta — The Way She Moves
0:48 – 0:57        Barely Alive — Keyboard Killer
1:36 – 1:44        Barely Alive — Keyboard Killer

Note. We recognize music from our database of 160 million songs. The result will tell you which recording is playing, where it starts, and where it ends. Keep in mind that we can’t tell you what a platform will do with your video.

1. Install the CLI and sign in

WhereCommand
macOS (Homebrew)brew install auddmusic/tap/audd
Windowsthe installer for x64 or ARM64
macOS, Linuxcurl -fsSL https://github.com/AudDMusic/audd-cli/releases/latest/download/install.sh | sh
Node.jsnpm install -g @audd/cli
Pythonpipx install audd-cli

Then sign in:

audd login

audd login opens your browser so you can approve the sign-in, and then saves your API token. If you already have a token, you can set it in the AUDD_API_TOKEN environment variable instead. You can get a token from our API Dashboard at dashboard.audd.io. New accounts get 300 free requests for 14 days, where available.

Please install ffmpeg as well. If ffmpeg is installed, the CLI reads the exact length of the video to estimate the cost; otherwise, it estimates the length from the file size and says so.

2. Check what the scan will cost

The standard endpoint analyzes up to the first 12 seconds of audio, so for a whole video, you’ll use the enterprise endpoint. We count requests to the enterprise endpoint as 1 request per 12 seconds of audio, which is 5 requests per minute of video. The --limit option is the upper bound for the number of 12-second chunks the server will recognize. Run the command with --dry-run first to see the number for your file; nothing is sent.

audd recognize my-video.mp4 --enterprise --dry-run
Video lengthRequests (--limit)Cost at $5.00 per 1,000
1 minute5$0.025
10 minutes50$0.25
30 minutes150$0.75
1 hour300$1.50

During the free trial, you can send files to the enterprise endpoint, but not URLs. The CLI uploads files from your computer, so you can try this recipe on the trial: its 300 requests are enough for six 10-minute videos.

PlanPriceRequests includedAdditional requests
Free trial (new accounts, where available)$0300 in total, for 14 daysnone
Indie$5 per month1,000 per month$5.00 per 1,000

For the other plans, see the pricing page.

3. Scan the video

Use the number from the dry run as the limit:

audd recognize my-video.mp4 --enterprise --limit 50 --tracklist

Before it uploads the file, the CLI will ask you to confirm. If the scan finds any songs, you’ll see a line for each of them, with the start and end time in your video, the artist, and the title. With --tracklist, the matches of the same song in consecutive chunks are merged into one line.

  • If more than one song matches the same part of the video, each of them will have its own line.
  • A song that stops and comes back later will have two lines, and so will a song that wasn’t matched in two or more chunks in a row.
  • If the limit is lower than the number of chunks in the video, the end of the video won’t be scanned.

Add -v to see the album, the label, the release date, and a link to the song page under each line. You don’t have to have an enterprise account in order to use the enterprise endpoint, but ISRC and UPC codes are enterprise features, available on a Startup plan or higher, on request. Let us know if you want access to these features: send an email to [email protected].

4. Save the list

If you want to keep the results in a spreadsheet, write them to a CSV file:

audd recognize my-video.mp4 --enterprise --limit 50 --tracklist --format csv > my-video-music.csv

Every row is one song. The start and end columns are times in your video (m:ss), and start_seconds and end_seconds are the same times in seconds. Results are cached by file contents, so recognizing the same file again is free.

The times in the output are positions in your video. If you read the JSON output (--format json), you’ll also see timecode: it’s the position in the original song where the matched fragment is playing, not in your file.

When the video file is large

The CLI uploads the whole file, video included. If the video is long or in high resolution, you can extract the audio first: the upload will be much smaller. If the sound starts with the picture, the times in the results will still point to the same moments in the video.

ffmpeg -i my-video.mp4 -vn -c:a aac -b:a 128k my-video-audio.m4a
audd recognize my-video-audio.m4a --enterprise --limit 50 --tracklist

At 128 kbps, the audio is about 1 MB per minute. For more ffmpeg commands, see Cut and convert audio clips with ffmpeg.

When nothing is found

If the CLI has successfully scanned the video, but there are no matches, it prints No match. It means that we didn’t recognize any recording from our database in the parts of the video that were scanned. It doesn’t mean there’s no music in the video, or that a platform won’t flag it.

Please note that we can only recognize songs from our database, so your own unreleased music won’t be found. A song you sang or played yourself won’t be found either, and a cover doesn’t match the original: we identify recordings, not compositions. The part of the video after the chunks covered by --limit won’t be scanned.

We may also not recognize music that’s quiet under loud speech or game sound. For more examples, see What music recognition matches, and what it doesn’t.

When a song is found

Now that you know the song and where it plays, you can replace it, mute that part, or cut it out before you upload the video. If you have a license for the song, you can keep it. Flag and remove music in a live-event recording shows how to mute or cut the segments with ffmpeg.

If you have an archive of past videos to check, you can use sampling to keep the cost down: see Scan your stream archive. For how platforms turn matches into decisions, see From match to decision.

With Python instead of the CLI

If you prefer code, the Python SDK sends the same request (pip install audd):

from audd import AudD

audd = AudD("your-api-token")  # get your own token at dashboard.audd.io


def clock(seconds):
    s = int(seconds or 0)
    return f"{s // 60}:{s % 60:02d}"


matches = audd.recognize_enterprise("my-video.mp4", limit=50)
if not matches:
    print("No known recordings in the scanned part of the video.")
for m in matches:
    print(f"{clock(m.start_seconds)}-{clock(m.end_seconds)}  {m.artist} - {m.title}")

start_seconds and end_seconds are positions in your file; the SDK works them out from the chunk position and the offset inside the chunk. Unlike --tracklist, this prints one line per match.

When the scan stops with an error

If something goes wrong, the CLI will tell you what happened and what you can do. You can also check the exit code:

  • 3: the token is missing or was rejected. Run audd login again.
  • 4: you’re out of requests, or the feature isn’t available on your plan (for example, a URL on the enterprise endpoint during the free trial).
  • 5: a network or server error. Retrying may help.
  • 6: a safety limit, such as a missing --limit, or a confirmation with no terminal to ask it in.

For the API’s error codes, see the Error codes reference.


Related

Reading this as an AI agent? The raw Markdown is at recipes/check-a-video-for-copyrighted-music-before-upload.md, and the full index is /resources/llms.txt.