You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Android] Video.compress fails with NO_MEMORY on Samsung Exynos devices at 1080p (2.0.x) #423
On Samsung Exynos devices (e.g. Galaxy A56, most Galaxy A models and some Galaxy S), Video.compress always rejects. Logcat:
ExynosVideoEncCodec-H264-Intf: [checkRealTimeResource] real-time(32767 fps) is not supported
ExynosC2H264EncComponent: [tryGetResource] obtaining real time resource is failed
MediaCodec: Codec reported err 0xfffffff4/NO_MEMORY, actionCode 0, while in state 5/STARTING
Cause: since #399, CompressorUtils.setOutputFileParameters sets KEY_PRIORITY = 0 (realtime) and KEY_OPERATING_RATE = Short.MAX_VALUE on the encoder format. c2.exynos.h264.encoder accepts these in configure() but refuses them in start(). The prepareEncoder fallback only retries configure() failures, so the error reaches JS. No JS option can disable these keys.
Expected behavior
The video compresses. Locally removing the two keys fixes it: a 94.1 MB, 43.6 s 1080×1920 H.264 clip compresses to 32.0 MB (H.264 High, ~5.6 Mbps) on a Galaxy A56. I'll open a PR with this fix.
Platform
Android
iOS
React Native Version
0.81.5 (Expo SDK 54) and 0.86.3 (Expo SDK 57). The bug is in the native MediaCodec setup, not RN-specific.
Follow-up after reproducing this against the bare example app on a Galaxy A56 (SM-A566E, Exynos 1580 / s5e8855, Android 16), same source video (94.1 MB, H.264 1920×1080 portrait, 120 fps, 43.6 s):
Native code
Options
Result
2.0.3 (keys set)
default auto (→ 360×640)
✅ succeeds
2.0.3 (keys set)
manual, maxSize: 1920, bitrate: 5_600_000
❌ real-time(32767 fps) is not supported → NO_MEMORY in STARTING, promise rejects
keys removed
manual, maxSize: 1920, bitrate: 5_600_000
✅ 31.97 MB, H.264 High 1080×1920, ~11 s
So "always rejects" in the title is too strong: the realtime-resource check depends on resolution. Small auto outputs fit Exynos's realtime budget, and 1080p outputs don't. The encoder in every run was c2.exynos.h264.encoder.
changed the title [-][Android] Video.compress always fails with NO_MEMORY on Samsung Exynos devices (2.0.x)[/-][+][Android] Video.compress fails with NO_MEMORY on Samsung Exynos devices at 1080p (2.0.x)[/+]on Oct 10, 2026
Activity
github-actions commentedon Oct 9, 2026
👋 @yayobyte
Thanks for opening your issue here! If you find this package useful hit the star🌟!
yayobyte commentedon Oct 10, 2026
Follow-up after reproducing this against the bare example app on a Galaxy A56 (SM-A566E, Exynos 1580 / s5e8855, Android 16), same source video (94.1 MB, H.264 1920×1080 portrait, 120 fps, 43.6 s):
auto(→ 360×640)manual,maxSize: 1920,bitrate: 5_600_000real-time(32767 fps) is not supported→NO_MEMORYinSTARTING, promise rejectsmanual,maxSize: 1920,bitrate: 5_600_000So "always rejects" in the title is too strong: the realtime-resource check depends on resolution. Small
autooutputs fit Exynos's realtime budget, and 1080p outputs don't. The encoder in every run wasc2.exynos.h264.encoder.PR with the fix to follow.
[-][Android] Video.compress always fails with NO_MEMORY on Samsung Exynos devices (2.0.x)[/-][+][Android] Video.compress fails with NO_MEMORY on Samsung Exynos devices at 1080p (2.0.x)[/+]