How to immediately stop video recording?

37 views
Skip to first unread message
Assigned to leoh...@google.com by tah...@google.com

Eugene B

unread,
Nov 27, 2025, 10:49:38 AM (yesterday) Nov 27
to Android CameraX Discussion Group
Hello,

We are facing an issue where our Camera app's process is being killed by Android when a user ejects the SD card from the system settings. This occurs if the app has files open on that card.

Specifically, if a user is recording a video to the SD card and initiates an "Eject" action, Android forcefully terminates our Camera app. According to our logs, the app has approximately 150-200 ms before the system sends a termination signal.

Our question is: Is there a way to immediately stop the video recording and release the acquired file on the SD card within this short window? We need a very fast method to do this, even if it means the last video buffer is not completely written.

Leo Huang

unread,
1:13 AM (13 hours ago) 1:13 AM
to Eugene B, Android CameraX Discussion Group
Hi,

We have a ticket https://issuetracker.google.com/264812009 to trace this requirement and we have a solution for it.

The solution ensures that even if the application is killed during video recording, the partially saved video file will remain playable without requiring an explicit stop command.

Please monitor the provided link for further updates.


Eugene B <eugeneb...@gmail.com> 於 2025年11月27日 週四 下午11:49寫道:
--
You received this message because you are subscribed to the Google Groups "Android CameraX Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camerax-develop...@android.com.
To view this discussion visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/b96ed3b1-f8ed-4445-90fe-bf1c53398cf9n%40android.com.

Eugene B

unread,
4:35 AM (10 hours ago) 4:35 AM
to Android CameraX Discussion Group, leoh...@google.com, Android CameraX Discussion Group, Eugene B
Hi,
It seems this ticket is about a different issue.
From a UX perspective, we don't want the Camera app to close. We only need to immediately release the resources it has opened on the SD card to prevent the OS from killing our app.

пятница, 28 ноября 2025 г. в 09:13:01 UTC+3, leoh...@google.com:

Leo Huang

unread,
6:07 AM (8 hours ago) 6:07 AM
to Eugene B, Android CameraX Discussion Group
I see. Thanks for the clarification. Honestly, I don't have an answer for this scenario. Even if you can trigger the recording stop while receiving the event, it may not complete within the short timeframe. Maybe you can mitigate this via UX, such as giving a proactive warning to the user for the SD card usage.

Eugene B <eugeneb...@gmail.com> 於 2025年11月28日 週五 下午5:35寫道:
Reply all
Reply to author
Forward
0 new messages