What-the-Flutter / Flutter-WebRTC

23 stars 8 forks source link

Remote Camera Feed Not Displaying #1

Open muranski opened 9 months ago

muranski commented 9 months ago

Thank you for the excellent code and detailed instructions for the Flutter-WebRTC video chat application. I successfully executed the app on two different phones. However, I am only able to see the video feed from the local camera on each device, and the video feed from the remote camera does not appear.

Here is the log from the second device, after I pressed "Open camera and Join room" with a room id to which the first device is already connected:

D/InputConnectionAdaptor(12434): The input method toggled cursor monitoring off
I/org.webrtc.Logging(12434): EglRenderer: Duration: 4020 ms. Frames received: 0. Dropped: 0. Rendered: 0. Render fps: .0. Average render time: NA. Average swapBuffer time: NA.
I/org.webrtc.Logging(12434): EglRenderer: Duration: 4020 ms. Frames received: 0. Dropped: 0. Rendered: 0. Render fps: .0. Average render time: NA. Average swapBuffer time: NA.
D/CompatibilityChangeReporter(12434): Compat change id reported: 78294732; UID 10221; state: ENABLED
I/FlutterWebRTCPlugin(12434): getUserMedia(audio): mandatory: [], optional: [googNoiseSuppression: true, googEchoCancellation: true, echoCancellation: true, googEchoCancellation2: true, googDAEchoCancellation: true]
I/FlutterWebRTCPlugin(12434): getUserMedia(video): null
I/CameraManagerGlobal(12434): Connecting to camera service
D/FlutterWebRTCPlugin(12434): Creating video capturer using Camera2 API.
D/FlutterWebRTCPlugin(12434): Create front camera 1 succeeded
I/org.webrtc.Logging(12434): EglBase14Impl: Using OpenGL ES version 2
I/org.webrtc.Logging(12434): CameraCapturer: startCapture: 1280x720@30
D/FlutterWebRTCPlugin(12434): changeCaptureFormat: 1280x720@30
I/org.webrtc.Logging(12434): Camera2Session: Create new camera2 session on camera 1
D/FlutterWebRTCPlugin(12434): MediaStream id: 501e6352-bd88-4f90-a94f-959961c27c9d
I/org.webrtc.Logging(12434): Camera2Session: start
I/org.webrtc.Logging(12434): Camera2Session: Available preview sizes: [3264x2448, 3264x1836, 3200x2400, 2688x1512, 2592x1944, 2560x1280, 2048x1536, 1920x1440, 1920x1080, 1920x960, 1600x1200, 1440x1080, 1280x960, 1280x720, 1024x768, 800x600, 720x480, 640x480, 640x360, 352x288, 320x240, 176x144]
I/org.webrtc.Logging(12434): Camera2Session: Available fps ranges: [[15.0:15.0], [15.0:30.0], [30.0:30.0], [15.0:60.0], [60.0:60.0]]
I/org.webrtc.Logging(12434): Camera2Session: Using capture format: 1280x720@[15.0:30.0]
I/org.webrtc.Logging(12434): Camera2Session: Opening camera 1
D/FlutterWebRTCPlugin(12434): CameraEventsHandler.onCameraOpening: cameraName=1
I/org.webrtc.Logging(12434): Camera2Session: Camera opened.
W/FlutterWebRTCPlugin(12434): FlutterRTCVideoRenderer.setVideoTrack, set video track to 81bf9cd5-b35d-48f3-8e7e-9f7ff8086772
I/org.webrtc.Logging(12434): EglRenderer: Releasing.
I/org.webrtc.Logging(12434): EglRenderer: eglBase detach and release.
I/org.webrtc.Logging(12434): EglRenderer: Releasing done.
I/org.webrtc.Logging(12434): EglRenderer: Quitting render thread.
I/org.webrtc.Logging(12434): EglRenderer: Initializing EglRenderer
I/org.webrtc.Logging(12434): EglRenderer: EglBase.create shared context
I/org.webrtc.Logging(12434): EglBase14Impl: Using OpenGL ES version 2
W/DynamiteModule(12434): Local module descriptor class for com.google.android.gms.providerinstaller.dynamite not found.
I/DynamiteModule(12434): Considering local module com.google.android.gms.providerinstaller.dynamite:0 and remote module com.google.android.gms.providerinstaller.dynamite:0
W/ProviderInstaller(12434): Failed to load providerinstaller module: No acceptable module com.google.android.gms.providerinstaller.dynamite found. Local version is 0 and remote version is 0.
I/org.webrtc.Logging(12434): Camera2Session: Camera capture session configured.
I/org.webrtc.Logging(12434): Camera2Session: Using video stabilization.
I/org.webrtc.Logging(12434): Camera2Session: Auto-focus is not available.
I/org.webrtc.Logging(12434): Camera2Session: Camera device successfully started.
I/org.webrtc.Logging(12434): CameraCapturer: Create session done. Switch state: IDLE
I/org.webrtc.Logging(12434): SurfaceTextureHelper: Setting listener to org.webrtc.Camera2Session$CaptureSessionCallback$$ExternalSyntheticLambda0@c9cd059
D/nativeloader(12434): Configuring clns-5 for other apk /system/framework/org.apache.http.legacy.jar. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~wEij3og8UTfnOQx6tP5psQ==/com.google.android.gms-b2WnXQ07UKM5_0nQSydOTg==/lib/arm64:/data/app/~~wEij3og8UTfnOQx6tP5psQ==/com.google.android.gms-b2WnXQ07UKM5_0nQSydOTg==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
D/nativeloader(12434): Configuring clns-6 for other apk /system/framework/com.android.media.remotedisplay.jar. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~wEij3og8UTfnOQx6tP5psQ==/com.google.android.gms-b2WnXQ07UKM5_0nQSydOTg==/lib/arm64:/data/app/~~wEij3og8UTfnOQx6tP5psQ==/com.google.android.gms-b2WnXQ07UKM5_0nQSydOTg==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
W/video_streaming(12434): Loading /data/misc/apexdata/com.android.art/dalvik-cache/arm64/system@framework@com.android.location.provider.jar@classes.odex non-executable as it requires an image which we failed to load
D/nativeloader(12434): Configuring clns-7 for other apk /system/framework/com.android.location.provider.jar. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~wEij3og8UTfnOQx6tP5psQ==/com.google.android.gms-b2WnXQ07UKM5_0nQSydOTg==/lib/arm64:/data/app/~~wEij3og8UTfnOQx6tP5psQ==/com.google.android.gms-b2WnXQ07UKM5_0nQSydOTg==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
D/nativeloader(12434): Configuring clns-8 for other apk /data/app/~~wEij3og8UTfnOQx6tP5psQ==/com.google.android.gms-b2WnXQ07UKM5_0nQSydOTg==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~wEij3og8UTfnOQx6tP5psQ==/com.google.android.gms-b2WnXQ07UKM5_0nQSydOTg==/lib/arm64:/data/app/~~wEij3og8UTfnOQx6tP5psQ==/com.google.android.gms-b2WnXQ07UKM5_0nQSydOTg==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
V/NativeCrypto(12434): Registering com/google/android/gms/org/conscrypt/NativeCrypto's 304 native methods...
W/video_streaming(12434): Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (unsupported, reflection, allowed)
I/ProviderInstaller(12434): Installed default security provider GmsCore_OpenSSL
D/FlutterWebRTCPlugin(12434): CameraEventsHandler.onFirstFrameAvailable
D/TrafficStats(12434): tagSocket(208) with statsTag=0xffffffff, statsUid=-1
W/video_streaming(12434): Accessing hidden field Ljava/net/Socket;->impl:Ljava/net/SocketImpl; (unsupported, reflection, allowed)
W/video_streaming(12434): Accessing hidden method Ljava/security/spec/ECParameterSpec;->setCurveName(Ljava/lang/String;)V (unsupported, reflection, allowed)
I/org.webrtc.Logging(12434): EglRenderer: Duration: 4012 ms. Frames received: 0. Dropped: 0. Rendered: 0. Render fps: .0. Average render time: NA. Average swapBuffer time: NA.
I/org.webrtc.Logging(12434): CameraStatistics: Camera fps: 27.
I/org.webrtc.Logging(12434): EglRenderer: Duration: 4005 ms. Frames received: 107. Dropped: 0. Rendered: 107. Render fps: 26.7. Average render time: 1626 us. Average swapBuffer time: 721 us.
I/org.webrtc.Logging(12434): CameraStatistics: Camera fps: 30.
I/org.webrtc.Logging(12434): EglRenderer: Duration: 4006 ms. Frames received: 0. Dropped: 0. Rendered: 0. Render fps: .0. Average render time: NA. Average swapBuffer time: NA.
I/org.webrtc.Logging(12434): CameraStatistics: Camera fps: 30.

Please also see the attached screenshot: Screenshot_20240125-160442

lightspect commented 8 months ago

Can you check to see if you have this exception in your log on the join device? Unhandled Exception: Unable to RTCPeerConnection::setRemoteDescription: peerConnectionSetRemoteDescription(): WEBRTC_SET_REMOTE_DESCRIPTION_ERROR: Failed to set remote answer sdp: Called in wrong state: stable I got this exception when I updated the flutter_webrtc plugin to the latest version. Using the default version in the repository gave me a Camera exception instead, so it seem to be related to the plugin