Talking Face
POST https://api.newportai.com/api/async/talking_face
Talking Face API could generate a talking avatar from audio and video. The talking avatar is capable of mirroring the facial expressions and vocal tone of a real person,while supporting multiple languages.
- Use Talking Face API to get taskId with POST method.
- Use Polling API to get Talking Face result with POST method.
Request Headers
- Content-TypestringRequiredEnumapplication/json
- AuthorizationstringRequiredBearer authentication format, for example: Bearer
Request Body
- vocalAudioUrlstring
- srcVideoUrlstringRequiredvideo url.
- audioUrlstringRequiredoriginal audio url.
- videoParamsObjectvideo_widthintegerRequiredThe video_width parameter determines the width of the output video. If video_width is set to 0, the generated video will retain the same width as the source video.video_heightintegerRequiredThe video_height parameter determines the height of the output video. If video_height is set to 0, the generated video will retain the same height as the source video.video_enhanceintegerRequiredThe video_enhance parameter improves the clarity and sharpness of faces in the video: 0 for no, 1 for yes.fpsstringOptionalThe fps parameter is optional. If not provided, the generated video will be at 25 fps. If the parameter is set to "original", the generated video will match the fps of the input video. Please note that when using the "original" fps, the billing rate will change from 1 credit/s to (input video fps / 25) * 1 credit/s.
Response
- codeinteger0 success, or error code.
- messagestring"success", or error msg.
- dataobjecttaskIdstringUse the taskId to request the Polling API to retrieve the generated outputs.
Example
Request:
zsh
curl -X POST 'https://api.newportai.com/api/async/talking_face' \
-H "Authorization: Bearer {{key}}" \
-H 'Content-Type: application/json' \
-d '{
"srcVideoUrl": "https://newportai-api-market.s3.amazonaws.com/demo_audio/video_demo.mp4",
"audioUrl": "https://newportai-api-market.s3.amazonaws.com/demo_audio/audio_demo.mp3",
"videoParams": {
"video_width": 0,
"video_height": 0,
"video_enhance": 1
}
}'
Response:
json
{
"code": 0,
"message": "success",
"data": {
"taskId": "b08337dc08d7428daa64b3d5e61b8350"
}
}
Next Step:
Use Polling API to get the result.