الانتقال إلى المحتوى الرئيسي
POST
cURL
استخدم aleph2 لتحرير فيديو مصدر باستخدام Prompt نصي. يعيد الطلب مهمة id؛ استرجع تفاصيل المهمة للحصول على المخرجات النهائية.

إعداد الطلب

  • صادِق باستخدام مفتاح CometAPI API الخاص بك.
  • عيّن model إلى aleph2 وقدّم videoUri لفيديو مدته حتى 30 ثانية.
  • اختياري: ضمّن promptText لوصف التحرير، بطول يتراوح بين 1 و1,000 حرف. يمكنك أيضًا حذفه عند استخدام الإطارات الرئيسية.
  • استبدل عنوان URL للوسائط في المثال بعنوان URL متاح عبر HTTPS. حقول الوسائط تقبل أيضًا معرّفات URI لبيانات Base64 بحجم مُرمّز يصل إلى 5 MB.

إضافة صور إرشادية محددة التوقيت

لتوجيه لحظات معيّنة، وفّر من كائن واحد إلى خمسة كائنات في keyframes. يحتوي كل كائن على uri للصورة وموضع واحد فقط: يجب أن يقع الطابع الزمني للإطار الرئيسي ضمن نافذة التحرير الخاصة به. إذا استخدمت range، فعيّنه في كل إطار رئيسي. بخلاف ذلك، احذف range من كل إطار رئيسي. احذف keyframes عندما لا تحتاج إلى صور إرشادية. تُعامل المصفوفة الفارغة أو null على أنها حذف.

اختيار شكل الإطار وتنسيقه

استخدم targetAspectRatio لطلب التوسيع إلى 16:9، 4:3، 3:2، 1:1، 2:3, 3:4, 9:16، أو 21:9. يُضاف شريط أسود إلى فيديو الإدخال والصور الإرشادية لتلائم هذا الشكل قبل الإنشاء. حقل ratio المهمل اختياري؛ استخدم targetAspectRatio للتحكم في نسبة العرض إلى الارتفاع. إذا كانت قيمة outputFormat هي prores، يمكنك تعيين proresProfile إلى 422، 4444، 422 Proxy, 422 LT, 422 HQ، أو 4444 XQ. ملف التعريف الافتراضي هو 4444. قناة alpha في 4444 و4444 XQ معتمة. احذف proresProfile لتنسيقات المخرجات الأخرى. للحصول على seed صريح لأخذ العينات، استخدم 1 حتى 4294967295. احذف seed للحصول على seed عشوائي؛ وتُعامل 0 على أنها حذف.

استرجاع النتيجة

احفظ id المعاد واستخدم الحصول على مهمة Runway لاسترجاع حالة المهمة. عندما تكون قيمة status هي SUCCEEDED، اقرأ عناوين URL للنتيجة من output. إذا كانت المهمة تفشل، فافحص failure وfailureCode عند وجودهما.

التفويضات

Authorization
string
header
مطلوب

Your CometAPI API key.

الجسم

application/json

Aleph 2 video-editing request.

model
enum<string>
مطلوب

Model ID for this request.

الخيارات المتاحة:
aleph2
videoUri
مطلوب

Input video to edit, with a maximum duration of 30 seconds. Use an accessible HTTPS URL or a Base64 data URI with an encoded size of up to 5 MB.

Required string length: 13 - 2048
Pattern: ^https://
promptText
string

Optional instruction describing the edit, from 1 to 1,000 characters. Can be omitted when using keyframes.

Required string length: 1 - 1000
keyframes
object[] | null

One to five timed guidance images. Each image uses exactly one of seconds or at. Omit when no guidance images are needed; an empty array or null is treated as omission.

Maximum array length: 5

Guidance image positioned using seconds.

targetAspectRatio
enum<string>

Target aspect ratio for expansion. The input video and keyframes are letterboxed to this shape before generation.

الخيارات المتاحة:
16:9,
4:3,
3:2,
1:1,
2:3,
3:4,
9:16,
21:9
ratio
string
مهمل

Deprecated aspect-ratio field. Use targetAspectRatio instead.

seed
integer

Sampling seed. Omit for a random seed; 0 is treated as omission.

النطاق المطلوب: 0 <= x <= 4294967295
outputFormat
enum<string>
مطلوب if proresProfile is set

Output format: mp4 for H.264 MP4, prores for ProRes MOV, png_sequence for a ZIP of PNG frames, or sdr_rec709_10bit for 10-bit Rec.709 HEVC MP4. Omit for mp4.

الخيارات المتاحة:
mp4,
prores,
png_sequence,
sdr_rec709_10bit
proresProfile
enum<string>

ProRes profile. Include only with outputFormat set to prores; omit for 4444. The 4444 and 4444 XQ profiles have an opaque alpha channel.

الخيارات المتاحة:
422,
4444,
422 Proxy,
422 LT,
422 HQ,
4444 XQ
contentModeration
object

Content moderation settings. Omit to use the standard settings.

الاستجابة

The task was created. Save its id for task retrieval.

id
string
مطلوب

Task ID for GET /runwayml/v1/tasks/{id}.

status
string

Task state, when returned.

createdAt
string<date-time>

Task submission timestamp, when returned.

output
string<uri>[]

Result URLs, when returned.

failure
string

Failure explanation, when returned.

failureCode
string

Machine-readable failure code, when returned.

estimatedCost
object

Task estimate metadata, when returned.

cost
object

Task cost metadata, when returned.

آخر تعديل في ٢٢ سبتمبر ٢٠٢٦