Watchbucket is a Python-based service designed to interact with the Qencode API by launching transcoding jobs for each new videos found in a specific S3 folder.
To install the required dependencies, run the following command:
pip install -r watchbucket/requirements.txt
Before running the service, you need to configure the necessary settings:
-
Python Executable Path
Specify the path to your Python executable in theservice.sh
script:PYTHON=/usr/bin/python3
-
Repository Path
Define the path to your clone of this repository in theservice.sh
script:ROOT_DIR=/home/user/watchbucket
-
Qencode API Key
Enter your Qencode API Key inwatchbucket/settings/qencode.py
:QENCODE_API_KEY = 'abcd12345678'
-
API Query JSON
Customize your API query JSON inwatchbucket/query/query.json
. The following placeholders are available within thequery.json
template:{source_url}
: The URL to the source video file.{file_name}
: The file name of the source video, excluding path and extension.
-
S3 configuration Provide your S3 host, bucket and and credentials in
watchbucket/settings/s3.py
.S3_HOST = 's3.us-east-1.amazonaws.com' S3_BUCKET = 'bucketname' S3_KEY = '123456789' S3_SECRET = '123456789'
Specify the folder to monitor in
watchbucket/settings/system.py
:INPUT_PATH = 'input' # S3 folder with input videos PROCESSED_PATH = 'processed' # Contains data for files from input folder which were already processed.
To run the service, execute the run_service.sh
script from the command line:
./service.sh start
You can stop the service using the following command:
./service.sh stop
To restart:
./service.sh restart
Ensure that you have the necessary permissions to execute the script.