Timelapse video recording support in CameraX

44 views
Skip to first unread message

Tomáš Válek

unread,
Dec 18, 2025, 5:50:44 AM12/18/25
to Android CameraX Discussion Group

Hello CameraX team,

I would like to ask whether CameraX currently supports recording timelapse video (e.g. 2×, 5×, 10× speed-up) using the VideoCapture / Recorder API.

Questions:

  1. Is there any official or recommended way to record timelapse video using CameraX?

  2. Are there any planned APIs (e.g. capture rate, frame skipping, time scaling) for timelapse support in upcoming CameraX versions?


Thank you for your clarification and guidance.

Best regards,
Tomáš


Leo Huang

unread,
Dec 21, 2025, 9:26:15 PM12/21/25
to Android CameraX Discussion Group, Tomáš Válek
Thank you for reaching out.

Currently, CameraX does not provide a high-level Timelapse recording  directly within the VideoCapture or Recorder APIs. There is no immediate timeline for an official timelapse feature. You can file a formal feature request on the Public Issue Tracker to help us prioritize this.

Conceptually, to achieve timelapse recording is to build a custom pipeline using ImageAnalysis + MediaCodec + MediaMuxer.

The high-level concept involves three main steps:

1. Frame Sampling: Use ImageAnalysis to receive frames and drop those that do not fall within your desired interval (e.g., capture 1 frame every 1s for a 30x speed-up at 30 FPS playback).

2. Time Scaling: Manually calculate the Presentation Timestamp (PTS) for the MediaCodec input buffers. To the encoder, you present frames at a constant 30 FPS rate, regardless of when they were actually captured.

3. Encoding & Muxing: Pass the sampled YUV data from ImageProxy into a MediaCodec encoder and write the output to a MediaMuxer.

We hope this clarifies the current state and provides a viable path for the implementation

Tomáš Válek 在 2025年12月18日 星期四下午6:50:44 [UTC+8] 的信中寫道:

Tomáš Válek

unread,
Dec 26, 2025, 5:24:40 AM (13 days ago) 12/26/25
to Android CameraX Discussion Group, leoh...@google.com, Tomáš Válek
Thank you for the explanation.

Compared to a full custom pipeline, a much simpler approach would be an API similar to MediaRecorder#setCaptureRate(), allowing developers to configure timelapse behavior directly in CameraX VideoCapture / Recorder.

Has such an API been considered for CameraX?


Dne pondělí 22. prosince 2025 v 3:26:15 UTC+1 uživatel leoh...@google.com napsal:

Leo Huang

unread,
Dec 26, 2025, 10:07:06 PM (12 days ago) 12/26/25
to Tomáš Válek, Android CameraX Discussion Group
Thank you for your suggestion. We haven't considered the API yet. Personally, I feel the name `setCaptureRate` is not clear enough, even though the documentation mentions it's for time-lapse video. I think it would be more intuitive to include "timelapse" in the name of a higher-level API.

Tomáš Válek <tomasva...@gmail.com> 於 2025年12月26日週五 下午6:24寫道:
Reply all
Reply to author
Forward
0 new messages