Repository navigation
fix(android): drop KEY_PRIORITY/KEY_OPERATING_RATE so Exynos encoders can start (#423) - #424
Conversation
… can start (numandev1#423) Exynos H.264 encoders (c2.exynos.h264.encoder) accept the realtime priority + max operating rate hint in configure() but fail start() with NO_MEMORY ("real-time(32767 fps) is not supported") at higher resolutions such as 1080p. The prepareEncoder fallback only covers configure() failures, so Video.compress rejected. Fixes numandev1#423 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
we are encountering this issue too @numandev1 could you please take a look when you have a second? |
There was a problem hiding this comment.
🟢 Approval recommended
The narrow removal addresses the reported failure, preserves required encoding settings, and is supported by targeted device validation with no unresolved findings.
No open issues 🎉
What changed in this PR
Fixes #423 by removing Android encoder scheduling hints introduced in #399 that caused Samsung Exynos encoders to fail at startup. Required encoding parameters and fallback behavior remain unchanged; iOS is unaffected.
Changes:
- Remove
KEY_PRIORITYandKEY_OPERATING_RATEfrom the encoder format. - Update fallback comments to describe only the remaining VBR setting.
- Document the Exynos limitation and record the fix in triage notes.
The PR reports successful Galaxy A56 before/after validation. Native behavior was not independently runtime-verified during this review.
| File | Description |
|---|---|
TRIAGE.md |
Records #423, its cause, and reported device validation. |
CLAUDE.md |
Documents the encoder scheduling-key pitfall. |
android/src/main/java/com/reactnativecompressor/Video/VideoCompressor/utils/CompressorUtils.kt |
Removes the two scheduling hints that trigger Exynos startup failures. |
android/src/main/java/com/reactnativecompressor/Video/VideoCompressor/compressor/Compressor.kt |
Updates comments only to reflect the remaining VBR fallback. |
Review effort: Balanced
|
Thank you so much @numandev1 <3 |
|
Thanks to everyone for the review. |
|
🙏 |
Summary
Fixes #423.
On Samsung Exynos devices,
Video.compressrejects at higher output resolutions (e.g. 1080p inmanualmode):#399 added
KEY_PRIORITY = 0(realtime) andKEY_OPERATING_RATE = Short.MAX_VALUEto the encoder format as a throughput hint.c2.exynos.h264.encoderaccepts them inconfigure()but failsstart()when the job exceeds its realtime budget. TheprepareEncoderfallback only coversconfigure()failures, so the error reaches JS, and no option can disable the keys. Smallautooutputs (360×640) still fit the budget, which is why it's resolution-dependent.Changes:
prepareEncodercomments, which now cover only the VBR key.iOS is unaffected.
Changelog
[ANDROID] [FIXED] - Video compression failing with NO_MEMORY on Samsung Exynos encoders
Test Plan
yarn test:pr(passes)yarn test:harness:androidon an emulator (Pixel 8 Pro, API 35): 9/9 passed. The harness has noVideo.compresscase, so this is a regression check only.On-device before/after with the bare example app on a Galaxy A56 (SM-A566E, Exynos 1580, Android 16). Source: 94.1 MB, H.264 1920×1080 portrait, 120 fps, 17 Mbps, 43.6 s. Encoder in all runs:
c2.exynos.h264.encoder.main(keys set)auto(→ 360×640)main(keys set)manual,maxSize: 1920,bitrate: 5_600_000NO_MEMORYinSTARTING, promise rejectsmanual,maxSize: 1920,bitrate: 5_600_000Not tested on Qualcomm/MediaTek devices without the hint. Throughput there may drop somewhat, but output should be unchanged.
🤖 Generated with Claude Code