Code Monkey home page Code Monkey logo

Comments (13)

marinaserranomontes avatar marinaserranomontes commented on June 12, 2024

Hi @papitis ,

Please, could you add more info about the error you are getting? Do you want to record the publisher stream or the entire screen?
Using MediaRecorder with TextureViews should not be a problem.

Best,
Marina

from opentok-android-sdk-samples.

papitis avatar papitis commented on June 12, 2024

Yes i want to Record with MediaRecorder only the publisher stream, i take as example "Custom-Video-Driver" but i can't initialize MediaRecorder it gaves me:
Error on start -19

I initialize MEDIARECORDER on the CustoVideoDriver class which extends BaseVideoCapturer:
on function "init ( )" , and start recording on function "startCapture( )"
` // Start preview
mCamera.setPreviewCallbackWithBuffer(this);
mCamera.startPreview();

    mPreviewBufferLock.lock();
    mExpectedFrameSize = bufSize;
    isCaptureRunning = true;
    mPreviewBufferLock.unlock();

    try {
        recorder.start();
    } catch (IllegalStateException e) {
        e.printStackTrace();
    }

    isCaptureStarted = true;

`

from opentok-android-sdk-samples.

marinaserranomontes avatar marinaserranomontes commented on June 12, 2024

Hi @papitis

Using MediaRecorder with TextureViews should not be a problem. We are going to try to reproduce the scenario you comment.

Best,
Marina

from opentok-android-sdk-samples.

papitis avatar papitis commented on June 12, 2024

I use Texture Views, I'd appreciate your help.

from opentok-android-sdk-samples.

marinaserranomontes avatar marinaserranomontes commented on June 12, 2024

Hi @papitis

Is your issue fixed?
As we commented, we are going to try to reproduce it.

Best,
Marina

from opentok-android-sdk-samples.

papitis avatar papitis commented on June 12, 2024

from opentok-android-sdk-samples.

papitis avatar papitis commented on June 12, 2024

Yes i'm still having problem with this feature of opentok when i want to use MediaRecorder on publisher video.
Please you give me a favor if you reproduce that issue.

Thanks

from opentok-android-sdk-samples.

papitis avatar papitis commented on June 12, 2024

Hi, some new for this issue?
Best,
Angelo

from opentok-android-sdk-samples.

robjperez avatar robjperez commented on June 12, 2024

Hi!

First, let me give you some hints on how we have recorder the publisher stream in the past.

  • You can use the MediaProjection API to record the screen too.
  • If using the MediaRecorder, you don't need to use a CustomCapturer, you can setup the MediaRecorder in the Activity, and feed it with the input surfaces for the publisher.
  • You can skip MediaRecorder or MediaProjection and use MediaCodec to directly save the pubilsher video frames using a video encoder. In this case, you would need to build your own capturer with will save frames to the video using the MediaCodec and to render them in the view. This option is the most difficult of these three. I recommend you use any of the others above.

For reproducing your issue, we need some more details in order to be able to reproduce the exact issue. How are you setting up the MediaRecorder? I strongly recommend you to move the recorder code out of the CustomCapturer and drop it on your Activity code.

from opentok-android-sdk-samples.

papitis avatar papitis commented on June 12, 2024

I was setting up in the CustomCapturer, then i initialize in the Activity Code, i'm going to the two second option,
That is in the publisher options, i delete the option (CAPTURER)

mPublisher = new Publisher.Builder(this)
                     .capturer(new CustomCapturer())
                     .build();

so it's going to be:

mPublisher = new Publisher.Builder(this).build();

And the MediaRecorder like this in a function:

mCamera = Camera.open(mCameraIndex);
        mCurrentDeviceInfo = new Camera.CameraInfo();
        Camera.getCameraInfo(mCameraIndex, mCurrentDeviceInfo);
        recorder = new MediaRecorder();
        recorder.setCamera(mCamera); // This camera object got fromCustomVideoCapturer
        //mCamera.unlock();
        recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
        recorder.setOutputFile(routeVideo);
        try {
            recorder.prepare();
            Log.i("****** Recorder","Ready");
        } catch (IllegalStateException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

it's that ok?
thnks

from opentok-android-sdk-samples.

papitis avatar papitis commented on June 12, 2024

In the session options i should use the "Texture view" option?

mSession = new Session.Builder(this, apiKey, sessionId).
        sessionOptions(new Session.SessionOptions() {
            @Override
            public boolean useTextureViews() {
                return true;
            }
        }).build();
        mSession.setSessionListener(this);
        mSession.connect(tokenId);

from opentok-android-sdk-samples.

marinaserranomontes avatar marinaserranomontes commented on June 12, 2024

Hi @papitis

First of all, sorry about the delay checking your response.
Is your issue fixed?

Best,
Marina

from opentok-android-sdk-samples.

marinaserranomontes avatar marinaserranomontes commented on June 12, 2024

@papitis Closing due to inactivity, please re-open if the issue still persists.

from opentok-android-sdk-samples.

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.