Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record local video #131

Closed
AnkanDey88 opened this issue Jul 11, 2017 · 8 comments
Closed

Record local video #131

AnkanDey88 opened this issue Jul 11, 2017 · 8 comments

Comments

@AnkanDey88
Copy link

How can I save the local video only in my device SD-Card. I don't want to use the web end-points to save it in server. Any help is highly appreciable. Thanks in advance.

@marinaserranomontes
Copy link
Contributor

Hi @AnkanDey88,

Using Tokbox archiving feature you can store your recorded videos to:

  1. Amazon S3 bucket or Windows Azure container or
  2. OpenTok cloud

You can download the archives from both the locations when archives are successfully uploaded. More info here: https://tokbox.com/developer/guides/archiving/

@AnkanDey88
Copy link
Author

Hi @marinaserranomontes

Thank you for letting me know on this. But is there any other way to save local video instead of the Tokbox archiving feature. May be we can use MediaRecorder.
Please let me know on this.

@marinaserranomontes
Copy link
Contributor

Hi @AnkanDey88,

Yes, you could try to use MediaRecorder with TextureViews.

@AnkanDey88
Copy link
Author

Hi @marinaserranomontes

I have tried to use this. But no result. When I use MediaRecorder, then camera freezes and opponent sees my still image.
If it is possible to use MediaRecorder with TextureViews then please give me any tutorials for that.

Thanks in advance.

@marinaserranomontes
Copy link
Contributor

Hi @AnkanDey88,

I think you could try 2 approaches:

@AnkanDey88
Copy link
Author

Hi @marinaserranomontes

I did exactly the same thing which you mentioned in 2nd point. But I'm facing one problem is that, when I start video recording using MediaRecorder I have to unlock the camera first and so that the camera stream freezes for TokBox.

mediaRecorder = new MediaRecorder();
mediaRecorder.setCamera(myCamera); // This camera object got fromCustomVideoCapturer
myCamera.unlock();
mediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_LOW));
mediaRecorder.setOutputFile("/sdcard/video.mp4");
mediaRecorder.setMaxDuration(60000); // Set max duration 60 sec.
mediaRecorder.setMaxFileSize(5000000); // Set max file size 5M
try {
mediaRecorder.prepare();
mediaRecorder.start();
} catch (IllegalStateException e) {
return false;
} catch (IOException e) {
return false;
}

@marinaserranomontes
Copy link
Contributor

Hi @AnkanDey88 ,

To use TextureViews you need to indicate it in the SessionOptions.
https://tokbox.com/developer/sdks/android/reference/com/opentok/android/Session.SessionOptions.html

Eg:
mSession = new Session(MainActivity.this, APIKEY, SESSION_ID, new Session.SessionOptions() {

  @OverRide
  public boolean useTextureViews() {
  return true;
  }
  });

@marinaserranomontes
Copy link
Contributor

I’m closing this issue because it has been inactive for a few weeks. This probably means that it is not reproducible or it has been fixed.

Please reopen if you still encounter this issue You can also contribute directly by providing a patch.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants