Skip to content

abhisekde/acrcloud_scan_files_python

 
 

Repository files navigation

Audio Recognition -- File Scan Tool (Python Script)

Overview

ACRCloud provides Automatic Content Recognition services for Audio Fingerprinting based applications such as Audio Recognition (supports music, video, ads for both online and offline), Broadcast Monitoring, Second Screen, Copyright Protection and etc.

This tool can scan audio/video files and detect audios you want to recognize such as music, ads.

Supported Format:

Audio: mp3, wav, m4a, flac, aac, amr, ape, ogg ...
Video: mp4, mkv, wmv, flv, ts, avi ...

Requirements

  • Python 2.7
  • backports.csv==1.0.1
  • requests==2.10.0
  • Follow one of the tutorials to create a project and get your host, access_key and access_secret.

Installation

For Windows System, you must install Python 2 and pip.

Open your terminal and change to the script directory of acrcloud_scan_files_python-master. Then run the command:

pip install -r requirements.txt

For OSX and Linux

Choose your lib

Library for Linux.

Library for Mac OSX.

Then, copy "acrcloud_extr_tool.so" to acrcloudpysdk directory and replace the original file.

For Windows

Install Library

Windows Runtime Library

X86: download and install Library(windows/vcredist_x86.exe)

x64: download and install Library(windows/vcredist_x64.exe)

Choose your lib

x86: win32 acrcloud_extr_tool

x64: win64 acrcloud_extr_tool

Then, copy "acrcloud_extr_tool.so" to acrcloudpysdk directory

Usage:

    _    ____ ____   ____ _                 _
   / \  / ___|  _ \ / ___| | ___  _   _  __| |
  / _ \| |   | |_) | |   | |/ _ \| | | |/ _` |
 / ___ \ |___|  _ <| |___| | (_) | |_| | (_| |
/_/   \_\____|_| \_\\____|_|\___/ \____|\____|

Before you use this script,you must have acrcloud host,access_key and access_secret. If you haven't have these ,you can register one https://console.acrcloud.com/signup

Change the content of config.json,fill in your host, access_key and access_secret

{
 "host": "xxxxx",
 "access_key": "xxxxx",
 "access_secret": "xxxxx"
}
python acrcloud_scan_files_python.py -d folder_path
python acrcloud_scan_files_python.py -f file_path
python acrcloud_scan_files_python.py -h get_usage_help

Scan Folder Example:

python acrcloud_scan_files_python.py -d ~/music

Scan File Example:

python acrcloud_scan_files_python.py -f ~/testfiles/test.mp3

Add more params

"-s" ---- scan step. (The scan interval.)

"-r" ---- scan range. (The scan range.)

If you want to change scan interval or you want to set recognize range,you can add some params
Example:
    python acrcloud_scan_files_python.py -f ~/testfiles/test.mp3 -s 30 -r 0-20
    python acrcloud_scan_files_python.py -d ~/music -s 30

Scan error_scan file

When Scan program  occurs some errors,error detail will store in error_scan.txt,When the scan tasks are finished, you can rescan these error task.
Example: 
   python acrcloud_scan_files_python.py -e error_scan.txt

Default is scan folder where this script in.

The results are saved in the folder where this script in.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%