ACRCloud
Visit WebsiteConsole
  • Introduction
  • Get Started
  • Console Tutorials
    • Recognize Music
    • Recognize Custom Content
    • Broadcast Monitoring for Music
    • Broadcast Monitoring for Custom Content
    • Detect Live & Timeshift TV Channels
    • Recognize Custom Content Offline
    • Recognize Live Channels and Custom Content
    • Find Potential Detections in Unknown Content Filter
  • SDK REFERENCE
    • Mobile SDK
      • iOS
      • Android
      • Unity
    • Backend SDK
      • Python
      • PHP
      • Go
      • Java
      • C/C++
      • C#
    • Error Codes
  • API Reference
    • Identification API
    • Console API
      • Access Token
      • Buckets
        • Audio Files
        • Live Channels
        • Dedup Files
      • Base Projects
      • OfflineDBs
      • BM Projects
        • Custom Streams Projects
          • Streams
          • Streams Results
          • Streams State
          • Recordings
          • Analytics
          • User Reports
        • Broadcast Database Projects
          • Channels
          • Channels Results
          • Channels State
          • Recordings
          • Analytics
          • User Reports
      • File Scanning
        • FsFiles
      • UCF Projects
        • BM Streams
        • UCF Results
    • Metadata API
  • Tools
    • Audio File Fingerprinting Tool
    • Local Monitoring Tool
    • Live Channel Fingerprinting Tool
    • File Scan Tool
  • Metadata
    • Music
    • Music (Broadcast Monitoring with Broadcast Database)
    • Custom Files
    • Live Channels
    • Humming
  • FAQ
    • Definition of Terms
  • Service Usage
Powered by GitBook
On this page
  • Overview
  • Requirements
  • How To Use
  • Python Dependency Library
  • Install on Windows
  • Run as a Docker Container
  1. Tools

Local Monitoring Tool

Overview

This tool is used for ACRCloud Local Broadcast Monitoring Service

Local Broadcast Monitoring System(GitHub) is used to monitor live radio streams on your own local server.

Requirements

  • Python 2.7

  • Works on Linux/Windows

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

    • Broadcast Monitoring for Music

    • Broadcast Monitoring for Custom Content

How To Use

  1. You should register an account on the ACRCloud platform, and create a Broadcast Monitoring project with local monitoring type, you will get access_key, then add your live radio streams in your project.

  2. Clone the code in your local server.

  3. Install MySQL, import acrcloud_database.sql to your mysql server. $mysql -uroot -p < acrcloud_database.sql.

  4. Modify configuration file (acrcloud_config.py), fill access_key, access_secret and database info in the config file.

  5. Run python acrcloud_local_server.py to start monitor server.

  6. You can use client to refresh, get stream state, pause and restart stream, run python acrcloud_client.py.

  7. You can use Ctrl + \ to stop monitor server (in Linux).

  8. You can get monitoring results in your MySql database.

  9. If you want to record recognize audio, you can set config["record"]["record"]=3 (default is 0 and it means not record).

    You can set config["record"]["record_dir"] to specify the save path.

    You can set config["record"]["record_save_days"] to specify the keep days of record files.

    These config can be set in "acrcloud_config.py"

Python Dependency Library

  1. Twisted

  2. requests

  3. fuzzywuzzy

  4. beautifulsoup4

  5. MySQL-Python

Install on Windows

  1. Install Windows Runtime Library

    • X86: download and install Library(vcredist_x86.exe)

    • x64: download and install Library(vcredist_x64.exe)

  2. Install Mysql on your windows

  3. Create Databases(in acrcloud_local_monitor direction and run this command)

    mysql -uroot -p < acrcloud_database.sql

  4. Install Python

  5. Install Python Dependency Library(in acrcloud_local_monitor direction and run the script)

    .\install_python_packages_for_windows.bat

  6. Install MySQL-python

    • Open https://www.lfd.uci.edu/~gohlke/pythonlibs/

    • Find and Download:

      MySQL_python‑1.2.5‑cp27‑none‑win32.whl (or MySQL_python‑1.2.5‑cp27‑none‑win_amd64.whl)

    • python -m pip install MySQL_python‑1.2.5‑cp27‑none‑win32.whl

    • python -m pip install mysql-python

  7. Copy the ACRCloud Library into the acrcloud_local_monitor direction according to your system.

    • X86: copy from winlibs/win32/acrcloud_stream_decode.pyd to acrcloud_local_monitor direction

    • X64: copy from winlibs/win64/acrcloud_stream_decode.pyd to acrcloud_local_monitor direction

  8. If you have created Local Project and add some streams, config the acrcloud_config.py with your access_key, and mysql information, then start the local server

    python acrcloud_local_server.py

  9. Stop the local monitor server

    python acrcloud_stop.py and Ctrl-C

Run as a Docker Container

  1. Install Docker

    • If you are using Windows: Download Docker Desktop for Windows and install.

    • If you are using MacOs: Download Docker Desktop for Mac and install.

    • If you are using Linux: Open the Terminal and input bash <(curl -s https://get.docker.com/)

  2. Run following command

    • git clone https://github.com/acrcloud/acrcloud_local_monitor

    • cd acrcloud_local_monitor

    • Change the config file "acrcloud_config.py", fill in your project "access_key", and mysql setting(host, port, user, passwd), if Mysql was installed in your computer, please create a remote user and set field "host" to your private IP(ifconfig in Linux or ipconfig in Windows, "host.docker.internal" in Mac OS)

    • docker build -t acrcloud/acr_local_monitor_image:v1 .

    • docker run --rm -itv /<Change to your directory>/acrcloud_local_monitor:/docker_local_monitor --name="acr_local_monitor" acrcloud/acr_local_monitor_image:v1

Last updated 3 years ago