You need to enable JavaScript to run this app.
Lake AI Service

Lake AI Service

Copy page
Download PDF
Video Restoration
Video restoration
Copy page
Download PDF
Video restoration

Intelligent video restoration operator, based on a multimodal large model to enable intelligent removal of watermarks and subtitles from videos. Supports automatic detection and removal of unwanted content such as watermarks, subtitles, and scrolling subtitles in videos, and outputs the restored video file.

Operator introduction

Operator ID: las_video_inpaint

Core capabilities

  • Supports multiple target removal scenarios: watermarks, subtitles, scrolling subtitles, and more.
  • Intelligent detection based on a multimodal large model, with flexible and accurate target identification and removal processing: precise detection, general detection; pixel_replace (default), pixel_generate.
  • Supports precise subtitle masking, preserving edge details.
  • Supports stable processing of long videos.
  • Automatically retains audio without additional operations.

Effect showcase


[Watermark & subtitle removal]
  • Input video: landscape video - watermark + subtitles

  • Core parameters

    "targets": ["watermark", "subtitle"],
    "detection_precise_mode": "true",
    "inpainting_backend": "pixel_replace"
    
  • Output result

  • Input video: landscape video - dynamic watermark

  • Core parameters

    "targets": ["watermark"],
    "detection_precise_mode": "true",
    "inpainting_backend": "pixel_generate"
    
  • Output result

  • Input video: portrait video - dynamic watermark

  • Core parameters

    "targets": ["watermark"],
    "detection_precise_mode": "true",
    "inpainting_backend": "pixel_generate"
    
  • Output result


[Scrolling subtitle removal]
  • Input video: landscape video - scrolling subtitles

  • Core parameters

    "targets": ["scrolling_subtitle"],
    "detection_precise_mode": "true",
    "inpainting_backend": "pixel_replace"
    
  • Output result

  • Input video: portrait video - scrolling subtitles

  • Core parameters

    "targets": ["scrolling_subtitle"],
    "detection_precise_mode": "true",
    "inpainting_backend": "pixel_replace"
    
  • Output result

Overall, processing results are better for landscape videos.

Supported regions

  • Beijing: cn-beijing
  • Shanghai: cn-shanghai
  • Guangzhou: cn-guangzhou

Operator performance

Subcategory
Performance impact description

Maximum RPM

600

Maximum concurrency

10

Processing time

  • Total processing time depends on video duration, content complexity, and network environment.
  • You can refer to the following logic to estimate the processing time for a single task. The actual processing time may fluctuate depending on content complexity and service load:
    • For the restoration mode pixel_replace: approximately input video duration * 15
    • For the restoration mode pixel_generate: approximately input video duration * 45

Network performance

  • It is recommended to access the TOS source and write TOS results within the Volcano Engine intranet environment to achieve more stable network performance.

Input and output requirements

Input requirements

Subdivision
Detailed description

Supported input data modalities

  • Video

Input format: video

  • Formats: Common video formats such as mp4, mov, avi, and mkv are all supported
  • Size: Supports input of up to 3 hours and 10 GB of video.

Input path requirements

Provide input data to the operator via the request parameter video_url. Currently, two methods are supported: public URL and TOS path.

  • Public URL: A video URL accessible via the public network, in the format http/https.
  • TOS path: After uploading the data to be processed to a TOS Bucket under the same main account and region as the current LAS service, you can provide a TOS path in the format tos://bucket_name/demo.

Output requirements

Subdivision
Detailed description

Output data modality

  • Video

Output path: TOS

Specify the storage path for the operator's output results via the request parameter output_tos_path. Currently, only TOS paths are supported.

  • TOS path: A directory in a TOS Bucket under the same main account and region as the LAS service, with write permissions.

Billing information
  • Billing standards

    Sub-item
    Description of billing standards

    Billing item

    Billing usage is calculated based on the duration of the output video. If the output video frame rate exceeds 30 fps, the duration of the output video will be adjusted by the multiplier of the actual output video frame rate to the base frame rate (30 fps), rounded up.

    Billing type

    Pay-as-you-go, unit: CNY/minute, billed hourly based on actual billing usage.

    Unit price

    The unit price depends on the video detection and video restoration mode you select when using video restoration.

    warning

    • Total payment: In addition to the unit price, the service billing is related to the actual restored video duration and video frame rate.
    • Video restoration does not change the video frame rate, but the duration of the restored video may be shorter than the input video duration.
  • Billing details
    Billing formula: Total cost = Unit price * Billing usage = Unit price * (Video duration * Duration conversion coefficient)

    Sub-scenario
    Unit price
    Billing duration conversion coefficient (per thousand tokens)
    • Standard detection mode - pixel_replace restoration mode, that is:
      • detection_precise_mode :false
      • inpainting_backend:pixel_replace

    1.2 CNY/minute

    • The base billing unit price is based on the billing unit price for the base frame rate of 30 fps.
    • If the output frame rate exceeds 30 fps, the duration of the output video will be adjusted by the multiplier of the actual output video frame rate to the base frame rate (30 fps), rounded up, and billing will be based on the adjusted output video duration.
    • Standard detection mode - pixel_generate restoration mode, that is:
      • detection_precise_mode :false
      • inpainting_backend:pixel_generate

    1.6 CNY/minute

    • Precise detection mode - pixel_replace restoration mode, that is:
      • detection_precise_mode :true
      • inpainting_backend:pixel_replace

    2.8 CNY/minute

    • Precise detection mode - pixel_generate restoration mode, that is:
      • detection_precise_mode :true
      • inpainting_backend:pixel_generate

    3.2 CNY/minute

  • Billing example
    When performing video restoration using the standard detection mode - pixel_replace restoration mode, if the actual output video frame rate is 50 fps and the video duration is 10 minutes:

    • The multiplier of the actual output video frame rate to the base frame rate is 1.6, which is rounded up to 2.0.
    • The actual cost is:
      Total cost = 1.2 CNY/minute * (10 minutes * 2) = 24 CNY.

Caution and prerequisites

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.
For details, see Obtain the Base URL. The Examples below are for reference only; when making actual calls, replace the path values with those corresponding to your region.

REST API call

Submit

Interface description

Call the video inpainting operator to submit a restoration task, supporting intelligent removal of watermarks, subtitles, logos, and other content from video source files on the public network, Volcano Engine intranet, or TOS.

Request parameters

Parameters
Type
Required
Example value
Description
operator_id
string
Yes
`https://example.com/video.mp4`
Operator ID
operator_version
string
Yes
v1
Operator version
data
VideoInpaintUserRequest
Yes
Video restoration request parameters
video_url
string
Yes
`https://example.com/video.mp4`
Downloadable address of the video file. Supports http/https, Volcano Engine TOS (tos://bucket/key).
output_tos_path
string
Yes
tos://bucket/output
The TOS address where the video restoration results are saved. The restored video will be saved to this address. Caution: The region of the TOS bucket must be consistent with the region of the operator's BaseURL.
targets
array
No
["watermark", "subtitle"]
The target types to be erased. The default value is ["watermark", "subtitle"]. Optional values:
  • watermark: watermark
  • subtitle: subtitle
  • scrolling_subtitle: scrolling subtitle.
return_subtitle_bbox
boolean
No
true
Whether to return the subtitle region bbox. Default is true.
detection_precise_mode
boolean
No
false
Whether to enable precise detection mode. Default is True.
inpainting_backend
string
No
pixel_replace
Backend repair algorithm, optional values:
  • pixel_replace (default value)
  • pixel_generate
max_process_frames
integer
No
-1
Maximum number of frames to process. If a value is provided, only that specific number of frames in the video will be processed. For example, if the original video has an fps of 30 and 300 is provided, only 10 seconds of the video will be processed. A value of -1 means no limit. The default is -1.
subtitle_mask_precise
boolean
No
false
Whether to enable precise subtitle masking. The default is false. When set to true, it works well for white and yellow subtitles, but performs poorly for transparent and scrolling subtitles. Enable as needed.
fixed_bboxes
array
No
[[100, 600, 300, 650], [1000, 1000, 1000, 1000]]
Fixed repair area, formatted as [x1, y1, x2, y2]. The coordinate system uses the top-left corner of the video as the origin (0,0). Input values are based on a 1000x1000 coordinate system (that is, the bottom-right corner coordinates are [1000,1000]). The system automatically adjusts the area according to the actual width and height of the video. x1 and y1 represent the coordinates of the top-left corner, and x2 and y2 represent the coordinates of the bottom-right corner. When this parameter is specified, the system will repair only the designated area and will not repair other areas.

Response parameters

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.
  • PENDING, receiving requests
  • RUNNING, running
  • COMPLETED, already completed
  • FAILED, failed
  • TIMEOUT, timed out
business_code
string
0
Business code.
error_msg
string
-
If an exception occurs, detailed exception information will be returned.

Example

Request example

# Set OUTPUT_TOS_PATH to a TOS path writable by this account
export OUTPUT_TOS_PATH="tos://path/to/output"

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_inpaint",
    "operator_version": "v1",
    "data": {
        "video_url": "https://*****/watermark_video.mp4",
        "output_tos_path": "$OUTPUT_TOS_PATH",
        "targets": ["watermark", "subtitle"]
    }
}'

Response example

{
    "metadata": {
        "task_id": "task-20251125163544-abc123",
        "task_status": "PENDING",
        "business_code": "0",
        "error_msg": ""
    }
}

Error code

HttpCode

Error code

Error message

Note

400

Url.Invalid

The url is invalid.

Video link is invalid

400

Video.Invalid

The video file is invalid.

Video file is invalid

400

Video.DurationExceeded

Video duration exceeds maximum limit of 4 hours.

Video duration exceeds the maximum limit

400

Video.FileTooLarge

Video file size exceeds maximum limit of 30GB.

Video file size exceeds the limit

400

Parameter.Invalid

The parameter is invalid.

Invalid parameter

401

Authorization.Missing

Missing Authorization.

Missing authorization

401

ApiKey.InValid

The api key is invalid.

API is invalid

400

Video.DurationTooShort

Video duration is too short, minimum 1 second required.

Video duration too short

400

Video.Timeout

Video processing timeout.

Video processing timeout

500

Internal.ServerError

Internal server error.

Internal server error

Poll

Interface description

Query the execution status and result of the video restoration task.

Request parameters

Parameters

Type

Required

Example value

Note

operator_id

string

Is

las_video_inpaint

Operator ID

operator_version

string

Is

v1

Operator version

task_id

string

Is

task-xxx

Task ID

Response parameters

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.

  • PENDING, task queued for submission
  • RUNNING, running
  • COMPLETED, completed
  • FAILED, failed
  • TIMEOUT, timed out
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 exception information will be returned.
data
VideoInpaintResponse
Returned data
inpainted_video_path
string
tos://bucket/output/video.mp4
Path to the restored video (TOS address).
output_video_url
string
https://video.mp4
Pre-signed link to the restored video, valid for 24 hours.
subtitle_bbox
string
100,200,800,400
Subtitle region bbox (if detected), format: x1,y1,x2,y2, values are pixel coordinates from the original video.

Example

Request example

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_inpaint",
    "operator_version": "v1",
    "task_id": "task-20251125163544-abc123"
}'

Response example

{
    "metadata": {
        "task_id": "task-20251125163544-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": {
        "inpainted_video_path": "tos://bucket/output/video_inpaint/xxx/output.mp4",
        "subtitle_bbox": "120,800,1800,960",
        "resolution": "1920x1080"
    }
}

Error code

HttpStatusCode

Error code

Error message

Description

400

MISSING_REQUIRED_PARAMETER

Missing required parameter.

Missing required parameter

400

INVALID_PARAMETER

Invalid parameter.

Invalid parameter

400

INVALID_URL

Invalid URL.

Invalid URL

400

INVALID_VIDEO_FILE

Invalid video file.

Invalid video file

400

VIDEO_DOWNLOAD_FAILED

Video download failed.

Video download failed

400

VIDEO_FORMAT_UNSUPPORTED

Video format not supported.

Video format not supported

400

VIDEO_TIMEOUT

Video processing timeout.

Video processing timeout

400

VLM_CALL_FAILED

VLM call failed.

VLM call failed

400

VIDEO_UPLOAD_FAILED

Video upload failed.

Video upload failed

400

TOS_ACCESS_FAILED

TOS access failed.

TOS access failed

401

Authorization.Missing

Missing Authorization.

Missing authorization

401

ApiKey.InValid

The api key is invalid.

API is invalid

400

Task.NotFound

Task not found.

Task not found

500

Internal.ServerError

Internal server error.

Internal server error

Last updated: 2026.07.31 14:50:13