- Node.js version 12.0.0 or later to run Node scripts
- AWS account to create resources
- AWS CLI version 2 to run scripts
- Git Bash to run Bash scripts (only on Windows)
Of note:
When performing one of the following configurations, captions will disappear for a couple of seconds until the Transcribe service is restarted to take the new configuration.
You can configure image overlays that are triggered via "keywords" in captions so they pop up on top of the player during the stream for a couple of seconds. Both the keywords and images can be configured by modifying the overlays.json file, which already contains a default configuration, and running the script:
bash configure-overlays.sh
You can configure a custom vocabulary by modifying the custom-vocabulary.txt file, which already contains a default configuration, and running the script:
bash configure-custom-vocabulary.sh
You can configure a vocabulary filter by modifying the vocabulary-filter.txt file, which already contains a default configuration, and running the script:
bash configure-vocabulary-filter.sh
You can perform the previous configurations all at once by updating the overlays.json, custom-vocabulary.txt and/or vocabulary-filter.txt files, and running the following script:
bash configure-all.sh
This section includes details of every script present in this folder for informational purposes, you need only to run the scripts described in the Configuration section above.
This script starts the specified service in the specified ECS cluster.
Parameters:
- CLUSTER_NAME (required)
- SERVICE_NAME (required)
Example:
bash start-container.sh ivs-transcribe-demo-cluster ivs-transcribe-demo-stream-service`
This script stops the specified service in the specified ECS cluster.
Parameters:
- CLUSTER_NAME (required)
- SERVICE_NAME (required)
Example:
bash stop-container.sh ivs-transcribe-demo-cluster ivs-transcribe-demo-transcribe-service
This script loads the overlay items defined in the specified JSON file into the specified DynamoDB table.
Parameters:
--filePath
: Path to JSON file with the overlays data (required).--dynamoDbTable
: Name of the DynamoDB table where to load the overlay items (required).--awsRegion
: AWS region where the table is located (required).
Example:
node load-overlays.js --filePath data/overlays.json --dynamoDbTable ivs-transcribe-demo-overlays --awsRegion us-east-1
This script removes all items from the specified DynamoDB table.
Parameters:
- TABLE_NAME (required)
Example:
bash cleanup-overlays.sh ivs-transcribe-demo-overlays
Creates a custom vocabulary in Amazon Transcribe using a vocabulary table. This requires a source file to be stored in an Amazon S3 bucket.
The script uploads the .txt file that contains the vocabulary table into an S3 bucket and creates the custom vocabulary using the S3 URI of the file. Language code en-US is used by default. Amazon Transcribe then validates that the vocabulary is correct. Once it's finished, the script informs the user whether the custom vocabulary is READY to use or if it FAILED and the reason why.
Parameters:
- VOCABULARY_FILE_PATH (required)
You can find an example file containing a custom vocabulary table in:data/custom-vocabulary.txt
Example:
bash create-custom-vocabulary.sh data/custom-vocabulary.txt
Creates a vocabulary filter in Amazon Transcribe to filter unwanted words. This requires a source file to be stored in an Amazon S3 bucket.
The script uploads the .txt file that contains the list of unfiltered words into an S3 bucket, and then creates the vocabulary filter using the S3 URI of the file. Language code en-US is used by default.
Parameters:
- VOCABULARY_FILTER_FILE_PATH (required)
You can find an example file with words to be filtered in:data/vocabulary-filter.txt
Example:
bash create-vocabulary-filter.sh data/vocabulary-filter.txt
Calls the cleanup-overlays.js script to cleanup the overlays table. Then, calls the load-overlays.js script to fill the overlay table again and finanlly calls the stop-container.sh and start-container scripts to restart the Transcribe container to take the new configuration.
Parameters: None
Example:
bash configure-overlays.sh
Calls the create-custom-vocabulary.sh to create the custom vocabulary and then calls the stop-container.sh and start-container scripts to restart the Transcribe container to take the new configuration.
Parameters: None
Example:
bash configure-custom-vocabulary.sh
Calls the create-vocabulary-filter.sh to create the vocabulary filter and then calls the stop-container.sh and start-container scripts to restart the Transcribe container to take the new configuration.
Parameters: None
Example:
bash configure-vocabulary-filter.sh
Performs all the possible configurations at once, by calling the following scripts with the corresponding arguments:
- cleanup-overlays.js
- load-overlays.js
- create-custom-vocabulary.sh
- create-vocabulary-filter.sh
- stop-container.sh
- start-container
Parameters: None
Example:
bash configure-all.sh