Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Android 15 memperkenalkan Mode Eksposur Otomatis (AE) Peningkatan Cahaya Rendah, mode
eksposur otomatis baru yang tersedia untuk Camera 2 dan ekstensi kamera
mode malam. Mode AE Peningkatan Cahaya Redup secara otomatis menyesuaikan kecerahan
streaming Pratinjau dalam kondisi cahaya redup. Hal ini berbeda dengan cara ekstensi kamera
mode malam membuat gambar diam, karena mode malam menggabungkan serangkaian
foto untuk membuat satu gambar yang ditingkatkan. Meskipun mode malam berfungsi sangat baik
untuk membuat gambar diam, mode ini tidak dapat membuat aliran frame yang berkelanjutan, tetapi
Mode AE Pengoptimalan Cahaya Redup dapat melakukannya. Dengan demikian, Mode AE Low Light Boost memungkinkan kemampuan
kamera baru, seperti berikut:
Memberikan pratinjau gambar yang ditingkatkan, sehingga pengguna dapat lebih baik membingkai
gambar dalam kondisi cahaya redup.
Memindai kode QR dalam kondisi cahaya redup.
Jika Anda mengaktifkan Mode AE Peningkatan Cahaya Redup, mode ini akan otomatis aktif saat ada
tingkat cahaya rendah, dan nonaktif saat ada lebih banyak cahaya.
Aplikasi dapat merekam dari streaming Pratinjau dalam kondisi cahaya redup untuk menyimpan
video yang lebih terang.
Anda dapat menggunakan Mode AE Peningkatan Cahaya Redup di Camera2 atau melalui ekstensi
kamera. Dokumen ini membahas cara menggunakan Mode AE Pengoptimalan Cahaya Redup dengan
Camera2. Anda juga dapat menggunakan Mode AE Peningkatan Cahaya Redup dengan ekstensi kamera Mode
Malam jika didukung oleh perangkat.
Memeriksa ketersediaan
Sebelum menggunakan Mode AE Peningkatan Cahaya Redup, pastikan mode tersebut didukung di perangkat.
Jika tersedia, Mode AE Peningkatan Cahaya Redup adalah salah satu mode eksposur yang tercantum
di camera2.CameraCharacteristics.CONTROL_AE_AVAILABLE_MODES. (Peningkatan
Cahaya Redup adalah setelan eksposur otomatisnya sendiri, karena setelan eksposur otomatis lainnya
tidak kompatibel dengan kecerahan pratinjau yang dilakukan oleh Mode
AE Peningkatan Cahaya Redup.)
Untuk mengaktifkan Mode AE Low Light Boost dalam sesi Camera2, tetapkan
CaptureRequest.CONTROL_AE_MODE ke
ON_LOW_LIGHT_BOOST_BRIGHTNESS_PRIORITY. Setelah melakukannya, Anda harus
mengonfirmasi bahwa Mode AE Low Light Boost telah diaktifkan; Anda dapat melakukannya dengan mencentang
kolom CaptureResult.CONTROL_AE_MODE. Anda perlu memeriksanya karena Low
Light Boost tidak kompatibel dengan semua konfigurasi kamera. Misalnya,
perekaman kecepatan tinggi tidak mendukung Mode AE Low Light Boost, karena pertimbangan
FPS. Jika Mode AE Low Light Boost tidak diaktifkan, Anda mungkin perlu
mengubah konfigurasi kamera dan mencoba lagi.
Kotlin
valcaptureRequestBuilder=camera.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW)if(isLowLightBoostAvailable(cameraId)){captureRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE,CameraMetadata.CONTROL_AE_MODE_ON_LOW_LIGHT_BOOST_BRIGHTNESS_PRIORITY)}// other capture request paramssession.setRepeatingRequest(captureRequestBuilder.build(),object:CaptureCallback(){@OverridefunonCaptureCompleted(session:CameraCaptureSession,request:CaptureRequest,result:TotalCaptureResult){// verify Low Light Boost AE Mode AE mode set successfullyresult.get(CaptureResult.CONTROL_AE_MODE)==CameraMetadata.CONTROL_AE_MODE_ON_LOW_LIGHT_BOOST_BRIGHTNESS_PRIORITY}},cameraHandler)
Java
CaptureRequest.BuildercaptureRequestBuilder=mCamera.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW);if(isLowLightBoostAvailable(cameraId)){captureRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE,CameraMetadata.CONTROL_AE_MODE_ON_LOW_LIGHT_BOOST_BRIGHTNESS_PRIORITY);}// other capture request paramsmSession.setRepeatingRequest(captureRequestBuilder.build(),newCaptureCallback(){@OverridepublicvoidonCaptureCompleted(CameraCaptureSessionsession,CaptureRequestrequest,TotalCaptureResultresult){// verify Low Light Boost AE Mode AE mode set successfullyresult.get(CaptureResult.CONTROL_AE_MODE)==CameraMetadata.CONTROL_AE_MODE_ON_LOW_LIGHT_BOOST_BRIGHTNESS_PRIORITY;}},mCameraHandler);
Memantau Mode AE Peningkatan Cahaya Redup
Mode AE Peningkatan Cahaya Rendah mencerahkan streaming pratinjau dalam kondisi cahaya redup,
dan tidak berpengaruh jika lingkungan sudah cukup terang untuk
perekaman normal. Anda dapat mengonfirmasi apakah Mode AE Low Light Boost saat ini
aktif dengan memeriksa kolom CaptureResult.CONTROL_LOW_LIGHT_BOOST_STATE.
Jika Anda telah mengaktifkan Mode AE Peningkatan Cahaya Redup dan saat ini aktif, kolom akan ditetapkan ke CameraMetadata.CONTROL_LOW_LIGHT_BOOST_STATE_ACTIVE.
Kemudian, Anda dapat menampilkan ikon bulan atau beberapa indikasi lain bahwa pratinjau
telah diperjelas.
Kotlin
session.setRepeatingRequest(captureRequestBuilder.build(),object:CaptureCallback(){@OverridefunonCaptureCompleted(session:CameraCaptureSession,request:CaptureRequest,result:TotalCaptureResult){// check if Low Light Boost AE Mode is active or inactiveif(result.get(CaptureResult.CONTROL_LOW_LIGHT_BOOST_STATE)==CameraMetadata.CONTROL_LOW_LIGHT_BOOST_STATE_ACTIVE){// Low Light Boost AE Mode state is active// Show Moon Icon}else{// Low Light Boost AE Mode state is inactive or AE mode is not set// to Low Light Boost AE Mode// Hide Moon Icon}}},cameraHandler)
Java
mSession.setRepeatingRequest(captureRequestBuilder.build(),newCaptureCallback(){@OverridepublicvoidonCaptureCompleted(CameraCaptureSessionsession,CaptureRequestrequest,TotalCaptureResultresult){// check if Low Light Boost AE Mode is active or inactiveif(result.get(CaptureResult.CONTROL_LOW_LIGHT_BOOST_STATE)==CameraMetadata.CONTROL_LOW_LIGHT_BOOST_STATE_ACTIVE){// Low Light Boost AE Mode state is active// Show Moon Icon}else{// Low Light Boost AE Mode state is inactive or AE mode is not set// to Low Light Boost AE Mode// Hide Moon Icon}}},mCameraHandler);
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-27 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-27 UTC."],[],[],null,["# Low Light Boost Auto Exposure Mode\n\nAndroid 15 introduces *Low Light Boost Auto Exposure (AE) Mode* , a new\nauto-exposure mode available to both [Camera 2](/media/camera/camera2) and the [night mode camera\nextension](/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_NIGHT). Low Light Boost AE Mode automatically adjusts the brightness of\nthe Preview stream in low-light conditions. This is different from how the night\nmode camera extension creates still images, because night mode combines a burst\nof photos to create a single, enhanced image. While night mode works very well\nfor creating a still image, it can't create a continuous stream of frames, but\nLow Light Boost AE Mode can. Thus, Low Light Boost AE Mode enables new camera\ncapabilities, such as the following:\n\n- Providing an enhanced image preview, so users are better able to frame their low-light pictures.\n- Scanning QR codes in low light.\n\nIf you enable Low Light Boost AE Mode, it automatically turns on when there's a\nlow light level, and turns off when there's more light.\n\nApps can record off the Preview stream in low-light conditions to save a\nbrightened video.\n| **Note:** Because Low Light Boost AE Mode uses a different mechanism than night mode still capture, the two images won't look identical. Night mode still capture provides a better result when you just want to capture a single image, but Low Light Boost AE Mode is able to show you enhanced images in real time.\n\nYou can use Low Light Boost AE Mode either in [Camera2](/media/camera/camera2) or through [camera\nextensions](/media/camera/camera2/extensions-api). This document covers how to use Low Light Boost AE Mode with\nCamera2. You can also use Low Light Boost AE Mode with the Night Mode camera\nextension if it is supported by the device.\n\nCheck for availability\n----------------------\n\nBefore using Low Light Boost AE Mode, check that it's supported on the device.\nIf it's available, Low Light Boost AE Mode is one of the exposure modes listed\nin [`camera2.CameraCharacteristics.CONTROL_AE_AVAILABLE_MODES`](/reference/android/hardware/camera2/CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES). (Low Light\nBoost is its own auto exposure setting, since other auto exposure settings\naren't compatible with the preview brightening performed by Low Light Boost AE\nMode.)\n\nSo, to check if Low Light Boost AE Mode is available, call\n[`CameraCharacteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_MODES)`](/reference/android/hardware/camera2/CameraCharacteristics#get(android.hardware.camera2.CameraCharacteristics.Key%3CT%3E))\nand check if the returned modes include [`ON_LOW_LIGHT_BOOST_BRIGHTNESS_PRIORITY`](/reference/android/hardware/camera2/CameraMetadata#CONTROL_AE_MODE_ON_LOW_LIGHT_BOOST_BRIGHTNESS_PRIORITY): \n\n### Kotlin\n\n```kotlin\nval characteristics = cameraManager.getCameraCharacteristics(cameraId)\nval autoExposureModes =\n characteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_MODES)!!\nval lowLightBoostSupported = autoExposureModes.contains(\n CameraMetadata.CONTROL_AE_MODE_ON_LOW_LIGHT_BOOST_BRIGHTNESS_PRIORITY)\n\nif (lowLightBoostSupported) {\n // Enable Low Light Boost AE Mode (next section)\n} else {\n // Proceed without Low Light Boost AE Mode\n}\n```\n\n### Java\n\n```java\nCameraCharacteristics characteristics =\n mCameraManager.getCameraCharacteristics(cameraId);\nint[] autoExposureModes =\n characteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_MODES);\nboolean lowLightBoostSupported = autoExposureModes.contains(\n CameraMetadata.CONTROL_AE_MODE_ON_LOW_LIGHT_BOOST_BRIGHTNESS_PRIORITY);\n\nif (lowLightBoostSupported) {\n // Enable Low Light Boost AE Mode (next section)\n} else {\n // Proceed without Low Light Boost AE Mode\n}\n```\n\nEnable Low Light Boost AE Mode\n------------------------------\n\nTo enable Low Light Boost AE Mode in a Camera2 session, set\n[`CaptureRequest.CONTROL_AE_MODE`](/reference/android/hardware/camera2/CaptureRequest#CONTROL_AE_MODE) to\n[`ON_LOW_LIGHT_BOOST_BRIGHTNESS_PRIORITY`](/reference/android/hardware/camera2/CameraMetadata#CONTROL_AE_MODE_ON_LOW_LIGHT_BOOST_BRIGHTNESS_PRIORITY). After you do so, you'll need to\nconfirm that Low Light Boost AE Mode was turned on; you can do this by checking\nthe [`CaptureResult.CONTROL_AE_MODE`](/reference/android/hardware/camera2/CaptureResult#CONTROL_AE_MODE) field. You need to check because Low\nLight Boost is not compatible with all camera configurations. For example,\nhigh-speed recording doesn't support Low Light Boost AE Mode, due to FPS\nconsiderations. If Low Light Boost AE Mode is not turned on, you may need to\nchange the camera configuration and try again. \n\n### Kotlin\n\n```kotlin\nval captureRequestBuilder = camera.createCaptureRequest(\n CameraDevice.TEMPLATE_PREVIEW)\nif (isLowLightBoostAvailable(cameraId)) {\n captureRequestBuilder.set(\n CaptureRequest.CONTROL_AE_MODE,\n CameraMetadata.CONTROL_AE_MODE_ON_LOW_LIGHT_BOOST_BRIGHTNESS_PRIORITY\n )\n}\n// other capture request params\n\nsession.setRepeatingRequest(\n captureRequestBuilder.build(),\n object : CaptureCallback() {\n @Override\n fun onCaptureCompleted(session: CameraCaptureSession,\n request: CaptureRequest, result: TotalCaptureResult) {\n // verify Low Light Boost AE Mode AE mode set successfully\n result.get(CaptureResult.CONTROL_AE_MODE) ==\n CameraMetadata.CONTROL_AE_MODE_ON_LOW_LIGHT_BOOST_BRIGHTNESS_PRIORITY\n }\n },\n cameraHandler\n)\n```\n\n### Java\n\n```java\nCaptureRequest.Builder captureRequestBuilder =\n mCamera.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW);\nif (isLowLightBoostAvailable(cameraId)) {\n captureRequestBuilder.set(\n CaptureRequest.CONTROL_AE_MODE,\n CameraMetadata.CONTROL_AE_MODE_ON_LOW_LIGHT_BOOST_BRIGHTNESS_PRIORITY);\n}\n// other capture request params\n\nmSession.setRepeatingRequest(\n captureRequestBuilder.build(),\n new CaptureCallback() {\n @Override\n public void onCaptureCompleted(CameraCaptureSession session,\n CaptureRequest request, TotalCaptureResult result) {\n // verify Low Light Boost AE Mode AE mode set successfully\n result.get(CaptureResult.CONTROL_AE_MODE) ==\n CameraMetadata.CONTROL_AE_MODE_ON_LOW_LIGHT_BOOST_BRIGHTNESS_PRIORITY;\n }\n },\n mCameraHandler\n);\n```\n\nMonitor Low Light Boost AE Mode\n-------------------------------\n\nLow Light Boost AE Mode brightens the preview stream in low-light conditions,\nand doesn't have any effect if the environment is already bright enough for\nnormal capture. You can confirm whether Low Light Boost AE Mode is currently\nactive by checking the [`CaptureResult.CONTROL_LOW_LIGHT_BOOST_STATE`](/reference/android/hardware/camera2/CaptureResult#CONTROL_LOW_LIGHT_BOOST_STATE) field.\nIf you've turned Low Light Boost AE Mode on *and* it's currently active, the\nfield is set to\n[`CameraMetadata.CONTROL_LOW_LIGHT_BOOST_STATE_ACTIVE`](/reference/android/hardware/camera2/CameraMetadata#CONTROL_LOW_LIGHT_BOOST_STATE_ACTIVE).\nYou might then show a moon icon or some other indication that the preview is\nbeing brightened. \n\n### Kotlin\n\n```kotlin\nsession.setRepeatingRequest(\n captureRequestBuilder.build(),\n object : CaptureCallback() {\n @Override\n fun onCaptureCompleted(session: CameraCaptureSession,\n request: CaptureRequest, result: TotalCaptureResult) {\n // check if Low Light Boost AE Mode is active or inactive\n if (result.get(CaptureResult.CONTROL_LOW_LIGHT_BOOST_STATE) ==\n CameraMetadata.CONTROL_LOW_LIGHT_BOOST_STATE_ACTIVE) {\n // Low Light Boost AE Mode state is active\n // Show Moon Icon\n } else {\n // Low Light Boost AE Mode state is inactive or AE mode is not set\n // to Low Light Boost AE Mode\n // Hide Moon Icon\n }\n }\n },\n cameraHandler\n)\n```\n\n### Java\n\n```java\nmSession.setRepeatingRequest(\n captureRequestBuilder.build(),\n new CaptureCallback() {\n @Override\n public void onCaptureCompleted(CameraCaptureSession session,\n CaptureRequest request, TotalCaptureResult result) {\n // check if Low Light Boost AE Mode is active or inactive\n if (result.get(CaptureResult.CONTROL_LOW_LIGHT_BOOST_STATE) ==\n CameraMetadata.CONTROL_LOW_LIGHT_BOOST_STATE_ACTIVE) {\n // Low Light Boost AE Mode state is active\n // Show Moon Icon\n } else {\n // Low Light Boost AE Mode state is inactive or AE mode is not set\n // to Low Light Boost AE Mode\n // Hide Moon Icon\n }\n }\n },\n mCameraHandler\n);\n```"]]