SaaS · APIs · Cybersecurity
डेवलपर्स के लिए वीडियो कॉन्कैटिनेशन API: REST से MP4, MOV और AVI जोड़ें
डेवलपर्स के लिए वीडियो कॉन्कैटिनेशन API: REST से MP4, MOV और AVI जोड़ें
वीडियो pipelines को अक्सर एक से अधिक source से assets मिलते हैं। Mobile application MP4 upload कर सकती है, camera integration MOV दे सकता है और archive में AVI या MPEG बचा हो सकता है। जब अगला system एक predictable media file चाहता है, तो हर integration team को inputs inspect, normalize, concatenate और download योग्य result expose करना पड़ता है। VideoConcat यह क्षमता asynchronous REST video concatenation API के रूप में देता है।
Endpoint और request model
Authenticated client POST /api/files/start-process पर multipart request भेजता है। actionName=VideoConcat रखें, 2 से 15 video files को file0 से file14 में भेजें और public examples की तरह parameters=[] तथा async=true दें। Public URLs fileUrl में | से अलग करके भेजे जा सकते हैं; uploads और URLs साथ भी चल सकते हैं। पूरे examples और response contract के लिए VideoConcat API documentation देखें।
पहला response process record होता है, finished media नहीं। उसका id और trackingUrl बचाएँ और उसी Bearer JWT से /api/actions/get-action-infos/{id} poll करें। इससे normalization और encoding के दौरान HTTP request खुली रखने की जरूरत नहीं होती।
Asynchronous contract क्यों उपयोगी है
छोटा compatible set जल्दी पूरा हो सकता है, जबकि बड़े, लंबे या high-resolution sources को अधिक काम चाहिए। Asynchronous merge-videos API application को request स्वीकार करने, process ID रखने और status endpoint से अपना job state update करने देती है। Queue worker उस web request से स्वतंत्र रूप से काम पूरा कर सकता है जिसने उसे शुरू किया था।
Process ID को status reference समझें, authorization का प्रमाण नहीं। Status और download दोनों में authenticated user context बनाए रखें और server के result links इस्तेमाल करें। केवल integer ID जानने से किसी caller को result नहीं मिलना चाहिए।
Predictable output
Assembly से पहले VideoConcat हर source को common media profile में normalize करता है। यह 3GP, AVI, FLV, M4V, MKV, MOV, MP4, MPEG, MPG, OGV, TS, WebM और WMV स्वीकार करता है और एक request में अलग extensions मिला सकता है। Output का लक्ष्य 1920×1080 तक common resolution, 30 frames per second, H.264 video और AAC audio है। अलग aspect ratios में letterboxing framing बचाता है; बिना audio input में silent audio track जोड़ा जाता है।
सफल response एक downloadable MP4 देता है, इसलिए transcoding queue, asset manager, publishing workflow या customer portal को handoff सरल होता है। आपकी application को फिर भी clips का business meaning जाँचना और captions, branding या further editing की जरूरत तय करनी होगी। API concatenation और normalization हल करती है, editorial approval नहीं।
Validation और ownership
Server-side validation input count, वास्तविक media content, MIME information, ownership और limits जाँचती है। हर video 100 MB और 10 minutes तक सीमित है; पूरे request की सीमा 1 GB और 30 minutes है और इसमें 2 से 15 videos होने चाहिए। ये नियम filename, JavaScript या browser के declared content type पर निर्भर नहीं हैं।
clip.mp4 नाम यह साबित नहीं करता कि bytes valid MP4 हैं और file picker authorization boundary नहीं है। Authenticated account की files भेजें, JWT सुरक्षित रखें और stable validation errors को input failures की तरह handle करें, अनंत retry की तरह नहीं। Public URLs वही हों जिन्हें आपकी application process कर सकती है।
Usage-based price और retry behavior
Successful treatment 15 tokens का है और validation failure billed नहीं होती। Job system में rejected request, in-progress process, failed processing और successful result को अलग रखें। Polling timeout के कारण दूसरा process शुरू न करें; पहले existing process status लें।
Process identifier store करें और bounded polling तथा उपयुक्त backoff इस्तेमाल करें। Success मिलने पर result reference save करें और authenticated result flow से download करें। अपने webhook या queue को duplicate notification मिलने पर idempotent बनाना भी जरूरी है।
कहाँ उपयोग करें
Typical integrations में customer-uploaded clips जोड़ना, camera fragments की review copy बनाना, CMS के लिए एक handoff file तैयार करना और public training segments archive करना शामिल हैं। Service अलग upload paths से आए MP4 और MOV स्वीकार कर सकती है, बिना user को FFmpeg या desktop editor सीखने पर मजबूर किए।
Multipart examples, status response और downloadable-result details के लिए VideoConcat REST documentation पढ़ें। जब आपको MP4, MOV, AVI या अन्य supported source को एक normalized MP4 में जोड़ना हो, यह छोटा और trackable asynchronous contract उपयोगी है।