Mulai 27 Maret 2025, sebaiknya gunakan android-latest-release
, bukan aosp-main
, untuk mem-build dan berkontribusi pada AOSP. Untuk mengetahui informasi selengkapnya, lihat Perubahan pada AOSP.
Stabilisasi pratinjau kamera
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Untuk perangkat yang menjalankan Android 13 atau yang lebih baru, framework
kamera memberikan dukungan untuk stabilisasi video pada streaming pratinjau
dan streaming non-RAW lainnya dalam sesi pengambilan kamera. Fitur ini memungkinkan
aplikasi pihak ketiga memberikan pengalaman apa yang Anda lihat itu yang Anda dapatkan (WYSIWYG)
saat membandingkan antara pratinjau kamera dan rekaman.
Implementasi
Untuk menyediakan fitur ini kepada aplikasi pihak ketiga, produsen
perangkat harus mengiklankan dukungan untuk kunci berikut dan menerapkan
algoritma stabilisasi pratinjau di HAL kamera:
Untuk mengubah setelan default fitur ini, tetapkan nilai default di
template permintaan pengambilan saat membuat permintaan pengambilan menggunakan
createCaptureRequest
.
Untuk implementasi referensi fitur ini, lihat kode untuk
EmulatedCamera
di Cuttlefish di
hardware/google/camera/devices/EmulatedCamera/hwl/EmulatedSensor.cpp
.
Untuk mengetahui detail selengkapnya tentang mode stabilisasi video, lihat
CONTROL_VIDEO_STABILIZATION_MODE
.
Validasi
Untuk menguji implementasi fitur ini, gunakan pengujian CTS dan ITS
berikut:
CTS:
ITS (menguji bidang pandang dan kualitas stabilisasi):
Konten dan contoh kode di halaman ini tunduk kepada lisensi yang dijelaskan dalam Lisensi Konten. Java dan OpenJDK adalah merek dagang atau merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-26 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-07-26 UTC."],[],[],null,["# Camera preview stabilization\n\nFor devices running Android 13 or higher, the camera\nframework provides support for video stabilization on the preview stream\nand other non-RAW streams in camera capture sessions. This feature lets\nthird-party apps provide a *what you see is what you get* (WYSIWYG) experience\nwhen comparing between the camera preview and the recording.\n\nImplementation\n--------------\n\nTo provide third-party apps with this feature, device\nmanufacturers must advertise support for the following keys and implement\npreview stabilization algorithms in the camera HAL:\n\n- [`CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES`](https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES)\n- [`CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION`](https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION)\n\nTo modify the default settings for this feature, assign a default value in the\ncapture request template when creating a capture request using\n[`createCaptureRequest`](https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createCaptureRequest(int,%20java.util.Set%3Cjava.lang.String%3E)).\n\nFor a reference implementation of this feature, see the code for\n`EmulatedCamera` in [Cuttlefish](/docs/devices/cuttlefish) at\n[`hardware/google/camera/devices/EmulatedCamera/hwl/EmulatedSensor.cpp`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/google/camera/devices/EmulatedCamera/hwl/EmulatedSensor.cpp#823).\n\nFor more details on video stabilization modes, see\n[`CONTROL_VIDEO_STABILIZATION_MODE`](https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE).\n\nValidation\n----------\n\nTo test your implementation of this feature, use the following CTS and ITS\ntests:\n\nCTS:\n\n- [`RobustnessTest.java#testMandatoryPreviewStabilizationOutputCombinations`](https://cs.android.com/android/platform/superproject/+/android-latest-release:cts/tests/camera/src/android/hardware/camera2/cts/RobustnessTest.java)\n\nITS (tests field of view and stabilization quality):\n\n- [`scene4/test_preview_Stabilization_fov.py`](/docs/compatibility/cts/camera-its-tests#test_preview_stabilization_fov)\n- [`sensor_fusion/test_preview_stabilization.py`](/docs/compatibility/cts/camera-its-tests#test_preview_stabilization)"]]