android / android/media-samples

How to record videos in HEVC in Android

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

Description

I trying to write a simple video app in Android that captures video and saves it locally. Looking at the recorded videos on my device, apparently it uses H264 AVC1 codec by default. I know my particular device supports HEVC (Samsung S10). How can I record videos using H265 (probably first check if it supports HEVC through some API, then do it)?

This is what I use right now to capture video with camera. It doesn't specify the codec to use.

```
private void recordVideo() {
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);

fileUri = getOutputMediaFileUri(MEDIA_TYPE_VIDEO);

// set video quality
intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);

intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); // set the video file name

// start the video capture Intent
startActivityForResult(intent, CAMERA_CAPTURE_VIDEO_REQUEST_CODE);
}
```

Contributor guide

Open the contributing guide

Research direction

Start with the recordVideo method and the MediaStore.ACTION_VIDEO_CAPTURE entry point shown in the issue. Check Android media API documentation for HEVC capability detection and codec selection with this capture flow. Done means documenting whether this intent can request HEVC and identifying the supported API path if it cannot.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.