The audio-video merging operator is based on FFmpeg and performs sequential concatenation, duration adjustment, and final synthesis of the input video and audio materials. The operator supports various input combinations, including one-to-one, one-to-many, many-to-one, and many-to-many. When the total durations of the video and audio are inconsistent, it automatically selects speed adjustment or trims to the shorter duration based on the configuration, and uploads the resulting video and processing mapping file to TOS.
Operator ID: las_video_audio_merge
Sub-items | Performance impact description |
|---|---|
Maximum RPM | 600 |
Maximum concurrency | 10 |
Duration |
|
Subdivision | Detailed requirements |
|---|---|
Supported input data modalities |
|
Input format: Video |
|
Input format: Audio |
|
Input path requirements | Provide input data to the operator via request parameters
|
Subdivision | Detailed requirements |
|---|---|
Output data modalities |
|
Output path: TOS | Specify the storage path for the operator output results via the request parameter
|
Billing standards
Sub-items | Billing standards description |
|---|---|
Billing item | Billing is based on usage calculated from the duration of the input video. |
Billing type | Usage-based billing, unit: |
Unit price | 0.02 CNY/minute |
Billing details
Billing formula: Total cost = unit price * usage
Details | Caution and prerequisites |
|---|---|
Costs | Before calling an operator, you need to understand the model invocation costs associated with using the operator. For details, see Large model invocation billing. |
Authentication (API Key) | Before calling an operator, you need to generate an API Key for operator invocation. It is recommended to configure the API Key as an environment variable to ensure safer operator calls. For details, see Obtain and configure API Key. |
BaseURL | Before calling an operator, you need to determine the BaseURL for operator invocation based on the region where your current LAS service is deployed. This is used to configure the path parameter values for operator calls. |
Invoke the audio-video merge operator to submit an asynchronous task, supporting concatenation of multiple video and audio segments, duration adjustment, and final synthesis.
Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
operator_id | string | Yes | las_video_audio_merge | Operator ID |
operator_version | string | Yes | v1 | Operator version |
data | VideoAudioMergeUserReqParams | Yes | Audio-video merge request parameters | |
video_urls | array | Yes | ["https://example/sample_video_01.mp4", "https://example/sample_video_02.mp4"] | Video input list. Supports http/https, tos://bucket/key. When an element is a TOS directory ending with /, video files in the directory are automatically enumerated. |
audio_urls | array | Yes | ["https://example/sample_audio.mp3"] | Audio input list. Supports http/https, tos://bucket/key. |
output_tos_path | string | Yes | tos://bucket/output/ | Output root directory. The operator will automatically append task-related subdirectories under this directory to save results. |
output_basename | string | No | merged_result | Output file base name. Final output { output_basename}.mp4 and { output_basename}_mapping.json; generated automatically by default. |
video_durations | array | No | [5.0, 5.0] | Target duration (seconds) for each video segment. The list length must match the number of video inputs, and each duration must be greater than 0. |
audio_durations | array | No | [5.0, 5.0] | Target duration (seconds) for each audio segment. The list length must match the number of audio inputs, and each duration must be greater than 0. |
max_speed_ratio | float | No | 1.25 | The maximum speed adjustment ratio allowed for audio-video alignment, value range 1.0 ~ 3.0, default 1.25. When the difference in audio and video duration exceeds this range, the operator will fall back to trimming based on the shorter side, rather than continuing to significantly adjust the speed. |
speed_control_target | string | No | video | The side that is prioritized for adjustment. Optional values: video, audio; default: audio. |
Parameter | Type | Example value | Description |
|---|---|---|---|
metadata | metadata | Request metadata | |
task_id | string | task-xxx | Task ID in asynchronous mode, used for job status queries. |
task_status | string | PENDING | Task status in asynchronous mode.
|
business_code | string | 0 | Business code. |
error_msg | string | If an exception occurs, detailed error information will be returned. |
# Please set OUTPUT_TOS_PATH to a tos path writable by your account export OUTPUT_TOS_PATH="tos://path/to/merge_results" curl --location "https://operator.las.ap-southeast-1.volces.com/api/v1/submit" --header "Content-Type: application/json" --header "Authorization: Bearer $LAS_API_KEY" --data '{ "operator_id": "las_video_audio_merge", "operator_version": "v1", "data": { "video_urls": [ "https://las-demo.tos-cn-beijing.volces.com/las_video_audio_merge/v1/videos/seg_001_0.000-6.000.mp4", "https://las-demo.tos-cn-beijing.volces.com/las_video_audio_merge/v1/videos/seg_002_6.000-12.000.mp4" ], "audio_urls": [ "https://las-demo.tos-cn-beijing.volces.com/las_video_audio_merge/v1/audio/audio_001.mp3" ], "output_tos_path": "$OUTPUT_TOS_PATH" } }'
{ "metadata": { "task_id": "task-20260323153012-abc123", "task_status": "PENDING", "business_code": "0", "error_msg": "" } }
HttpCode | Error codes | Error message | Description |
|---|---|---|---|
400 | Parameter.Missing | Missing required parameter | Missing required parameter. |
400 | Parameter.Invalid | invalid parameter | Invalid parameter. |
400 | Url.Invalid | invalid url | Invalid input address. |
400 | Video.Invalid | invalid video file | Video file is invalid or cannot be decoded. |
400 | Video.DownloadFailed | Video download failed | Video download failed. |
400 | Video.FormatUnsupported | Video format not supported | Video format not supported. |
400 | Video.Timeout | Video processing timeout | FFmpeg processing timed out. |
400 | Video.UploadFailed | Video upload failed | Failed to upload synthesized video. |
400 | Video.DurationTooShort | Video duration is too short | Video duration is too short. |
400 | Audio.DownloadFailed | Audio download failed | Audio download failed. |
400 | Audio.FormatUnsupported | Audio format not supported | Audio format not supported. |
400 | Audio.UploadFailed | Audio upload failed | Failed to upload audio or mapping file. |
400 | Tos.AccessFailed | Failed to access TOS path with provided credentials | Failed to access TOS. |
400 | Task.NotFound | Task not found | Task does not exist. |
500 | InternalError | Internal server error | Internal server error. |
Invoke the audio-video merge operator to submit an asynchronous task, supporting concatenation of multiple video and audio segments, duration adjustment, and final synthesis.
Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
operator_id | string | is | las_video_audio_merge | Operator ID |
operator_version | string | is | v1 | Operator version |
task_id | string | is | task-xxx | Task ID |
Parameter | Type | Example value | Description |
|---|---|---|---|
metadata | metadata | Request metadata | |
task_id | string | task-xxx | Task ID in asynchronous mode. |
task_status | string | COMPLETED | Task status in asynchronous mode.
|
submit_time | string | 2026-07-21T16:04:06+08:00 | Task submission time, in ISO 8601 timestamp format. |
end_time | string | 2026-07-21T16:04:06+08:00 | Task end time, in ISO 8601 timestamp format. |
business_code | string | 0 | Business code. |
error_msg | string | If an exception occurs, detailed error information will be returned. | |
data | VideoAudioMergeResponse | Returned data | |
output_video_path | string | tos://bucket/output/123/trace/hash/merged_result.mp4 | TOS address of the merged video. |
output_video_url | string | https://video.mp4 | Pre-signed URL for the merged video, valid for 24 hours. |
mapping_json_path | string | tos://bucket/output/123/trace/hash/merged_result_mapping.json | Address of the mapping JSON file, which records the input materials, duration, and final alignment strategy. |
curl --location "https://operator.las.ap-southeast-1.volces.com/api/v1/poll" --header "Content-Type: application/json" --header "Authorization: Bearer $LAS_API_KEY" --data '{ "operator_id": "las_video_audio_merge", "operator_version": "v1", "task_id": "task-20260323153012-abc123" }'
{ "metadata": { "task_id": "task-20260323153012-abc123", "task_status": "COMPLETED", "submit_time": "2026-07-21T16:04:06+08:00", "end_time": "2026-07-21T16:04:06+08:00", "business_code": "0", "error_msg": "" }, "data": { "output_video_path": "tos://path/to/merge_results/123456/trace-20260323-abc123/4d8d4a3f0a3c1d2e_1742726400/merged_result.mp4", "mapping_json_path": "tos://path/to/merge_results/123456/trace-20260323-abc123/4d8d4a3f0a3c1d2e_1742726400/merged_result_mapping.json" } }