Search code examples
androidandroid-fragmentsvideo-recordingziggeo-apiziggeo-sdk

How to create Ziggeo embedded Video Recorder for android


I have created Ziggeo embedded Video Recorder and my view requirement is 320*320, but after implementation the camera resolution is not according to view(Open default camera resolution), So please help.

Java code here

Ziggeo ziggeo1 = new Ziggeo(appToken, this);
        RecorderConfig config = ziggeo1.getRecorderConfig();
        config.setResolution(new Size(320, 320));
        RecorderConfig configBuilder = new RecorderConfig.Builder(this)
                .maxDuration(5000)
                .shouldSendImmediately(false)
                .shouldEnableCoverShot(false)
                .resolution(config.getResolution())
                .configureStopRecordingConfirmationDialog(new StopRecordingConfirmationDialogConfig())
                .shouldConfirmStopRecording(true)
                .facing(CameraView.FACING_FRONT)
                .shouldShowFaceOutline(true)
                .quality(CameraView.QUALITY_HIGH)
                .callback(this)
                .build();


        ziggeo1.setRecorderConfig(configBuilder);
        ziggeo1.enableCrashTracker(this);
        ziggeo1.attachCameraRecorder(getSupportFragmentManager(), R.id.video_container);

Xml code here

<LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/recorder_layout"
            android:orientation="vertical"
            android:layout_marginTop="20dp"
            android:layout_gravity="center">
            <FrameLayout
                android:id="@+id/video_container"
                android:layout_width="320dp"
                android:layout_height="320dp"
                />
        </LinearLayout>

Solution

  • First of let me just mentioned Pawan that I work at Ziggeo, so keeping that in mind, hopefully the next helps you and anyone else.

    The method that sets resolution can be used only to specify your desired resolution. Because there is no internal video processor which will transcode the video, the Ziggeo SDK tries to find the nearest resolution to that desired. It does that by selecting one from those that are actually available.

    In other words on some devices when you were to set 320x320 it will choose 320x270 instead. It has to based on the device available resolutions.

    Now, to make the setup of the resolutions easier or closer to what you want, what my colleague working on the SDK will make some changes allowing you to set the width and height or width/height and ratio that you want to keep so it would pick the best resolution based on that.

    I would also like to mention that your camera view and actual video resolutions can be different and still previewed properly in case that is what you were referring to.