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

Setting up quality of the video #32

Open
DanaStefanoska opened this issue Oct 29, 2020 · 3 comments
Open

Setting up quality of the video #32

DanaStefanoska opened this issue Oct 29, 2020 · 3 comments

Comments

@DanaStefanoska
Copy link

Firstly, thanks for this amazing plugin! It would be way better if we can get some kind of documentation.

However, here is a question I have, is there a way to set the quality of which the recording is taken?
Thanks!

@mcarnoky001
Copy link

mcarnoky001 commented Nov 9, 2020

Hey, I was digging in code and found a non documented possibility to adjust video quality.

async openCamera() { await VideoRecorder.initialize({ camera: VideoRecorderCamera.FRONT, // Can use BACK previewFrames: [config], quality: 1 //Here I can setup a video quality }).then(() => { this.setState({ showUI: true }); }); }

This is a code in swift which is setting your video quality by your quality option number.
// Set Video quality switch(self.quality){ case 1: self.captureSession?.sessionPreset = AVCaptureSession.Preset.hd1280x720 break; case 2: self.captureSession?.sessionPreset = AVCaptureSession.Preset.hd1920x1080 break; case 3: self.captureSession?.sessionPreset = AVCaptureSession.Preset.hd4K3840x2160 break; case 4: self.captureSession?.sessionPreset = AVCaptureSession.Preset.high break; case 5: self.captureSession?.sessionPreset = AVCaptureSession.Preset.low break; case 6: self.captureSession?.sessionPreset = AVCaptureSession.Preset.cif352x288 break; default: self.captureSession?.sessionPreset = AVCaptureSession.Preset.vga640x480 break; }

@DanaStefanoska
Copy link
Author

Thanks @mcarnoky001, I looked in the code and found kind of the same thing. I wanted an official answer for this so if I can setup different values like bitrate also. I managed to set the quality on the video to VGA but it still was a very large file for me, so I also found the setup for bitrate in the code and set that to 128000 which significantly lowered the size of the video. That was fine for me at the moment, but all of my changes now live in the plugins xcode files.

I just wanted to leave this here so if anyone else has the same issue they can find this comments. However I think this should be stated in the documentation also.

@maxcodefaster
Copy link

Thanks @mcarnoky001, I looked in the code and found kind of the same thing. I wanted an official answer for this so if I can setup different values like bitrate also. I managed to set the quality on the video to VGA but it still was a very large file for me, so I also found the setup for bitrate in the code and set that to 128000 which significantly lowered the size of the video. That was fine for me at the moment, but all of my changes now live in the plugins xcode files.

I just wanted to leave this here so if anyone else has the same issue they can find this comments. However I think this should be stated in the documentation also.

Where did you set the bitrate?

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

3 participants