{"templateId":"api_docs","sharedDataIds":{"apiDocsStore":"api-docs-@l10n/zh-TW/reference/ai_video_object_removal.yaml","sidebar":"sidebar-@l10n/zh-TW/reference/sidebars.yaml"},"props":{"definitionId":"@l10n/zh-TW/reference/ai_video_object_removal.yaml","settings":{"baseUrlPath":"/zh-tw/reference/ai_video_object_removal"},"disableAutoScroll":true,"seo":{"title":"AI 影片物件移除","description":"YouCam API documentation by Perfect Corp. Learn how to use Skin analysis API, Virtual try-on API, Image editing API, and Video generative AI APIs.","siteUrl":"https://docs.perfectcorp.com","keywords":"AI Skin Analysis, AI Clothes, AI Hairstyle, AI Outfits","image":"/assets/favicon.cd6fa4d833b2a573b3c6dae68386b293da205b203402cb0c97b80bd2acc07ea2.8351e24f.png"},"dynamicMarkdocComponents":[],"metadata":{"type":"openapi","title":"AI 影片物件移除","version":"","description":"# 概述\n\n**AI 影片物件移除**\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2025-02-04/webp_537ec670-48c0-49fc-b96b-8073de21a64b.webp)\n\nAI 影片物件移除 API 能無縫移除影片內容中不想要的元素。無論是擠滿遊客的擁擠背景、雜亂的環境（如放著衛生紙與瓶子的桌面），或玻璃表面上令人分心的倒影，API 都能以高準確度與一致性，精準可靠地消除遮罩區域。\n\n\n---\n\n## 整合指南\n\n**1. 準備來源影片與遮罩圖片**\n輸入影片長度不得超過 60 秒，輸出影片的長軸須為 1920 像素或以下，影格率為每秒 30 影格或以下。\n\n\n**2. 上傳檔案**\n透過以下方式請求上傳網址與檔案 ID：\n\n```\nPOST /s2s/v2.0/file\n```\n\n輸入影片：\n\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/webp_video_object_removal_input_edd43a2470.png)\n\n\n參考輸入遮罩：\n\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/webp_video_object_removal_mask_4a1c9fb658.png)\n\n\n**3. 執行 AI 任務**\n\n```\nPOST /s2s/v2.0/task/obj-rem-vid\n```\n\n使用檔案 ID 或圖片網址作為輸入提交任務。回應會回傳 task_id 用於追蹤與取得結果。\n\n\n**4. 取得任務結果**\n\n```\nGET /s2s/v2.0/task/obj-rem-vid/{task_id}\n```\n\n使用任務 ID 追蹤狀態並取得結果。\n\n可設定 [Webhooks](/develop/webhook.md) 在任務完成時接收非同步通知，狀態為 success 或 error。也支援輪詢，重複呼叫任務端點直到狀態從 running 更新為 success 或 error。\n\n僅在任務成功完成時才計費。\n\n\n輸出影片範例：\n\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/webp_video_object_removal_output_eb7670cd9e.png)\n\n\n---\n\n## 檔案規格與錯誤\n\n* 支援的格式與尺寸\n\n|AI 功能|支援的尺寸|支援的檔案大小|支援的格式|\n|  ----  | ----  | ----  | ----  |\n| AI 影片物件移除 | 輸入影片長度不得超過 60 秒，輸出影片的長軸須為 1920 像素或以下，影格率為每秒 30 影格或以下。 | 長度限制：60 秒 | 容器：mov, mp4 <br>影像：MPEG-4, MPEG-4 AVC, <br>音訊：aac, amr, mp3 |\n\n* 錯誤代碼\n\n|錯誤代碼|說明|\n|  ----  | ----  |\n| error_download_video | 下載來源影片錯誤 |\n| error_decode_video | 解碼來源影片錯誤 |\n| error_unsupported_video | 不支援的影片格式 |\n| exceed_max_filesize | 輸入檔案大小超過上限|\n| error_nsfw_content_detected | 在來源檔案中偵測到 NSFW 內容 |\n| error_decode_mask | 解碼遮罩圖片錯誤 |\n| invalid_parameter | 參數值無效|\n\n* 環境與相依性\n\n| 範例程式語言 / 工具 | 建議的執行環境版本 |\n|---|---|\n| cURL | - bash >= 3.2</br>   - curl >= 7.58（現代 TLS/HTTP 支援）</br>   - jq >= 1.6（穩健的 JSON 解析） |\n| Node.js（JavaScript） | Node >= 18（支援全域 fetch） |\n| JavaScript | - Chrome / Edge >= 80</br>   - Firefox >= 74</br>   - Safari >= 13.1 |\n| PHP | PHP >= 7.4（現代 TLS/相容性），ext-curl（建議）或 allow_url_fopen=On + ext-openssl、ext-json |\n| Python | Python >= 3.10（支援 f-strings），requests >= 2.20.0 |\n| Java | Java 11+（支援 HttpClient），Jackson Databind >= 2.12.0 |\n\n---\n\n## 點數消耗\n\n| AI 功能 | 消耗的點數 |\n|---|---|\n| AI 影片物件移除 V2.1 | 2（1 秒）* |\n\n    > *若圖片數量或影片長度無法整除，點數無條件進位。\n\n---\n"},"compilationErrors":[],"markdown":{"partials":{},"variables":{"rbac":{"teams":["anonymous"]},"user":{},"remoteAddr":{"hostname":"docs.perfectcorp.com","port":4000,"ipAddress":"216.73.216.199"},"lang":"zh-TW","env":{"PUBLIC_REDOCLY_BRANCH_NAME":"master"}}},"pagePropGetterError":{"message":"","name":""}},"slug":"/zh-tw/reference/ai_video_object_removal","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}