Transcription video
Transcription API converts visual and autio context of the video into text representations. You could transcribe an uploaded vidoe in two ways:
AUDIO
: Transcribing the video's audio content into text.VIDEO
: Transcribing the video's visual content into text.
Host URL
Submit Transcription Task
You can submit a transcription task through this interface with the following options:
- Choose between AUDIO or VIDEO transcription.
- Specify a callback address to receive the transcription results automatically.
- Opt not to use a callback—in this case, you can retrieve the transcription results using the query interface.
POST /api/serve/video/subTranscription
Request Example
import requests
headers = {"Authorization": "Bearer <YOUR_ACCESS_TOKEN>"} # access token
data = {"videoNo": "<VIDEO_NO>","type":"AUDIO/VIDEO","callBackURI":"<CALLBACK>"}
response = requests.post(
"https://mavi-backend.memories.ai/api/serve/video/subTranscription",
headers=headers,
json=data
)
print(response.json())
Replace the placeholders in the code above with your actual values:
YOUR_ACCESS_TOKEN
: Your access token.VIDEO_NO
: The unique video number.AUDIO
orVIDEO
: The transcription type (choose one).CALLBACK
: (Optional) A publicly accessible URL endpoint,
Request Body
{
"videoNo": "string",
"type": "string",
"callBackURI": "string"
}
Name | Location | Type | Required | Description |
---|---|---|---|---|
Authorization | header | string | Yes | authorization token |
videoNo | body | string | Yes | video number |
type | body | string | Yes | transcription type: AUDIO , VIDEO |
callBackURI | body | string | No | callback address |
Response Example
Status code 200
{
"code": "string",
"msg": "string",
"data": {
"taskNo": "string"
}
}
Name | Type | Required | Description |
---|---|---|---|
code | string | true | response code |
msg | string | true | message with response code |
data | object | true | JSON data |
» taskNo | string | true | task number |
GET Transcription Content
You can get the transcription content of the video through this interface, you need to provide the video number.
GET /api/serve/video/getTranscription
Request Example
import requests
headers = {"Authorization": "Bearer <YOUR_ACCESS_TOKEN>"} # access token
data={"taskNo":"<TASK_NO>"}
response = requests.get(
"https://mavi-backend.memories.ai/api/serve/video/getTranscription",
headers=headers,
params=data
)
print(response.json())
Replace the YOUR_ACCESS_TOKEN in the above code as your access token, TASK_NO as your task number, you can get the transcription content of the video through the task number.
Request Parameters
Name | Location | Type | Required | Description |
---|---|---|---|---|
Authorization | header | string | Yes | authorization token |
taskNo | query | string | Yes | task number |
Response Example
If you provide a callback URL when submitting the task, a mesage containing content inside data in the following example will be sent to callback URL automatically to notify the status of the task.
Status code 200
{
"code": "string",
"msg": "string",
"data": {
"status": "FINISH",
"type": "AUDIO",
"videoNo": "videoNo_fd30e4c3700c",
"taskNo": "taskNo_0a3f11298b9e",
"transcriptions": [
{
"id": 0,
"startTime": 0,
"endTime": 0,
"content": "content_0e5150607a47"
}
]
}
}
Name | Type | Required | Description |
---|---|---|---|
code | string | true | response code |
msg | string | true | message with response code |
data | object | true | JSON data |
» taskNo | string | true | task number |
» status | string | true | transcription status: FINISH , UNFINISHED |
» type | string | true | transcription type |
» videoNo | string | true | video number |
» transcriptions | array | true | transcription content |
»» id | number | true | transcription number |
»» startTime | number | true | start time |
»» endTime | number | true | end time |
»» content | string | true | transcription content |