كاميرا.startCapture
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
لبدء التقاط الفيديو أو التقاط الصور بفاصل زمني بناءً على قيمة
captureMode
في الخيارات.
تمت إضافة هذا الأمر في المستوى 2 من واجهة برمجة التطبيقات.
المعلمات
- لا يحتوي هذا الأمر على معلَمة في نص الطلب. ما إذا كانت صورة تمرين متناوب
يتمّ تحديد التقاط الصور أو تصويرها بواسطة خيار
captureMode
.
بالنسبة إلى الالتقاط بفاصل زمني، يعتمد ما إذا كان الالتقاط مفتوحًا أم لا على
ما إذا كانت captureNumber
تساوي 0 أو أكبر منه.
captureMode
وcaptureInterval
و
يجب ضبط captureNumber
قبل الفاصل الزمني.
يجب ضبط captureMode
فقط على "فيديو". قبل الفيديو
الالتقاط، والذي لا يمكن إيقافه إلا باستخدام الأمر camera.stopCapture.
النتائج
- التقاط فيديو بدون انقطاع (عندما يكون drawMode == "video" أو recordNumber == 0)
- التقاط فاصل زمني غير مفتوح:
- fileUrls: قائمة بعناوين URL المطلقة تشير إلى الصورة
من أجل الالتقاط بفاصل زمني. يُرجى ملاحظة أن هذا الأمر لا يعرض
fileUrls
فورًا بعد التقاط الصورة
اكتمل captureNumber
. يمكن تحديد تقدم الأمر
من خلال استطلاع رأي الكاميرا بشكل دوري. على سبيل المثال، الاستطلاع بعد
المدة المقدرة (time = captureInterval * (captureNumber - 1)
)
باستخدام واجهة برمجة التطبيقات /osc/commands/status
وfileUrls
هي النتيجة التي يتم عرضها عند انتهاء الأمر.
إذا لم يكتمل الأمر بنجاح (على سبيل المثال، تم عرض 3 صور فقط من إجمالي الصور)
تم التقاطها قبل نفاد شحن بطارية الكاميرا) أو عندما تكون الكاميرا غير متصلة
من هاتف العميل في المنتصف، ولكن انتهى الأمر بنجاح،
فينبغي أن يكون العميل قادرًا على الحصول على الصور باستخدام
camera.listFiles
لاحقًا عند إجراء اتصال جديد بين العميل والكاميرا.
الأخطاء
- disableCommand: يكون الأمر غير مفعَّل حاليًا. على سبيل المثال، الكاميرا
في منتصف التقاط الفيديو أو الالتقاط بفاصل زمني.
- spamparamName: لم يتم التعرُّف على اسم المَعلمة. على سبيل المثال،
لم يتم التعرّف على
sessionId
.
مفتاح Command I/O |
إدخال الطلب |
none |
مخرجات الأوامر |
{
"results": {
"fileUrls":[
"url1",
"url2",
"url3",
...
"urln"
]
}
} |
مخرجات الأوامر (خطأ) |
{
"error": {
"code": "disabledCommand",
"message": "Command is currently disabled."
}
} |
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2024-08-21 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2024-08-21 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eInitiates either video or interval image capture based on pre-set capture mode.\u003c/p\u003e\n"],["\u003cp\u003eFor interval capture, \u003ccode\u003ecaptureMode\u003c/code\u003e, \u003ccode\u003ecaptureInterval\u003c/code\u003e, and \u003ccode\u003ecaptureNumber\u003c/code\u003e options must be configured beforehand.\u003c/p\u003e\n"],["\u003cp\u003eFor video capture, only \u003ccode\u003ecaptureMode\u003c/code\u003e needs to be set to "video" and can be stopped using the \u003ccode\u003ecamera.stopCapture\u003c/code\u003e command.\u003c/p\u003e\n"],["\u003cp\u003eThe command results for non-open-ended interval capture include a list of image URLs accessible after capture completion, retrievable via polling or \u003ccode\u003ecamera.listFiles\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eErrors like "disabledCommand" occur if the camera is already capturing or "invalidParameterName" if an unrecognized parameter is used.\u003c/p\u003e\n"]]],["This command initiates video or interval image capture based on the `captureMode` setting. For interval capture, `captureNumber` determines if it's open-ended; `captureInterval` and `captureNumber` must be preset. Video capture, set by `captureMode`, is ended via `camera.stopCapture`. Open-ended capture has no immediate results. Non-open-ended interval capture eventually provides a `fileUrls` list, accessible after the completion time or if interrupted. Errors include `disabledCommand` and `invalidParameterName`. The command's input is null, and output results with file URLs.\n"],null,["# camera.startCapture\n\nStarts video capture or interval image capture depending on value of\n`captureMode` in [Options](/streetview/open-spherical-camera/reference/options).\n**This command was added in API level 2.**\n\nParameters\n----------\n\n- This command has no parameter in request body. Whether it is interval image capture or video capture is determined by `captureMode` option. For interval capture, whether it is open ended capture or not depends on whether `captureNumber` is equal to or larger than 0. `captureMode`, `captureInterval` and `captureNumber` need to be set prior to interval capture. Only `captureMode` needs to be set to \"video\" prior to video capture, which can only be stopped by [camera.stopCapture](/streetview/open-spherical-camera/reference/camera/stopcapture) command.\n\nResults\n-------\n\n- Open-ended capture (when captureMode == \"video\" or captureNumber == 0)\n - No results.\n- Non-open-ended interval capture:\n - **fileUrls:** A list of absolute URLs, pointing to image files for interval capture. Please note this command doesn't return `fileUrls` immediately since the capture takes `captureNumber` to complete. The progress of the command can be obtained by polling the camera periodically. For example, poll after an estimated duration (`time = captureInterval * (captureNumber - 1)`) using the [/osc/commands/status](/streetview/open-spherical-camera/guides/osc/commands/status) API and `fileUrls` is the result returned when the command finishes. If the command doesn't finish successfully (e.g. only 3 out of images were taken before the camera runs out of battery) or the camera is disconnected from the client phone in the middle, but the command does finish successfully, the client should be able to obtain the images using the [camera.listFiles](/streetview/open-spherical-camera/reference/camera/listfiles) later when a new connection is established between the client and the camera.\n\nErrors\n------\n\n- **disabledCommand:** Command is currently disabled; for example, the camera is in the middle of a video capture or an interval capture.\n- **invalidParameterName:** The parameter name is unrecognized; for example, `sessionId` is not recognized.\n\n| Command I/O ----------- ||\n|----------------------------|-----------------------------------------------------------------------------------------------------|\n| **Command Input** | ```text none ``` |\n| **Command Output** | ```text { \"results\": { \"fileUrls\":[ \"url1\", \"url2\", \"url3\", ... \"urln\" ] } } ``` |\n| **Command Output (Error)** | ```text { \"error\": { \"code\": \"disabledCommand\", \"message\": \"Command is currently disabled.\" } } ``` |"]]