# 建立一個新的示範專案並返回其專案 URL/ID。
curl -XPOST \
-H "Content-type: application/json" \
--user demo-cloud:demo-password \
-d '{
"name": "Example Project",
"width": 1920, "height": 1080,
"fps_num": 30, "fps_den": 1,
"sample_rate": 44100, "channels": 2,
"json": {}
}' \
'https://cloud.openshot.org/projects/'
# 將上傳的媒體作為剪輯新增到專案的時間軸上。
curl -XPOST \
-H "Content-type: application/json" \
--user demo-cloud:demo-password \
-d '{
"file": "https://cloud.openshot.org/files/INSERT-FILE-ID/",
"position": 0, "start": 0, "end": 10, "layer": 1,
"project": "https://cloud.openshot.org/projects/INSERT-PROJECT-ID/",
"json": {}
}' \
'https://cloud.openshot.org/clips/'
# 透過剪輯 ID 對現有剪輯套用預設動畫。
curl -XPOST \
-H "Content-type: application/json" \
--user demo-cloud:demo-password \
-d '{
"preset": "Zoom In",
"length_in_seconds": "3.0",
"curve": "Ease In"
}' \
'https://cloud.openshot.org/clips/INSERT-CLIP-ID/presets/'
# 使用所選設定開始專案的影片匯出工作。
curl -XPOST \
-H "Content-type: application/json" \
--user demo-cloud:demo-password \
-d '{
"export_type": "video",
"video_format": "mp4", "video_codec": "libx264", "video_bitrate": 8000000,
"audio_codec": "aac", "audio_bitrate": 1920000,
"start_frame": 1, "end_frame": 0,
"project": "https://cloud.openshot.org/projects/INSERT-PROJECT-ID/",
"webhook": "", "json": {}, "status": "pending"
}' \
'https://cloud.openshot.org/exports/'
# 檢查特定匯出工作的狀態(及結果 URL)。
curl -XGET \
-H "Content-type: application/json" \
--user demo-cloud:demo-password \
'https://cloud.openshot.org/exports/INSERT-EXPORT-ID/'
# 下載已完成匯出工作的渲染影片檔案。
curl -L -XGET \
--user demo-cloud:demo-password \
-o generated-video.mp4 \
'https://cloud.openshot.org/exports/INSERT-EXPORT-ID/download/'