Giter Site home page Giter Site logo

Comments (7)

Barazu avatar Barazu commented on June 30, 2024 4

It actually has an easy fix.
Add this code to the stopRecordingVideo method:

try {
           mPreviewSession.abortCaptures();
       } catch (CameraAccessException e) {
           e.printStackTrace();
       }

       Timer timer = new Timer();
       TimerTask timerTask = new TimerTask() {
           @Override
           public void run() {
               mMediaRecorder.stop();
               mMediaRecorder.reset();
           }
       };
       timer.schedule(timerTask,30);

The reason for the exception is explained here : .
The simplest workaround (that I found at least) is to call mPreviewSession.abortCaptures(); and set a short delay before calling mMediaRecorder.stop(); as abortCaptures() may take time to execute.
Hope this helps!

from android-camera2video.

rspq avatar rspq commented on June 30, 2024 2

Same crash on Moto Z Play running 6.0.1.

It says something about the utter awfulness of Camera2 that even Google cannot produce working samples for it.

from android-camera2video.

JasonZhu19910601 avatar JasonZhu19910601 commented on June 30, 2024

I have the same error.

from android-camera2video.

anonym24 avatar anonym24 commented on June 30, 2024

what about 1007 failed but with MediaProjection (not camera)

https://stackoverflow.com/questions/45266016/screen-recording-stop-failed-and-failure-delivering-result-resultinfo

from android-camera2video.

anonym24 avatar anonym24 commented on June 30, 2024

#86
https://issuetracker.google.com/issues/111433520
https://stackoverflow.com/questions/51332386/mediarecorder-and-videosource-surface-stop-failed-1007-a-serious-android-bug

many devices just don't work with Surface input source (MediaRecorder, MediaCodec)

MediaCodec works ok only with Surface and OpenGL ES but not with lockHardwareCanvas

from android-camera2video.

anonym24 avatar anonym24 commented on June 30, 2024

@Barazu it only may fix issue with crash (Exception 1007), but video file's size is only 19 kilobytes, so frames just weren't recorded into video file (.mp4 container)

it even doesn't always fix that crash

so there is no solution

from android-camera2video.

codingjeremy avatar codingjeremy commented on June 30, 2024

This sample has been migrated to a new location where we can accept Pull Requests (check README for more information).

As recommended by GitHub, we are closing all issues and pull requests now that this older repo will be archived.

If you still see this issue in the updated repo, please reopen the issue/PR there. Thank you!

from android-camera2video.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.