Skip to content

Latest commit

 

History

History
212 lines (131 loc) · 6.76 KB

File metadata and controls

212 lines (131 loc) · 6.76 KB

Configuration

Prerequisites

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.

Configure overlays

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

Configure custom vocabulary

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

Configure vocabulary filter

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

Configure all at once

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

Scripts included in this folder

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.


start-container.sh

This script starts the specified service in the specified ECS cluster.

Parameters:

  1. CLUSTER_NAME (required)
  2. SERVICE_NAME (required)

Example:

bash start-container.sh ivs-transcribe-demo-cluster ivs-transcribe-demo-stream-service`

stop-container.sh

This script stops the specified service in the specified ECS cluster.

Parameters:

  1. CLUSTER_NAME (required)
  2. SERVICE_NAME (required)

Example:

bash stop-container.sh ivs-transcribe-demo-cluster ivs-transcribe-demo-transcribe-service

load-overlays.js

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

cleanup-overlays.js

This script removes all items from the specified DynamoDB table.

Parameters:

  1. TABLE_NAME (required)

Example:

bash cleanup-overlays.sh ivs-transcribe-demo-overlays

create-custom-vocabulary.sh

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:

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

create-vocabulary-filter.sh

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

configure-overlays.sh

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

configure-custom-vocabulary.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

configure-vocabulary-filter.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

configure-all.sh

Performs all the possible configurations at once, by calling the following scripts with the corresponding arguments:

  1. cleanup-overlays.js
  2. load-overlays.js
  3. create-custom-vocabulary.sh
  4. create-vocabulary-filter.sh
  5. stop-container.sh
  6. start-container

Parameters: None

Example:

bash configure-all.sh