livekit / client-sdk-android

LiveKit SDK for Android
https://docs.livekit.io
Apache License 2.0
185 stars 76 forks source link

video image distorted when recording local video andsave #206

Open ocean2811 opened 1 year ago

ocean2811 commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. clone https://github.com/livekit/client-sdk-android/tree/main/sample-app-record-local

  2. Modify file sample-app-record-local/src/main/java/io/livekit/android/sample/record/MainActivity.kt

    room = LiveKit.create(
            appContext = applicationContext,
            options = RoomOptions(
                adaptiveStream = true,
                audioTrackCaptureDefaults = LocalAudioTrackOptions(
                    noiseSuppression = true,
                    echoCancellation = true,
                    autoGainControl = true,
                    highPassFilter = true,
                    typingNoiseDetection = true,
                ),
                videoTrackCaptureDefaults = LocalVideoTrackOptions(
                    deviceId = "",
                    position = CameraPosition.BACK,
                    captureParams = VideoCaptureParameter(1920, 1080, 30)
                ),
                audioTrackPublishDefaults = AudioTrackPublishDefaults(),
                videoTrackPublishDefaults = VideoTrackPublishDefaults(null, false)
            ),
            overrides = LiveKitOverrides(
                javaAudioDeviceModuleCustomizer = { builder ->
                    // Receive audio samples
                    builder.setSamplesReadyCallback { samples ->
                        videoFileRenderer?.onWebRtcAudioRecordSamplesReady(samples)
                    }
                }
            )
        )
  3. build and run

  4. See error

Additional context The suspicion may be related to my specified resolution captureParams = VideoCaptureParameter(1920, 1080, 30)

RXlung commented 4 months ago

Hello, may I ask if you were able to record successfully? After recording, I found that the videos were all black with no screen and only sound.