Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid FFmpeg sometimes works and sometimes crashes
    text
    copied!<p>I compiled FFmpeg for Android ( <a href="https://gitorious.org/android-ffmpeg" rel="nofollow">https://gitorious.org/android-ffmpeg</a> ) but when I'm trying to do some operations ( f.e filters cropping, transpose, trim etc ) it crashes in 5 on 10 cases. Error logs are not the same so I assume that it might be caused by memory issues. I'm using OSX, NDK android-ndk-r9b : darwing x86_64. Native ffmpeg method is passing args to ffmpeg.c main method. It's executed in AsyncTask in Activity. Thanks in advance</p> <p><em>EDIT: I forgot to mention that programs algorithm runs like that: Press Button - > Open Camera Intent - > Start recording - > After recording copy file to project folder ( on SD card ) - > Open edit activity + Start asynctask</em></p> <p><em>EDIT2: Tested on HTC ONE with different video resolutions</em></p> <p>Version and config of ffmpeg</p> <pre><code>11-20 12:15:23.001: I/ff-log(19091): ffmpeg version 0.10.2.git 11-20 12:15:23.001: I/ff-log(19091): Copyright (c) 2000-2012 the FFmpeg developers 11-20 12:15:23.001: I/ff-log(19091): built on Nov 20 2013 12:12:46 with gcc 4.6 20120106 (prerelease) 11-20 12:15:23.001: I/ff-log(19091): configuration: --target-os=linux --cross-prefix=arm-linux-androideabi- --arch=arm --cpu=armv7-a --disable-ffplay --disable-ffserver --disable-network --disable-avdevice --enable-protocol=file --enable-hwaccel=mpeg4_vaapi --enable-hwaccel=h264_vaapi --sysroot=/Users/dpc/Developer/android-ndk-r9b/platforms/android-9/arch-arm --disable-decoder=h264_vdpau --prefix=build/armv7-a --disable-asm --enable-small --disable-everything --enable-decoder=mjpeg --enable-parser=mjpeg --enable-muxer=mp4 --enable-muxer=h264 --enable-muxer=h263 --enable-muxer=yuv4mpegpipe --enable-muxer=mov --enable-demuxer=mpegvideo --enable-demuxer=mjpeg --enable-demuxer=image2 --enable-demuxer=mp4 --enable-demuxer=aac --enable-demuxer=ac3 --enable-demuxer=mp3 --enable-demuxer=yuv4mpegpipe --enable-demuxer=mov --enable-decoder=mpegvideo --enable-decoder=mpeg4 --enable-decoder=mp3 --enable-decoder=ac3 --enable-decoder=aac --enable-decoder=h264 --enable-decoder=h263 --enable-decoder=rawvideo --enable-decoder=yuv4 --enable-decoder=png --enable </code></pre> <p>Sample comand:</p> <pre><code>1-20 12:15:22.991: I/FFMPEG(19091): CMD:-i file:/storage/emulated/0/.project/videos/mac_video_tmp.mp4 -vf crop=1079:1079:0:420 -vcodec mpeg4 -sameq -acodec copy file:/storage/emulated/0/.project/videos/croppedVid.mp4 </code></pre> <p>Some output errors:</p> <p>1st type:</p> <pre><code> 11-20 12:15:23.011: I/ff-log(19091): libavutil 51. 46.100 / 51. 46.100 11-20 12:15:23.011: I/ff-log(19091): libavcodec 54. 14.101 / 54. 14.101 11-20 12:15:23.011: I/ff-log(19091): libavformat 54. 3.100 / 54. 3.100 11-20 12:15:23.011: I/ff-log(19091): libavfilter 2. 70.100 / 2. 70.100 11-20 12:15:23.011: I/ff-log(19091): libswscale 2. 1.100 / 2. 1.100 11-20 12:15:23.011: I/ff-log(19091): libswresample 0. 11.100 / 0. 11.100 11-20 12:15:23.011: I/ff-log(19091): before parsing options 11-20 12:15:23.011: I/ff-log(19091): before parsing options 11-20 12:15:23.011: I/ff-log(19091): parse options 11-20 12:15:23.011: I/ff-log(19091): prepare app arguments !!! NOT defined(_WIN32) &amp;&amp; !defined(__MINGW32CE__) ! 11-20 12:15:23.011: I/ff-log(19091): after prepare app arguments 11-20 12:15:23.011: I/ff-log(19091): ffurl_open: file:/storage/emulated/0/.project/videos/mac_video_tmp.mp4, 1 11-20 12:15:23.011: I/ff-log(19091): ffurl_alloc: file:/storage/emulated/0/.project/videos/mac_video_tmp.mp4, 1 11-20 12:15:23.011: I/ff-log(19091): ffurl_alloc: file 11-20 12:15:23.011: I/ff-log(19091): ffurl_open alloc: 0 11-20 12:15:23.011: I/ff-log(19091): ffurl_connect 11-20 12:15:23.011: I/ff-log(19091): ffurl_open connect: 0 11-20 12:15:23.011: I/ff-log(19091): Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100 11-20 12:15:23.011: I/ff-log(19091): ISO: File Type Major Brand: isom 11-20 12:15:23.021: I/ff-log(19091): File position before avformat_find_stream_info() is 8458240 11-20 12:15:23.041: A/libc(19091): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 19091 (t.android.utils) </code></pre> <p>Second type:</p> <pre><code>11-20 12:17:04.800: I/ff-log(19632): libavutil 51. 46.100 / 51. 46.100 11-20 12:17:04.800: I/ff-log(19632): libavcodec 54. 14.101 / 54. 14.101 11-20 12:17:04.800: I/ff-log(19632): libavformat 54. 3.100 / 54. 3.100 11-20 12:17:04.800: I/ff-log(19632): libavfilter 2. 70.100 / 2. 70.100 11-20 12:17:04.800: I/ff-log(19632): libswscale 2. 1.100 / 2. 1.100 11-20 12:17:04.800: I/ff-log(19632): libswresample 0. 11.100 / 0. 11.100 11-20 12:17:04.800: I/ff-log(19632): before parsing options 11-20 12:17:04.800: I/ff-log(19632): before parsing options 11-20 12:17:04.800: I/ff-log(19632): parse options 11-20 12:17:04.800: I/ff-log(19632): prepare app arguments !!! NOT defined(_WIN32) &amp;&amp; !defined(__MINGW32CE__) ! 11-20 12:17:04.800: I/ff-log(19632): after prepare app arguments 11-20 12:17:04.800: I/ff-log(19632): opt_output_file ܞ�f��f��f��f���flated/0/.project/videos/mac_video_tmp.mp4 11-20 12:17:04.800: I/ff-log(19632): ffurl_alloc: ܞ�f��f��f��f���flated/0/.project/videos/mac_video_tmp.mp4, 0 11-20 12:17:04.800: I/ff-log(19632): ffurl_alloc: file 11-20 12:17:04.800: I/ff-log(19632): ffurl_open: ܞ�f��f��f��f���flated/0/.project/videos/mac_video_tmp.mp4, 2 11-20 12:17:04.800: I/ff-log(19632): ffurl_alloc: ܞ�f��f��f��f���flated/0/.project/videos/mac_video_tmp.mp4, 2 11-20 12:17:04.800: I/ff-log(19632): ffurl_alloc: file 11-20 12:17:04.800: I/ff-log(19632): ffurl_open alloc: 0 11-20 12:17:04.800: I/ff-log(19632): ffurl_connect 11-20 12:17:04.800: I/ff-log(19632): ffurl_open connect: -2 11-20 12:17:04.800: I/ff-log(19632): ffurl_open FAIL 11-20 12:17:04.800: I/ff-log(19632): ܞ�f��f��f��f���flated/0/.project/videos/mac_video_tmp.mp4: No such file or directory </code></pre> <p>( CHARSER IS AS IT'S IN OUTPUT LOGCAT )</p> <p>3rd type:</p> <pre><code>11-20 12:18:23.243: I/ff-log(19867): libavutil 51. 46.100 / 51. 46.100 11-20 12:18:23.243: I/ff-log(19867): libavcodec 54. 14.101 / 54. 14.101 11-20 12:18:23.243: I/ff-log(19867): libavformat 54. 3.100 / 54. 3.100 11-20 12:18:23.243: I/ff-log(19867): libavfilter 2. 70.100 / 2. 70.100 11-20 12:18:23.243: I/ff-log(19867): libswscale 2. 1.100 / 2. 1.100 11-20 12:18:23.243: I/ff-log(19867): libswresample 0. 11.100 / 0. 11.100 11-20 12:18:23.243: I/ff-log(19867): before parsing options 11-20 12:18:23.243: I/ff-log(19867): before parsing options 11-20 12:18:23.243: I/ff-log(19867): parse options 11-20 12:18:23.243: I/ff-log(19867): prepare app arguments !!! NOT defined(_WIN32) &amp;&amp; !defined(__MINGW32CE__) ! 11-20 12:18:23.243: I/ff-log(19867): after prepare app arguments 11-20 12:18:23.243: I/ff-log(19867): Unknown decoder '��f(' 11-20 12:18:23.243: I/ff-log(19867): exit_program 1 11-20 12:18:23.243: I/ff-log(19867): exit_program 1 11-20 12:18:23.243: I/ff-log(19867): exit_program 2 11-20 12:18:23.253: A/libc(19867): @@@ ABORTING: invalid address or address of corrupt block 0x1d3422d passed to dlfree 11-20 12:18:23.253: A/libc(19867): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 20393 (AsyncTask #2) </code></pre> <p>4th type:</p> <pre><code>11-20 12:20:07.214: I/ff-log(20660): libavutil 51. 46.100 / 51. 46.100 11-20 12:20:07.214: I/ff-log(20660): libavcodec 54. 14.101 / 54. 14.101 11-20 12:20:07.214: I/ff-log(20660): libavformat 54. 3.100 / 54. 3.100 11-20 12:20:07.214: I/ff-log(20660): libavfilter 2. 70.100 / 2. 70.100 11-20 12:20:07.214: I/ff-log(20660): libswscale 2. 1.100 / 2. 1.100 11-20 12:20:07.214: I/ff-log(20660): libswresample 0. 11.100 / 0. 11.100 11-20 12:20:07.214: I/ff-log(20660): before parsing options 11-20 12:20:07.214: I/ff-log(20660): before parsing options 11-20 12:20:07.214: I/ff-log(20660): parse options 11-20 12:20:07.214: I/ff-log(20660): prepare app arguments !!! NOT defined(_WIN32) &amp;&amp; !defined(__MINGW32CE__) ! 11-20 12:20:07.214: I/ff-log(20660): after prepare app arguments 11-20 12:20:07.214: I/ff-log(20660): Unknown decoder '' 11-20 12:20:07.214: I/ff-log(20660): exit_program 1 11-20 12:20:07.214: A/libc(20660): Fatal signal 11 (SIGSEGV) at 0x2d007165 (code=1), thread 21017 (AsyncTask #2) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload