Current behavior
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
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.
React Native Compressor Version
2.0.3 (introduced in #399)
Reproducible Steps And Demo
- Run any app using react-native-compressor 2.0.3 on a Samsung Exynos device (tested: Galaxy A56).
- Call
Video.compress(uri, { compressionMethod: "manual", bitrate: 5_600_000, maxSize: 1920 }) on any video.
- The promise rejects, and logcat shows the
NO_MEMORY / real-time(32767 fps) is not supported errors above.
Current behavior
On Samsung Exynos devices (e.g. Galaxy A56, most Galaxy A models and some Galaxy S),
Video.compressalways rejects. Logcat:Cause: since #399,
CompressorUtils.setOutputFileParameterssetsKEY_PRIORITY = 0(realtime) andKEY_OPERATING_RATE = Short.MAX_VALUEon the encoder format.c2.exynos.h264.encoderaccepts these inconfigure()but refuses them instart(). TheprepareEncoderfallback only retriesconfigure()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
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.
React Native Compressor Version
2.0.3 (introduced in #399)
Reproducible Steps And Demo
Video.compress(uri, { compressionMethod: "manual", bitrate: 5_600_000, maxSize: 1920 })on any video.NO_MEMORY/real-time(32767 fps) is not supportederrors above.