This solution provides a serverless, single page web application and set of supporting Amazon API Gateway end points and backing AWS Lambda functions which allow users to upload videos into Amazon S3 and compute and edit closed captions.
- Architecture
- Deploying the Solution
- Solution Pricing
- Launching the Website
- Entering your API Key
- Creating a Vocabulary
- Creating Tweaks
- Listing Videos
- Uploading Videos
- Editing Captions
- Downloading Captions
- License
- Support Appendix
Prebuilt CloudFormation templates and assets have been deployed to AWS regions with both Amazon Transcribe and Amazon Elastic Transcoder. Click a button below to deploy to your region of choice.
When launching the template, you will need to enter a stack name, an API key and choose a locale that Transcribe will use to process your video's audio data.
The API Key is used to provide to users access to the system. You must provide a strong, random, alpha-numeric API key between 20 and 70 characters long. Otherwise the stack will fail to launch and you will see this error.
You are responsible for the cost of the AWS services used while running the video transcription solution. As of the date of publication, the costs for running this solution in the US East (N. Virginia) Region are shown in the table below.
The cost depends on the number of and length of uploaded videos, and does not include data transfer fees, which will vary depending on the number of users and frequency of viewing.
You will also be charged for stored video and audio files in S3.
Video transcoding costs (for non-MP4 videos):
$0.03 per minute
Audio Transcoding costs:
$0.0045 per minute
Transcribe costs:
$0.024 per minute
Amazon S3 Storage costs:
$0.023 per GB per month
Pricing is quoted per minute but Amazon Transcribe actually charges per second. Prices are subject to change. For full details, see the pricing webpage for each AWS service for the region you deploy the solution to.
Amazon Elastic Transcoder Pricing
Once you have deployed your stack, the link to your website is displayed in the CloudFormation Outputs tab along with your API Key. Click the Website link to access the site.
On the home page there an Enter API Key button used for entering your API key, locate your API key using the Outputs tab of the CloudFormation service after deployment and enter it.
After deployment and before uploading videos, log into your site, click on the Vocabulary page and create a custom vocabulary with at least one term. You might consider using:
A.W.S.
You can enter up to 50kb of custom vocabulary terms, if you get a failure to save please read the Amazon Transcribe formatting guide for custom vocabularies.
You can add common terms for your business here such as brand names and industry specific terms to guide Transcribe in providing the best automated result.
After saving the vocabulary, Transcribe needs to train against the new vocabulary which can take several minutes. You are given visual feedback as to when this process is complete. Videos launched during this time will fail if the vocabulary is not in a ready state.
After deployment log into your site, click on the Tweaks tab and create a custom tweak configuration with at least one term. You might consider using:
A.W.S.=AWS
Tweaks are used to transform common transcription issues you might find and also to correct Amazon Transcribe custom vocabulary verbatim transcriptions.
The Videos page shows the current videos in the system and organizes them into tabs based on their processing status. You can search for videos here, start the caption editing process, trigger reprocessing, delete videos and download captions for completed videos.
You can upload videos from any browser and launching the site on mobile allows users to capture and upload videos directly from a mobile phone.
Click on the Upload Videos... button to start the video upload process.
New AWS accounts have a service limit of 10 concurrent transcription jobs, this limit can be raised with an AWS service ticket. Videos launched above this threshold will fail and can be relaunched from the Errored tab.
Once your video has been transcribed you can tweak the captions to get things perfect. When first viewing the video, the system starts in a mode that pauses between each caption block, toggle this mode to view the video continuously.
You can also edit the video name and description here to assist in searching for the video and organising your video collection.
Once you have perfected the captions for a video, click the Done button to move the video to the completed tab.
The Auto save function flushes edits regularly to DynamoDB.
This library is licensed under the Apache 2.0 License.
You can download completed captions from the Caption editing page or from the table on the completed videos tab.
IAM roles and policies are global and are prefixed with the stack name, if you get IAM role or policy conflicts, simply use a different stack name in each deployed region.
This is not currently supported but will be considered if there is customer demand. It will require all resources to be prefixed with the CloudFormation AWS::StackName pseudo parameter.
If you see the following error while launching your CloudFormation stack:
Please verify the API Key you provided is between 20 and 70 characters long and only contains Alpha-Numeric characters, it uses the following regex:
[a-zA-Z0-9]{20,70}
If you are deploying to the same region after previously removing the stack you may see the following error:
Simply delete the stack, go to the CloudWatch Logs Console in the region and remove the dangling log group:
/aws/lambda/prod-aws-captions-customresource
It can remain after a stack removal due to CloudWatch log flushing recreating the log group. Then simply deploy the CloudFormation stack once again.
Please raise a GitHub Issue with the error reported in the stack and we will investigate.
To remove the solution delete the CloudFormation stack. Note that deletion will fail if you have not emptied the video, audio and transcribe buckets created as part of the stack.
After remove the stack, the CloudWatch Log Group for the Lambda custom resource is left behind and must be manually removed before redeploying:
/aws/lambda/prod-aws-captions-customresource
CloudFormation will refuse to remove non-empty S3 buckets so these must be manually emptied before removing the stack:
prod-aws-captions-audio-<region>-<accountId>
prod-aws-captions-video-<region>-<accountId>
prod-aws-captions-transcribe-<region>-<accountId>
If you get this failure, empty the buckets using the S3 console and try deleting the stack again.