विज़न इवेंट वीडियो अपलोड करें
अपने कार्यक्षेत्र में एक वीडियो क्लिप अपलोड करें और उसे एक Vision Event से संलग्न करें, ताकि समीक्षक इसे डैशबोर्ड में चला सकें।
परिचय
एक वीडियो क्लिप दिखाती है कि उस क्षण के आसपास क्या हुआ जब विज़न इवेंट रिकॉर्ड किया गया था—ऐसी बात जो एक स्थिर छवि में छूट सकती है। आप हर इवेंट में अधिकतम चार क्लिप जोड़ सकते हैं। क्लिप डैशबोर्ड के इवेंट विवरण दृश्य में चलती हैं (देखें इवेंट का विवरण देखें).
वीडियो MP4 या MOV फ़ाइलें होनी चाहिए और उनका आकार 3 GB तक हो सकता है। इन्हें आपके Workspace पर अपलोड किया जाता है, किसी Project पर नहीं। ब्राउज़र में चलने वाली MP4 फ़ाइलें जैसी हैं वैसी ही संग्रहीत की जाती हैं। अन्य वीडियो को H.264 MP4 में बदला जाता है; बहुत लंबा वीडियो कन्वर्ज़न में विफल हो सकता है।
एज डिवाइस बैकअप डिवाइस पर रिकॉर्ड की गई क्लिप आपके लिए अपलोड करता है। REST API के ज़रिए इवेंट भेजते समय इस पेज के चरणों का उपयोग करें।
HTTP API
वीडियो जोड़ने के तीन चरण हैं:
अपलोड तैयार करें। आपको एक
videoIdएकsignedUrlऔरrequiredHeaders.वीडियो फ़ाइल भेजने के लिए
PUTअनुरोध का उपयोग करें,signedUrlपर, औरrequiredHeadersमें दिए गए सभी हेडर के साथ। URL 60 मिनट बाद समाप्त हो जाता है।इवेंट बनाएँ में
videoIdकोvideos[].sourceId.
इवेंट बनाने से पहले Roboflow द्वारा वीडियो संसाधित किए जाने की प्रतीक्षा करने की ज़रूरत नहीं है। प्रोसेसिंग पूरी होते ही क्लिप डैशबोर्ड में चलने लगती है। प्रोसेसिंग विफल होने पर इवेंट बना रहता है और डैशबोर्ड वीडियो को विफल दिखाता है। अगर फ़ाइल कभी भेजी ही नहीं जाती, तो वीडियो pending रहता है और डैशबोर्ड उसे प्रोसेसिंग में दिखाता रहता है।
आवश्यक स्कोप: vision-events:write या device:update अपलोड तैयार करने के लिए, और vision-events:read या device:read स्थिति पढ़ने या प्लेबैक URL पाने के लिए।
अपलोड तैयार करें
Create a pending video in the workspace and return a signed URL to PUT the file to. Videos can be up to 3 GB. Reference the returned videoId in an event's videos array. Requires the vision-events:write or device:update scope.
Roboflow API key passed as a Bearer token.
File name of the video.
line-3-clip.mp4MIME type of the video file.
video/mp4Possible values: Upload prepared.
truePut this in videos[].sourceId when you create the event.
Kq4vX8mNp2RtY6wZ1bCdURL to PUT the video file to. It expires after 60 minutes.
https://storage.googleapis.com/...name is missing, contentType is not video/mp4 or video/quicktime, or the body has another field.
Missing or invalid API key.
Insufficient permissions for this resource.
Too many requests. Retry after a short wait.
POST /vision-events/videos/prepare-upload HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 52
{
"name": "line-3-clip.mp4",
"contentType": "video/mp4"
}{
"success": true,
"videoId": "Kq4vX8mNp2RtY6wZ1bCd",
"signedUrl": "https://storage.googleapis.com/...",
"requiredHeaders": {
"x-goog-content-length-range": "1,3221225472",
"x-goog-if-generation-match": "0"
}
}इसके बाद फ़ाइल यहाँ भेजें: signedUrl। requiredHeaders से हर हेडर कॉपी करके अनुरोध में जोड़ें:
इसके बाद PUTके बाद कुछ और करने की ज़रूरत नहीं है। फ़ाइल पहुँचते ही Roboflow वीडियो प्रोसेस करना शुरू कर देता है।
वीडियो को किसी इवेंट से जोड़ें
इवेंट के videoId को videos ऐरे में तब रखें, जब आप Vision Event बनाते हैं या इवेंट का बैच में निर्माण करते हैं.
केवल इस एंडपॉइंट से तैयार किए गए वीडियो ही जोड़े जा सकते हैं। किसी videoId को, जो डेटासेट वीडियो अपलोड से या किसी दूसरे वर्कस्पेस से आया हो, इवेंट में रखा जाता है, लेकिन चेतावनी मिलती है और वह चलता नहीं है।
अपलोड की स्थिति जाँचें
status यह pending होती है—अपलोड तैयार करने के समय से लेकर Roboflow द्वारा फ़ाइल की प्रोसेसिंग पूरी किए जाने तक—और फिर uploaded या failedहो जाती है। जिस वीडियो की फ़ाइल कभी पहुँचती ही नहीं, उसकी स्थिति बनी रहती है pending.
Read the processing status and details of a video prepared for Vision Events. Requires the vision-events:read or device:read scope.
Roboflow API key passed as a Bearer token.
The videoId returned by Prepare a Vision Event Video Upload.
Video status.
Kq4vX8mNp2RtY6wZ1bCdpending from the moment the upload is prepared until Roboflow finishes processing the file, then uploaded or failed. A video whose file is never sent stays pending.
Public URL of a still frame from the video. It returns 404 until status is uploaded.
12.4video/mp418350080line-3-clip.mp4Missing or invalid API key.
Insufficient permissions for this resource.
The video does not exist, belongs to another workspace, or was not prepared for Vision Events.
Too many requests. Retry after a short wait.
GET /vision-events/videos/{videoId} HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"videoId": "Kq4vX8mNp2RtY6wZ1bCd",
"status": "pending",
"posterUrl": "text",
"durationSeconds": 12.4,
"contentType": "video/mp4",
"sizeBytes": 18350080,
"filename": "line-3-clip.mp4"
}प्लेबैक URL प्राप्त करें
क्वेरी के नतीजों में हर वीडियो का केवल sourceId और label दिखता है। किसी वीडियो को चलाने या डाउनलोड करने वाला URL पाने के लिए इस एंडपॉइंट को कॉल करें। URL 60 मिनट तक काम करता है और null तब तक रहता है, जब तक status uploaded नहीं हो जाता। URL रखने वाला कोई भी व्यक्ति क्लिप चला सकता है, इसलिए इसे कैश या साझा न करें।
Return the video's status and details plus a signed URL that plays it. The response is sent with Cache-Control private, no-store. Requires the vision-events:read or device:read scope.
Roboflow API key passed as a Bearer token.
The videoId returned by Prepare a Vision Event Video Upload.
Video status and playback URL.
Kq4vX8mNp2RtY6wZ1bCdpending from the moment the upload is prepared until Roboflow finishes processing the file, then uploaded or failed. A video whose file is never sent stays pending.
Public URL of a still frame from the video. It returns 404 until status is uploaded.
12.4video/mp418350080line-3-clip.mp4Signed URL that plays the video. It expires after 60 minutes. null until status is uploaded.
Missing or invalid API key.
Insufficient permissions for this resource.
The video does not exist, belongs to another workspace, or was not prepared for Vision Events.
Too many requests. Retry after a short wait.
GET /vision-events/videos/{videoId}/url HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"videoId": "Kq4vX8mNp2RtY6wZ1bCd",
"status": "pending",
"posterUrl": "text",
"durationSeconds": 12.4,
"contentType": "video/mp4",
"sizeBytes": 18350080,
"filename": "line-3-clip.mp4",
"url": "text"
}अंतिम अपडेट
क्या यह उपयोगी था?