Skip to content

Latest commit

 

History

History
executable file
·
127 lines (92 loc) · 4.94 KB

README.md

File metadata and controls

executable file
·
127 lines (92 loc) · 4.94 KB

ACRCloud Scan Tool (Python3)

Overview

ACRCloud provides services such as Music Recognition, Broadcast Monitoring, Custom Audio Recognition, Copyright Compliance & Data Deduplication, Live Channel Detection, and Offline Recognition etc.

Requirements

Follow one of the tutorials to create a project and get your host, access_key and access_secret.

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 ...

Features

  • scan file
  • scan folder
  • export the report
  • filter report result
  • custom report fields

Notice

If you are using Windows. Please make sure you've installed Microsoft Visual C++ runtime

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

Getting Started

  1. Install Python 3 (64-bit)
https://www.python.org/downloads/
  1. Clone this repository / Download repository zip file
$ git clone https://github.com/acrcloud/acrcloud_scan_files_python3.git
  1. Install requirements.txt:
$ python3 -m pip install -r requirements.txt
  1. Copy config.yaml.example and save as config.yaml. Change the content of config.yaml, fill in your host, access_key and access_secret.

  2. Run the script to scan your audio/video files:

$ python main.py -t ~/test/test.mp4

Usage

Usage: main.py [OPTIONS]

Options:
  -t, --target TEXT               The target need to scan (a folder or a
                                  file).  [required]

  -o, --output TEXT               Output result to this folder. (Must be a
                                  folder path)

  --format [csv|json]             output format.(csv or json)
  -w, --with-duration / --no-duration
                                  Add played duration to the result
  --filter-results / --no-filter  Enable filter.(It must be used when the
                                  with-duration option is on)

  -p, --split-results / --no-split
                                  Each audio/video file generate a report
  -c, --scan-type [music|custom|both]
                                  scan type
  -s, --start-time-ms INTEGER     scan start time
  -e, --end-time-ms INTEGER       scan end time
  -f, --is-fp / --not-fp          scan fingerprint
  --help                          Show this message and exit.

Results with played duration

If you want your results to include played duration. Please email us ([email protected]) to get the usage and the permission

  • with played duration:
$ python main.py -t ~/test/test.mp4 -w
  • with played duration and filter results
$ python main.py -t ~/test/test.mp4 -w --filter-results

Using Docker

  • Install Docker
    • If you are using Windows or MacOS: Download Docker Desktop and install.
    • If you are using Linux: Open the Terminal and input bash <(curl -s https://get.docker.com/)
  • Change the config file (config.yaml).
  • Run following command
    git clone https://github.com/acrcloud/acrcloud_scan_files_python3.git
    
    cd acrcloud_scan_files_python3
    
    sudo docker build -t acrcloud/acrscan .
    # Call it without arguments to display the full help
    sudo docker run --rm acrcloud/acrscan
    
    # Basic usage
    sudo docker run --rm -v $(pwd):/tmp -v /Users/acrcloud/:/music/ acrcloud/acrscan -t /test/test.mp4 -o /tmp
    
    You need to change /Users/acrcloud/ to the directory where your audio/video file is.
    And the report file will in the acrcloud_scan_files_python3 directory.