android / android/camera-samples

No way to mimic AVAssetWriterInput in Android

Open
#359 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
5.5k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

Using CameraX 1.1.0-alpha02, there is not way to minic what iOS does with respect to taking the video buffer, modifying it with CISourceOverCompositing and then use the result to feed AVAssetWriterInput (save the video output). That allows them to easily do things like add overlays to video. We have no way to do that to this day on Android.

Given that we can pass frames to ImageAnalysis, the same mechanism should be able to be done where the final output feed is generated in Android's equivalent of CISourceOverCompositing (sample code available for that many places). It looks like two of the three components already exist then. Android can pull the frame and modify it. We just need a way to use the modified frame as the replacement for the original one in the stream.

So, outputFileOptions needs to be extended to take a frame/bitmap produced by a function (overlay function...the equivalent of CISourceOverCompositing), and then use that in videoCapture.startRecording

Contributor guide

Open the contributing guide

Research direction

Review the CameraX 1.1.0-alpha02 VideoCapture API, especially outputFileOptions and videoCapture.startRecording, alongside the existing ImageAnalysis mechanism. Determine the API design needed to accept modified video frames, and validate that an overlay-processed stream can be saved as video output.

Written by the indexing model from the issue text.

Assessment

Tech stack
android
Domain
mobile
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.