CameraKit / camerakit-android

Library for Android Camera 1 and 2 APIs. Massively increase stability and reliability of photo and video capture on all Android devices.
https://camerakit.io
MIT License
5.36k stars 878 forks source link

video aspect ratio #576

Open FuherProgramer opened 4 years ago

FuherProgramer commented 4 years ago

Is this a bug report?

(hi first thanks for this great library ..but i'm facing and issue about video aspect ratio in some devices like "wiko" on portrait mode but is ok in landscape! mode please see the images below Capture d'écrans_20191002-072251 Capture d'écrans_20191002-072301 Capture d'écrans_20191002-072452

and this is my xml part <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context=".RecordVideo" android:id="@+id/root" android:layout_width="match_parent" android:layout_height="match_parent">

<com.wonderkiln.camerakit.CameraView
    xmlns:camerakit="http://schemas.android.com/apk/res-auto"
    android:id="@+id/camera"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:adjustViewBounds="true"
    android:keepScreenOn="true"
    app:cameraAudio="off"
    app:cameraAudioBitRate="1280000"
    app:cameraAutoFocusMarker="@string/all_videos"
    app:cameraFacing="front"
    app:cameraFlash="on"
    app:cameraMode="video"
    app:cameraHdr="on"
    app:cameraPlaySounds="true"
    app:cameraPreview="texture"
    app:cameraVideoBitRate="2000000"
    app:cameraEngine="camera1"
    app:cameraVideoCodec="h264"
    app:ckCropOutput="false"
    app:ckDoubleTapToToggleFacing="false"
    app:ckFacing="back"
    app:ckFlash="on"
    app:ckFocus="continuous"
    app:ckJpegQuality="100"
    app:ckLockVideoAspectRatio="true"
    app:ckMethod="standard"
    app:ckPinchToZoom="false"
    app:ckVideoBitRate="2000000"
    app:ckVideoQuality="max480p"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent">
</com.wonderkiln.camerakit.CameraView>

<ImageButton
    android:id="@+id/Torch_btn"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginStart="8dp"
    android:layout_marginTop="8dp"
    android:background="@drawable/selector_flash"
    android:src="@drawable/ic_flash_off"
    android:textColor="@color/whait"
    app:layout_constraintBottom_toTopOf="@+id/linearLayout3"
    app:layout_constraintEnd_toEndOf="@+id/camera"
    app:layout_constraintStart_toStartOf="@+id/camera"
    app:layout_constraintTop_toTopOf="@+id/camera"
    app:layout_constraintHorizontal_bias="0.06"
    app:layout_constraintVertical_bias="0.034" />

<ImageButton
    android:id="@+id/photo_btn"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginStart="8dp"
    android:layout_marginTop="8dp"
    android:background="@drawable/selector_flash"
    android:src="@drawable/ic_camera_switch"
    android:textColor="@color/whait"
    app:layout_constraintBottom_toTopOf="@+id/linearLayout3"
    app:layout_constraintEnd_toEndOf="@+id/camera"
    app:layout_constraintStart_toStartOf="@+id/camera"
    app:layout_constraintTop_toTopOf="@+id/camera"
    app:layout_constraintHorizontal_bias="0.9"
    app:layout_constraintVertical_bias="0.034"/>

<ImageButton
    android:id="@+id/RecordingVideo_"
    android:layout_width="50dp"
    android:layout_height="50dp"
    android:layout_gravity="center_vertical"
    android:layout_marginStart="8dp"
    android:background="@drawable/recordselector"
    android:text="StopRec"
    app:layout_constraintBottom_toBottomOf="@+id/linearLayout3"
    app:layout_constraintEnd_toEndOf="@+id/linearLayout3"
    app:layout_constraintHorizontal_bias="0.5"
    app:layout_constraintStart_toStartOf="@+id/linearLayout3"
    app:layout_constraintTop_toTopOf="@+id/linearLayout3"
    app:layout_constraintVertical_bias="0.25"
    android:visibility="visible"/>

<TextView
    android:id="@+id/VideoRecordingIcon"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:drawableLeft="@drawable/ic_point_recording"
    android:text=" REC"
    android:textColor="#e51117"
    android:textSize="14sp"
    android:textStyle="bold"
    android:visibility="visible"
    app:layout_constraintBottom_toBottomOf="@+id/linearLayout3"
    app:layout_constraintEnd_toEndOf="@+id/linearLayout3"
    app:layout_constraintHorizontal_bias="0.043"
    app:layout_constraintStart_toStartOf="@+id/linearLayout3"
    app:layout_constraintTop_toTopOf="@+id/linearLayout3"
    app:layout_constraintVertical_bias="0.14" />

<Chronometer
    android:id="@+id/simpleChronometer"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textColor="#e51117"
    android:textSize="16sp"
    android:visibility="visible"
    app:layout_constraintBottom_toBottomOf="@+id/linearLayout3"
    app:layout_constraintEnd_toEndOf="@+id/linearLayout3"
    app:layout_constraintHorizontal_bias="0.044"
    app:layout_constraintStart_toStartOf="@+id/linearLayout3"
    app:layout_constraintTop_toTopOf="@+id/linearLayout3"
    app:layout_constraintVertical_bias="0.42" />

<ProgressBar
    android:id="@+id/progressbar"
    style="?android:attr/progressBarStyleHorizontal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="8dp"
    android:layout_marginLeft="8dp"
    android:layout_marginRight="8dp"
    android:layout_marginBottom="5dp"
    android:theme="@style/RedAccent"
    app:layout_constraintBottom_toBottomOf="@+id/linearLayout3"
    app:layout_constraintEnd_toEndOf="@+id/linearLayout3"
    app:layout_constraintStart_toStartOf="@+id/linearLayout3"
    app:layout_constraintTop_toBottomOf="@+id/RecordingVideo_" />

<ImageButton
    android:id="@+id/front_back_btn"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginEnd="16dp"
    android:background="@drawable/selector_flash"
    android:src="@drawable/ic_camera_front"
    app:layout_constraintBottom_toBottomOf="@+id/linearLayout3"
    app:layout_constraintEnd_toEndOf="@+id/linearLayout3"
    app:layout_constraintTop_toTopOf="@+id/linearLayout3"
    app:layout_constraintVertical_bias="0.217" />

<LinearLayout
    android:id="@+id/linearLayout3"
    android:layout_width="match_parent"
    android:layout_height="90dp"
    android:layout_marginTop="8dp"
    android:background="@color/appBlackless_2_transparant"
    android:orientation="horizontal"
    app:layout_constraintBottom_toBottomOf="@+id/camera"
    app:layout_constraintTop_toTopOf="@+id/camera"
    app:layout_constraintVertical_bias="0.974"
    tools:layout_editor_absoluteX="16dp" />

</androidx.constraintlayout.widget.ConstraintLayout>

so can i fix that and works on all devices? )

Have you read the Contributing Guidelines?

(Write your answer here.)

Environment

(Please include the following information along with any other relevant environment details.)

CameraKit Version:

Android Device:

Android Version:

Steps to Reproduce

(Write your steps here:)

1. 2. 3.

Expected Behavior

(Write what you thought would happen.)

Actual Behavior

(Write what happened. Add screenshots!)

Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

(Include your CameraKit setup and usage.)

ARRR42 commented 4 years ago

same issue here