Record captions
Real-Time STT can record the caption text it produces, generate a .vtt file, and then store it in the cloud storage as configured. Recorded captions are designed for playback with audio and video recordings. The .vtt file can also be used to generate meeting minutes and topic summaries, conduct sentiment analyses and content moderation, and so on. Caption recording entails no additional fees.
Since cloud recording and transcription tasks are running on different servers, enable the ntpTimestamp parameter for cloud recording to sync the time with transcription.
This page explains how to record captions and sync them with the audio or video files generated by Cloud Recording.
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 an RTC channel as a host and start streaming.
-
Make sure Real-Time STT is enabled for your app.
-
Enable
ntpTimestampfor cloud recording.
Implementation
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 S32: Alibaba Cloud3: Tencent Cloud4: Kingsoft Cloud5: Microsoft Azure6: Google Cloud7: Huawei Cloud8: Baidu AI 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
-
Alibaba Cloud (
vendor=2):0:CN_Hangzhou1:CN_Shanghai2:CN_Qingdao3:CN_Beijing4:CN_Zhangjiakou5:CN_Huhehaote6:CN_Shenzhen7:CN_Hongkong8:US_West_19:US_East_110:AP_Southeast_111:AP_Southeast_212:AP_Southeast_313:AP_Southeast_514:AP_Northeast_115:AP_South_116:EU_Central_117:EU_West_118:EU_East_119:AP_Southeast_620:CN_Heyuan21:CN_Guangzhou22:CN_Chengdu23:CN_Nanjing24:CN_Fuzhou25:CN_Wulanchabu26:CN_Northeast_227:CN_Southeast_7
For details, see Alibaba Cloud documentation.
-
Tencent Cloud (
vendor=3):0:AP_Beijing_11:AP_Beijing2:AP_Shanghai3:AP_Guangzhou4:AP_Chengdu5:AP_Chongqing6:AP_Shenzhen_FSI7:AP_Shanghai_FSI8:AP_Beijing_FSI9:AP_Hongkong10:AP_Singapore11:AP_Mumbai12:AP_Seoul13:AP_Bangkok14:AP_Tokyo15:NA_Siliconvalley16:NA_Ashburn17:NA_Toronto18:EU_Frankfurt19:EU_Moscow
-
Kingsoft Cloud (
vendor=4):0:CN_Hangzhou1:CN_Shanghai2:CN_Qingdao3:CN_Beijing4:CN_Guangzhou5:CN_Hongkong6:JR_Beijing7:JR_Shanghai8:NA_Russia_19:NA_Singapore_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. -
Huawei Cloud (
vendor=7):0:CN_North_11:CN_North_42:CN_East_23:CN_East_34:CN_South_15:CN_Southwest_26:AP_Southeast_17:AP_Southeast_28:AP_Southeast_39:AF_South_110:SA_Argentina_111:SA_Peru_112:NA_Mexico_113:SA_Brazil_114:LA_South_215:SA_Chile_1