Camera Video Ratio

Hi, i’ve want 1:1 result of my video but is not working. I use props ‘1:1’ and style the camera with and same length, but still the result of the video would be 3:4. This is my code

<View style={{ flex: 1 }}>
<Camera
ratio={ ‘1:1’ }
autoFocus={Camera.Constants.AutoFocus.on}
style={{ flex: 1 }}
type={ this.state.cameraType }
ref={ref => { this.camera = ref; }}>

<View style={ styles.camera__actions }>
<Touchable style={ styles.camera__actions__item } onPress={ this.flipCamera } disabled={ this.state.recording }>
<Text style={{ color: this.state.recording ? ‘grey’ : ‘black’ }}>Flip Camera

<Touchable style={ styles.camera__actions__item } onPress={ this.recordingVideo }>
{ this.state.recording ? ‘Stop’ : ‘Record’ }

<Touchable style={ styles.camera__actions__item }>
<Text style={{ color: this.state.recording ? ‘black’ : ‘grey’ }}>Durasi: { this.state.timeInterval } detik


1 Like

Hi @kevinhimawanhie

You can use ImagePicker.launchCameraAsync from expo,
you don’t need to create your own design for the camera.

launchCamera = async () => {
const {
status: cameraPerm
} = await Permissions.askAsync(Permissions.CAMERA);
const {
status: cameraRollPerm
} = await Permissions.askAsync(Permissions.CAMERA_ROLL);
if (cameraRollPerm === ‘granted’) {
let result = await ImagePicker.launchCameraAsync({
allowsEditing: true,
aspect: [1, 1],
});
}
};

Thanks

2 Likes

Hi did you solve this problem cause I’m also trying to take videos in 1:1 ratio

1 Like

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