澳门银河网上官方赌场_老品牌值得信赖

ITKeyword,专注技术干货聚合推荐

注册 | 登录

android - JavaCV/FFmpeg causes crash only on Lollipop

itPublisher 分享于

2020腾讯云双十一活动,全年最低!!!(领取3500元代金券),
地址https://cloud.tencent.com/act/cps/redirect?redirect=1073

2020阿里云最低价产品入口,含代金券(新老用户有优惠),
地址https://www.aliyun.com/minisite/goods

推荐:Android使用OpenCV和FFMpeg的简单方法-开源项目javacv的使用

转自:http://doandroid.info/android%E4%BD%BF%E7%94%A8opencv%E5%92%8Cffmpeg%E7%9A%84%E7%AE%80%E5%8D%95%E6%96%B9%E6%B3%95-%E5%BC%80%E6%BA%90%E9%A1%B9%E7

I get reports of this crash from users of my app on Galaxy Note devices running Android Lollipop (might happen on other devices but the majority of my users have Galaxy Note because it's a drawing app). Below is the relevant code from my ASyncTask which exports a series of images (plus audio) to a video file using JavaCV/FFmpeg, and the stack trace from the reported crash. It works fine on my Note 8.0 running KitKat (there's no Lollipop update available for that device), and works fine in Lollipop on the emulator, so I'm having a hard time tracking down the cause and don't know what to do.

@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
android opencv ffmpeg javacv
|
  this question
asked Nov 13 '15 at 19:29 WeirdHat 6 3

 | 

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.


相关阅读排行


相关内容推荐

最新文章

×

×

请激活账号

为了能正常使用评论、编辑功能及以后陆续为用户提供的其他产品,请激活账号。

您的注册邮箱: 修改

重新发送激活邮件 进入我的邮箱

如果您没有收到激活邮件,请注意检查垃圾箱。

澳门银河网上官方赌场 <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <文本链> <文本链> <文本链> <文本链> <文本链> <文本链>