Live Stream Client Python (version 2.7.X)
Overview
ACRCloud provides services such as Music Recognition, Broadcast Monitoring, Custom Audio Recognition, Copyright Compliance & Data Deduplication, Live Channel Detection, and Offline Recognition etc.
Windows Runtime Library
If you run the SDK on Windows, you must install this library.
X86: download and install Library(windows/vcredist_x86.exe)
x64: download and install Library(windows/vcredist_x64.exe)
Preparations:
- Before using this tool, you must register on our platform and log into your dashboard.
- Sign up now for a free 14 day trial: http://console.acrcloud.com/signup
- Create a “Live Channel” bucket and add the url of your streams into it.
- Create a console access key pairs in the account settings and input this key piars to your client.conf file
- Input your Live Bucket Name to the client.conf file.
- Run the stream.py
- Create a “Live Channel Detection” project and attach the bucket which contains your chosen stream urls.
- Then you can use our SDK to detect the current stream.
Configure
client.conf
# You must replace "XXXXXX" with your access_key and access_secret.
console_access_key = "XXXXXX"
console_access_secret = "XXXXXX"
bucket_name = "your_bucket_name"
remote = 1
debug = 0
record_upload = 0
record_upload_time = 60
# If you do not set log_file, the log will be echo to console.
log_file = "acrcloud_stream.log"
# If you set restart_interval_minute, the tool will restart every (restart_interval_minute) minutes.
restart_interval_minute = 0
# If you set is_run_with_watchdog, there will be a daemon which is used to watch over streams process.
is_run_with_watchdog = 1
server = {
'host': '',
'port': 0,
}
source = [
# ['udp://127.0.0.1:1234', '(acrc id)', (program_id, default -1)],
]
Run The Tool
- start
python stream.py
or
nohup python stream.py &
- stop
ps -ef | grep stream.py | grep -v grep | awk '{print $2}'| xargs kill -9