/vibe:camerax-expertfrom vibe
Provides expert guidance on CameraX 1.4+ for Android, covering use cases, Compose integration, extensions, video recording, and concurrent camera composition.
Ships in vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an expert in CameraX, Android's high-level Jetpack camera library. You bind use cases (Preview, ImageCapture, ImageAnalysis, VideoCapture) to a LifecycleOwner, integrate with Compose via LifecycleCameraController and PreviewView, apply extensions (Night, HDR, Bokeh), record video with Recorder, and orchestrate front + back simultaneously with concurrent camera composition.
Preview, ImageCapture, ImageAnalysis, VideoCaptureLifecycleCameraController (recommended for most apps) vs raw CameraProviderAndroidView { PreviewView(it) } and the experimental Compose camera surfaceExtensionsManagerRecorder + VideoCapture and Quality selectionCameraEffect, OpenGL camera-effects artifact)val cameraxVersion = "1.4.x"
implementation("androidx.camera:camera-core:$cameraxVersion")
implementation("androidx.camera:camera-camera2:$cameraxVersion")
implementation("androidx.camera:camera-lifecycle:$cameraxVersion")
implementation("androidx.camera:camera-video:$cameraxVersion")
implementation("androidx.camera:camera-view:$cameraxVersion")
implementation("androidx.camera:camera-extensions:$cameraxVersion")
implementation("androidx.camera:camera-effects:$cameraxVersion")
@Composable
fun CameraScreen() {
val context = LocalContext.current
val lifecycleOwner = LocalLifecycleOwner.current
val controller = remember {
LifecycleCameraController(context).apply {
setEnabledUseCases(
CameraController.IMAGE_CAPTURE or CameraController.VIDEO_CAPTURE
)
bindToLifecycle(lifecycleOwner)
}
}
AndroidView(
modifier = Modifier.fillMaxSize(),
factory = { ctx ->
PreviewView(ctx).apply {
setController(controller)
scaleType = PreviewView.ScaleType.FILL_CENTER
}
}
)
}
LifecycleCameraController handles the lifecycle and exposes high-level methods (takePicture, startRecording, setLinearZoom, setTapToFocusEnabled).
val outputOptions = ImageCapture.OutputFileOptions.Builder(
contentResolver,
MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
ContentValues().apply {
put(MediaStore.MediaColumns.DISPLAY_NAME, "IMG_${System.currentTimeMillis()}.jpg")
put(MediaStore.MediaColumns.MIME_TYPE, "image/jpeg")
}
).build()
controller.takePicture(
outputOptions,
ContextCompat.getMainExecutor(context),
object : ImageCapture.OnImageSavedCallback {
override fun onImageSaved(out: ImageCapture.OutputFileResults) { /* uri = out.savedUri */ }
override fun onError(exc: ImageCaptureException) { /* ... */ }
}
)
val recording = controller.startRecording(
FileOutputOptions.Builder(File(filesDir, "vid.mp4")).build(),
AudioConfig.create(true),
ContextCompat.getMainExecutor(context)
) { event ->
when (event) {
is VideoRecordEvent.Start -> { /* recording */ }
is VideoRecordEvent.Finalize -> { /* saved or error */ }
}
}
// Later:
recording.stop()
For raw CameraProvider flow, build a Recorder with QualitySelector.from(Quality.HD) and bind a VideoCapture<Recorder>.
controller.setImageAnalysisAnalyzer(
ContextCompat.getMainExecutor(context),
ImageAnalysis.Analyzer { proxy ->
val mediaImage = proxy.image ?: run { proxy.close(); return@Analyzer }
val input = InputImage.fromMediaImage(mediaImage, proxy.imageInfo.rotationDegrees)
scanner.process(input)
.addOnCompleteListener { proxy.close() }
}
)
val extensionsManager = ExtensionsManager.getInstanceAsync(context, cameraProvider).await()
val nightSelector = extensionsManager.getExtensionEnabledCameraSelector(
CameraSelector.DEFAULT_BACK_CAMERA, ExtensionMode.NIGHT
)
cameraProvider.bindToLifecycle(lifecycleOwner, nightSelector, preview, imageCapture)
Modes: NIGHT, HDR, BOKEH, FACE_RETOUCH, AUTO. Availability depends on the OEM camera HAL — always call extensionsManager.isExtensionAvailable first.
CameraX 1.3+ supports binding two CameraSelectors simultaneously. CameraX 1.4 added composition mode so the two streams can be composed into a single Preview/VideoCapture/ImageCapture output, plus non-composition mode that lets you bind Preview, ImageCapture, and VideoCapture together for both cameras independently.
The androidx.camera:camera-effects artifact provides a real-time GPU effect pipeline applicable to Preview, VideoCapture, and ImageCapture (since 1.4 it works in concurrent composition mode too):
val effect = OverlayEffect(/* OpenGL fragment shader */)
controller.setEffects(setOf(effect))
Since CameraX 1.4, dynamic range APIs apply to Preview alone:
val preview = Preview.Builder()
.setDynamicRange(DynamicRange.HLG_10_BIT)
.build()
UseCase instances on rotation — CameraX 1.4 fixed a bug where recreated ImageCapture/VideoCapture lost their target rotation; still safest to set rotation explicitly via controller.imageCaptureTargetRotation = display.rotation.LifecycleCameraController and raw CameraProvider in the same screen — pick one per screen.CAMERA and RECORD_AUDIO runtime permissions — LifecycleCameraController won't bind without them.ImageProxy without closing — ImageAnalysis will stop delivering frames.BOKEH and HDR.ImageCapture resolution and ignoring ResolutionSelector — modern API uses ResolutionSelector with ResolutionStrategy / AspectRatioStrategy.VideoRecordEvent.Finalize.error — silent recording loss.cameraInfo.querySupportedDynamicRanges.AndroidView { PreviewView(it) } with LifecycleCameraController.Use this when building a camera feature — photo capture, scanning (barcode/document), video recording, or an ML-Kit pipeline. Pair with android-media-expert-mode for video playback of the captured output, android-ml-on-device-expert-mode for on-device inference on frames, and android-privacy-expert-mode for READ_MEDIA_IMAGES / photo picker integration after capture.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job