Open ghost opened 7 years ago
@kk1429 can you please build example app that I can reproduce it ?
I also encounter the same in Android. My phone is Note 8 and I'm just trying to compress a 2 seconds video file and it throws same error as above.
i fixed the issue by removing running programs.
I'm having the same issue (Note 4) with the same error message. Removing other programmes doesn't fix the problem. If anybody has any ideas I'd be grateful.
Error reinitializing filters!Failed to inject frame into filter network: Out of memoryError while processing the decoded data for stream #0:0[aac @ 0xb5dbf000] Qavg: 23986.367[aac @ 0xb5dbf000] 2 frames left in the queue on closingConversion failed!
EDIT: Just established that this is a bug in the newest release -1.12.7 works fine! Would help you fix it but sadly it's beyond my ability. Hope this helps.
I got the same problem
i also encounter the same issue on note 4, with bigger files (100mb). I tried a 7mb file, and it works fine. I believe this module is loading the whole video file in RAM? is it the most efficient way?
👍 +1
Any guesses?
Seems like it's something with the build https://github.com/shahen94/react-native-video-processing/commit/ea10cff3df89b5367d80d1749768458b5253c9e8 I'll try to fix
I think we should write some tests for ffmpeg to prevent bugs like this.
I've fixed the issue. @shahen94 Add me to colaborators or ping me when issues like this arise. Since I'm using this lib I want to know if something goes wrong before users do.
Ok guys. This is the PR https://github.com/shahen94/react-native-video-processing/pull/141
Please check and confirm that it fixes your problems 👍
I just stumbled upon this issue. Installed the lib from npm today. Have the changes been published to npm? In my case it's a 2 sec long video. And I also checked, and the 1.12.7 version works without problems
@amberv0 please use sources from the master branch
@shahen94 , confirming that it works properly with the version from master :)
version 1.13.0 does not contain the fix, how do we move the fix to version 1.14.0
issue still persists on Android Jellybean
9.556 2947-3001/? I/ReactNativeJS: { [Error: compress error: failed. /data/data/com.sample.prod/files/ffmpeg[1]: syntax error: '��4��4' unexpected] framesToPop: 1, code: 'EUNSPECIFIED' }
Facing the same issue. Tried out the master branch, as @shahen94 mentions a few comments up, (latest commit as of writing: f57addffcf94c97255f7622bfc18ceec53d644ed) and bug is still there: app is crashing on Android with an "out of memory" exception.
Full crash log:
Error: compressing image - compress error: failed. ffmpeg version 3.3.5 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 4.8 (GCC) configuration: --target-os=linux --cross-prefix=/Users/kesha/Projects/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/Users/kesha/Projects/ffmpeg-android/toolchain-android/sysroot --enable-libx264 --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-yasm --disable-doc --disable-shared --enable-static --enable-nonfree --disable-network --enable-gpl --enable-ffmpeg --enable-small --disable-filters --enable-filter=copy --enable-filter=trim --enable-filter=crop --enable-filter=scale --enable-filter=format --pkg-config=/Users/kesha/Projects/ffmpeg-android/ffmpeg-3.3-pkg-config --prefix=/Users/kesha/Projects/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/Users/kesha/Projects/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/Users/kesha/Projects/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-cxxflags= --extra-libs='-lx264 -lm' libavutil 55. 58.100 / 55. 58.100 libavcodec 57. 89.100 / 57. 89.100 libavformat 57. 71.100 / 57. 71.100 libavdevice 57. 6.100 / 57. 6.100 libavfilter 6. 82.100 / 6. 82.100 libswscale 4. 6.100 / 4. 6.100 libswresample 2. 7.100 / 2. 7.100 libpostproc 54. 5.100 / 54. 5.100Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/DCIM/Camera/VID_20180205_081711.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isommp42 creation_time : 2018-02-05T04:17:11.000000Z location : +00.0000+000.0000/ location-eng : +00.0000+000.0000/ com.android.version: 8.1.0 Duration: 00:00:30.57, start: 0.000000, bitrate: 21770 kb/s Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 96 kb/s (default) Metadata: creation_time : 2018-02-05T04:17:11.000000Z handler_name : SoundHandle Stream #0:1(eng): Video: h264 (avc1 / 0x31637661), yuvj420p(pc, smpte170m), 1920x1080, 21889 kb/s, SAR 1:1 DAR 16:9, 29.90 fps, 30 tbr, 90k tbn, 180k tbc (default) Metadata: rotate : 90 creation_time : 2018-02-05T04:17:11.000000Z handler_name : VideoHandle Side data: displaymatrix: rotation of -90.00 degreesStream mapping: Stream #0:1 -> #0:0 (h264 (native) -> h264 (libx264)) Stream #0:0 -> #0:1 (aac (native) -> aac (native))Press [q] to stop, [?] for helpError reinitializing filters!Failed to inject frame into filter network: Out of memoryError while processing the decoded data for stream #0:1[aac @ 0xefc8ec00] Qavg: 4409.910[aac @ 0xefc8ec00] 2 frames left in the queue on closingConversion failed!
I believe the important lines are these:
Failed to inject frame into filter network: Out of memoryError while processing the decoded data for stream #0:1[aac @ 0xefc8ec00] Qavg: 4409.910[aac @ 0xefc8ec00] 2 frames left in the queue on closingConversion failed!
@shahen94 @kesha-antonov maybe this issue should be reopened?
Hey guys. Don't have time for this now. You can try build new ffmpeg with https://github.com/kesha-antonov/ffmpeg-android
See my latest PRs to this repo: https://github.com/shahen94/react-native-video-processing/pull/141/files
Current ffmpeg only working with ARM, but it's fail on X86 (emulator).
As in https://github.com/kesha-antonov/ffmpeg-android ... there is 3 different type of prebuilt ffmpeg.
Should it use according to our App Arch target (Arm or X86) ?
@kesha-antonov
Hey guys! Sorry, I don't use emulator so cannot help here. We've discussed this somewhere in issues
I cant seem to compress a 10 sec video using ProcessManager.compress in android.,
This is how I am trying to do it:
this.props.navigation.state.params.videoData.path
is a string of value 'file:///storage/emulated/0/Movies/VID_20171110_191714.mp4'This is the error I get: