JavaCV / FFmpeg仅在Lollipop上导致崩溃

时间:2015-11-13 19:29:11

标签: android opencv ffmpeg javacv

我在运行Android Lollipop的Galaxy Note设备上收到了我的应用用户的崩溃报告(可能会在其他设备上发生,但我的大多数用户都有Galaxy Note,因为它是一个绘图应用)。下面是我的ASyncTask中的相关代码,它使用JavaCV / FFmpeg将一系列图像(加音频)导出到视频文件,并从报告的崩溃中导出堆栈跟踪。它在运行KitKat的Note 8.0上工作正常(该设备没有Lollipop更新),并且在模拟器上的Lollipop中工作正常,所以我很难跟踪原因并且没有&# 39;不知道该怎么做。

@Override
protected String doInBackground(final File... params) {
    FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(params[0],canvas_width,canvas_height, 0);
    FrameGrabber audiograbber = null;
    if(audio!=null) audiograbber = new FFmpegFrameGrabber(audio);
    Frame audioframe;
    Frame image;
    AndroidFrameConverter converter = new AndroidFrameConverter();

    try {
        recorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);
        recorder.setFrameRate(framerate);
        recorder.setPixelFormat(0);
        if(audio!=null) {
            audiograbber.setFrameRate(framerate);
            audiograbber.start();
            recorder.setAudioChannels(audiograbber.getAudioChannels());
            recorder.setSampleRate(audiograbber.getSampleRate());
        }
        recorder.start();

        Bitmap drawframe = createBitmap(canvas_width, canvas_height, Bitmap.Config.ARGB_8888);
        Canvas c = new Canvas(drawframe);
        Paint p = new Paint();

        for(int frame=0; frame<movielength; frame++) {
            if(isCancelled()) break;
            publishProgress(frame);

            //code to draw image

            image = converter.convert(drawframe);
            recorder.record(image);
        }

        if(isCancelled()) {
            bgbitmap.recycle();
            drawframe.recycle();
            return "Cancelled";
        }

        if(audio!=null) {
            while((audioframe = audiograbber.grabFrame()) != null) {
                recorder.record(audioframe);
            }
        }

        recorder.stop();
        bgbitmap.recycle();
        drawframe.recycle();
        if(audio!=null) audiograbber.stop();
        return "Saved "+params[0];
    } catch (Exception e) {
        e.printStackTrace();
    }
    return "Failed";
}

-

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/treltexx/trelte:5.1.1/LMY47X/N910CXXU1COH4:user/release-keys'
Revision: '21'
ABI: 'arm'
pid: 12039, tid: 12053, name: GCDaemon  >>> com.weirdhat.roughanimator <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'sart/runtime/gc/collector/mark_sweep.cc:381] Can't mark invalid object'
    r0 00000000  r1 00002f15  r2 00000006  r3 00000000
    r4 b366bdb8  r5 00000006  r6 00000002  r7 0000010c
    r8 00000001  r9 b446f550  sl b4429000  fp 9a975c60
    ip 00002f15  sp b366b008  lr b6db9cb9  pc b6ddd3ac  cpsr 60070010

backtrace:
    #00 pc 0003b3ac  /system/lib/libc.so (tgkill+12)
    #01 pc 00017cb5  /system/lib/libc.so (pthread_kill+52)
    #02 pc 000188c7  /system/lib/libc.so (raise+10)
    #03 pc 00015165  /system/lib/libc.so (__libc_android_abort+36)
    #04 pc 00012fac  /system/lib/libc.so (abort+4)
    #05 pc 00242f17  /system/lib/libart.so (art::Runtime::Abort()+170)
    #06 pc 000ad991  /system/lib/libart.so (art::LogMessage::~LogMessage()+1360)
    #07 pc 0013ec53  /system/lib/libart.so (bool art::gc::accounting::HeapBitmap::AtomicTestAndSet<art::gc::collector::MarkSweepMarkObjectSlowPath>(art::mirror::Object const*, art::gc::collector::MarkSweepMarkObjectSlowPath const&)+422)
    #08 pc 0013ed27  /system/lib/libart.so (art::gc::collector::MarkSweep::MarkObjectParallel(art::mirror::Object const*)+142)
    #09 pc 0013ff23  /system/lib/libart.so (art::gc::collector::MarkSweep::MarkRootParallelCallback(art::mirror::Object**, void*, art::RootInfo const&)+26)
    #10 pc 0025893d  /system/lib/libart.so (art::ReferenceMapVisitor<art::RootCallbackVisitor>::VisitQuickFrame()+1024)
    #11 pc 00258cad  /system/lib/libart.so (art::ReferenceMapVisitor<art::RootCallbackVisitor>::VisitFrame()+224)
    #12 pc 0024c8e9  /system/lib/libart.so (art::StackVisitor::WalkStack(bool)+276)
    #13 pc 0024e617  /system/lib/libart.so (art::Thread::VisitRoots(void (*)(art::mirror::Object**, void*, art::RootInfo const&), void*)+994)
    #14 pc 0013ef9f  /system/lib/libart.so (art::gc::collector::CheckpointMarkThreadRoots::Run(art::Thread*)+126)
    #15 pc 0025b44d  /system/lib/libart.so (art::ThreadList::RunCheckpoint(art::Closure*)+296)
    #16 pc 0013dc0d  /system/lib/libart.so (art::gc::collector::MarkSweep::MarkRootsCheckpoint(art::Thread*, bool)+96)
    #17 pc 0014165d  /system/lib/libart.so (art::gc::collector::MarkSweep::PreCleanCards()+172)
    #18 pc 001417d3  /system/lib/libart.so (art::gc::collector::MarkSweep::MarkingPhase()+126)
    #19 pc 001418b9  /system/lib/libart.so (art::gc::collector::MarkSweep::RunPhases()+176)
    #20 pc 00138527  /system/lib/libart.so (art::gc::collector::GarbageCollector::Run(art::gc::GcCause, bool)+246)
    #21 pc 0015865b  /system/lib/libart.so (art::gc::Heap::CollectGarbageInternal(art::gc::collector::GcType, art::gc::GcCause, bool)+1426)
    #22 pc 00159af5  /system/lib/libart.so (art::gc::Heap::ConcurrentGC(art::Thread*)+56)
    #23 pc 000003ef  /system/framework/arm/boot.oat

0 个答案:

没有答案