Record captions
Real-Time STT enables you to record caption text, generate a .vtt file, and store it in the configured cloud storage. These recorded captions are designed for seamless playback alongside audio and video recordings. Additionally, you can use the .vtt file to generate meeting minutes and topic summaries, perform sentiment analysis and content moderation. Caption recording does not incur any additional fees.
This page explains how to record captions and synchronize them with the audio or video files generated by Cloud Recording.
Since Cloud Recording and transcription tasks operate on different servers, you must enable the NTP timestamp for Cloud Recording to synchronize the timestamps with the transcription.
Prerequisites
To follow this procedure, you must:
-
Have a valid Agora Account.
-
Have a valid Agora project with an app ID and a temporary token or a token server. For details, see Agora account management.
-
Have a computer with access to the internet. If your network has a firewall, follow the steps in Firewall requirements.
-
Join a Video SDK channel as a host and start streaming. Refer to the Voice SDK quickstart guide.
-
Make sure Real-Time STT is enabled for your app.
-
Set the
enableNTPtimestampparameter totruein the body of the Cloud Recordingstartrequest to synchronize the timestamps with the transcription.Sample Cloud Recording
startrequest body
Implementation
Follow these steps to record captions and synchronize them with the corresponding recordings for seamless playback.
Record the captions
To record the captions, follow the API call sequence from the REST Quickstart and modify the start request to include caption recording parameters as follows:
Sync the files
The m3u8+vtt file generated by Real-Time STT and the m3u8+ts file generated by Cloud Recording are two independent files, with different time stamps. The Cloud Recording time stamp starts at 0, while Real-Time STT uses the system time stamp. If either process starts abnormally, the media files generated by the two services may be out of sync during playback.
Agora provides a post-processing script that lets you sync the m3u8+ts and m3u8+vtt files. To run this script, take the following steps:
-
Unzip the post-processing script to a local folder.
-
Run the script on your transcription files:
If
ffmpeg/ffprobare not in yourPATH, use-ffmpeg_pathto specify the path. -
Play the synchronized files:
-
Run the following command to start the HTTP server:
-
In your browser, enter the following URL:
-
Supported OSS vendors
vendor: Number. The third-party cloud storage vendor. The following are supported:
1: Amazon S35: Microsoft Azure6: Google Cloud
region: Number. The region information specified for the third-party cloud storage. The service only supports regions in the following lists:
- Amazon S3 (
vendor=1):0:US_EAST_11:US_EAST_22:US_WEST_13:US_WEST_24:EU_WEST_15:EU_WEST_26:EU_WEST_37:EU_CENTRAL_18:AP_SOUTHEAST_19:AP_SOUTHEAST_210:AP_NORTHEAST_111:AP_NORTHEAST_212:SA_EAST_113:CA_CENTRAL_114:AP_SOUTH_115:CN_NORTH_116:CN_NORTHWEST_117:US_GOV_WEST_120:AP_NORTHEAST_321:EU_NORTH_122:ME_SOUTH_123:US_GOV_EAST_124:AP_SOUTHEAST_325:EU_SOUTH_128:IL_CENTRAL_1
- Microsoft Azure (
vendor=5): Theregionparameter has no effect, whether set or not. - Google Cloud (
vendor=6): Theregionparameter has no effect, whether set or not.