Capabilities and Preparation
Use video-repair to intelligently enhance video quality, improve blurriness and image noise, and boost visual clarity and detail expression. When the material and quality improvement goal are clear, process directly; for audio track processing needs, choose the corresponding entry point based on the relevant audio capability.
Invoke the server-side processing capability through the parameters supported by the current CLI; for specific parameters, consult help or contracts. Depends on meitu-kaipai-cli, verified target version 0.1.8, compatible with >=0.1.8 <0.2.0。
On first execution, readPlatform Onboarding, parse the CLI entry point and check the version and tool video-repair --help. When JSON fields or media restrictions are unclear, consult the current tool's entry in kaipai contracts according to the platform instructions; when encountering output parsing, server-side inquiries, or execution exceptions, readRunning and Recovery。
Collect Input
- Obtain one real video file or URL from the current request and attachments; do not repeatedly ask when the information is clear. When there are multiple candidates and the target is unclear, ask; do not automatically choose on the user's behalf; when the user has explicitly authorized processing them one by one, call separately and record the tasks.
- For local materials, use a real readable path; for remote materials, first followPlatform Onboardingto download the original resource, then upload it as a local file. When only a media ID is available, first query the Task of the session it belongs to or the history to obtain the real URL, then download; if that fails, ask the user to download it themselves and provide the local original file.
- When continuing an existing task, add
-r '<session_id>'; for a new task, omit the session. Apply defaults, prepare login, and handle missing inputs according to the platform instructions; consult the current help for optional parameters, and omit them when unspecified. - Retain the original source, the real local path, and the session as recovery inputs. After the user supplements the downloaded file, continue with the original goal; do not treat failed results as source material.
Upload and Submit
Using the resolved CLI entry point, pass the prepared local file as a separate parameter:
kaipai tool video-repair --video-file '<本地视频路径>'
After the CLI validates the file, obtain an owned CDN URL through the built-in Meitu upload pipeline, then submit the task and by default wait for this execution to finish. Do not first call create-room / add-media, and do not construct media placeholder text. Parameter files and standalone pre-checks are used only as needed; for secure parameter passing and cleanup rules, see the platform instructions.
Follow-up and Delivery
- Save the original input,
session_id / room_urland all real Task IDs; continuously read the original command's stdout and stderr separately, and do not open separate polling at the same time. TASK_STATE_COMPLETEDOnly deliver the processing result when the available artifact URL for this run is obtained. HTTP 200, end of stream, exit code 0, orend.reason=resultdo not individually prove completion, and an unknown task status cannot be regarded as success.- Use a native preview/attachment available on the host or a full clickable URL, retain query parameters, and deliver all available Parts one by one; for partial success, deliver the successful parts first. When there is an actual
room_url, attach the session entry point for starting the shoot; do not assemble links from IDs. - When there is a disconnection, timeout, or unknown acceptance status, first query the original session and task; do not automatically resubmit. Only start a new attempt after the failure cause has been fixed and the user has authorized a retry; if downloading the output artifact fails, only resume the download. For specific inquiry, recovery, and local save steps, see the running instructions.