Impossible to set "quality" for cameraRef.recordAsync method

Capturing video is a core functionality we want to have in out application. As I was answered on Slack there is no ability to post-process video (mean compress/convert etc.) without detaching project from Expo.
So we are looking for other possible ways to handle similar stuff. recordAsync method have quality parameter. Likely if we can set it to minimal value resulting video must be smaller compared to default one (size is crucial, as we need to save fragments to the server, but sending about 500Mb for 1 minute of video has no sense). But when I try to set quality by either Camera.Constants.VideoQuality[‘720p’] or 2 - warning appears and record is not starting. Am I doing anything wrong?

Imgur

Hey @defor,

Can you create a minimal, verifiable example of this behavior in a Snack for us? http://snack.expo.io/

Always helps the debugging process to see some code that replicates the issue!

Cheers,

Adam

Hello, @adamjnav
Thank you for attention. Here is a Stack

It is in working state now.
If you uncomment line #210 quality: Camera.Constants.VideoQuality['480p'] - video will not be captured at all. Since warnings are disabled in “stack” mode (as I understand environment is set to production) - warning mentioned in my original post is not shown, but it is there

Also good time to ask about another issue. If you comment lines from #217 to #220

if (captureFinished - captureStarted < 2500) {
      console.warn('Video is too short. Nothing is captured')
      return;
    }

And then tap on capture button and release it faster then 2.5 seconds - nothing will be captured. Under preview we will see just a black screen (but there should be 2.5 seconds of video). I believe it is related to some kind of delay between call recordAsync and actual recording.
Is there any workaround on this issue?

Any thoughts?

@defor I assume you’re descibing Android specific problem right?
First issue is resolved here: https://github.com/expo/universe/commit/f0a4bdde474caa16d1db900b4add5a6685ac7269 and will be shipped with next release.
According to second issue: the problem itself is mostly connected with underlying Android library we’re using and asynchronous way of communication between js-part and native-part. I’ll talk internally with the team about it, but we’re not likely replace this library right now and no fast solution is available.
No solid workaround is known as well (I’ve reduced time you’ve mentioned to 1s and still obtained valid video, but below 1s I started experiencing your problem), so I propose you to check duration of resulting video and then prompt user whether button was pressed to shortly and no valid video is available or everything went smoothly and you can enjoy fresh, valid video.

@barthec
Thank you very much for update. You’re right - issue only on Android, forgot to mention this, sorry.
Looking forward next release)

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.