aws-amplify / aws-amplify/amplify-ui-android

[Liveness] Support codec auto-selection

Open
#307 1 comment 0 reactions 0 assignees View on GitHub
feature-request liveness
Dominant language
Kotlin
Stars
25
Forks
18
Avg merge
7d 3h
Merged PRs (30d)
1

Description

### Before opening, please confirm:

- [x] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-ui-android/issues?q=is%3Aissue+).

### Which UI component is this feature-request for?

Liveness

### Please include any relevant guides or documentation you're referencing

_No response_

### Please describe your feature-request in detail.

Liveness 1.9.0 added the ability to specify the video codec to use during the Liveness session. This allows opting-in to using H264 instead of VP8, which can resolve session issues on some devices (see #288).

This option requires explicitly choosing the appropriate video codec to use. This feature request covers adding an "auto select" option, where Liveness itself inspects the available media codecs on the device and chooses which one to use. Liveness could avoid known problematic implementations, such as software encoders for VP8 on Android 10 and below.

Suggested API:

```kotlin
sealed interface VideoCodecSelection {
data class AutoSelect(val prefer: VideoCodec? = null) : VideoCodecSelection
}

sealed interface VideoCodec : VideoCodecSelection {
... existing options
}
```

Usage:
```kotlin
// Use best available encoder
val videoOptions = VideoOptions(codec = AutoSelect())

// Use preferred encoder if available, else choose best available
val videoOptions = VideoOptions(codec = AutoSelect(prefer = VideoCodec.H264))

// Explicitly specify codec is still supported
val videoOptions = VideoOptions(codec = VideoCodec.H264)
```

### Initialization steps (if applicable)

_No response_

### Code Snippet

```kotlin
// Put your code below this line.

```

### Configuration File

_No response_

### Additional information and screenshots

_No response_

Contributor guide

Open the contributing guide

Research direction

The issue names the Liveness component and the VideoOptions, VideoCodecSelection, AutoSelect, and VideoCodec entry points, but no files or tests. Start by tracing how explicit codec selection reaches the Android media encoder. Done means AutoSelect chooses an available codec, honors an available preference with fallback, and preserves explicit codec selection.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
audio-video-rtc, mobile-dev
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.