pinkfish / flutter_rtmppublisher

Publisher to rtmp using the camera plugin as a basis to do all the basic camera/record management.
BSD 3-Clause "New" or "Revised" License
95 stars 121 forks source link

Closes the connection if EOF is received #26

Open IBurychka opened 3 years ago

IBurychka commented 3 years ago

We are working with livepeer (https://livepeer.org/) and are facing an issue in development. The livepeer sends an EOF when the connection state resets. This is the type of behavior that most RTMP sdks expect. However, flutter_rtmppublisher closes the connection if EOF is received. It would be great if the connection stays open on EOF.

log: V/AudioManager( 1783): playSoundEffect effectType: 0 V/AudioManager( 1783): querySoundEffectsEnabled... V/AudioManager( 1783): isWiredHeadsetOn... V/AudioManager( 1783): isBluetoothA2dpOn... I/Stuff ( 1783): {bitrate=1228800, url=rtmp://[my url] , textureId=3} I/FlutterCamera( 1783): prepareCameraForRecordAndStream(opengl=true, portrait: true, currentOrientation: 0, mediaOrientation: 270, frontfacing: true) I/MicrophoneManager( 1783): Microphone created, 32000hz, Stereo V/ACodec ( 1783): Now uninitialized V/ACodec ( 1783): onAllocateComponent I/OMXClient( 1783): Using client-side OMX mux. E/OMXMaster( 1783): A component of name 'OMX.qcom.audio.decoder.aac' already exists, ignoring this one. V/ACodec ( 1783): [OMX.google.aac.encoder] Now Loaded V/ACodec ( 1783): onConfigureComponent I/AudioEncoder( 1783): prepared I/VideoEncoder( 1783): VideoEncoder OMX.qcom.video.encoder.avc I/VideoEncoder( 1783): Color supported: 2141391876 I/VideoEncoder( 1783): Color supported: 2130708361 V/ACodec ( 1783): Now uninitialized V/ACodec ( 1783): onAllocateComponent I/OMXClient( 1783): Using client-side OMX mux. V/ACodec ( 1783): [OMX.qcom.video.encoder.avc] Now Loaded I/VideoEncoder( 1783): Prepare video info: SURFACE, 144x176 V/ACodec ( 1783): onConfigureComponent E/ACodec ( 1783): [OMX.qcom.video.encoder.avc] storeMetaDataInBuffers (output) failed w/ err -1010 W/ACodec ( 1783): do not know color format 0x7fa30c04 = 2141391876 W/ACodec ( 1783): do not know color format 0x7f000789 = 2130708361 I/ACodec ( 1783): [OMX.qcom.video.encoder.avc] setupVideoEncoder succeeded W/ACodec ( 1783): do not know color format 0x7f000789 = 2130708361 V/ACodec ( 1783): [OMX.qcom.video.encoder.avc] input format is AMessage(what = 0x00000000) = { V/ACodec ( 1783): string mime = "video/raw" V/ACodec ( 1783): int32_t stride = 144 V/ACodec ( 1783): int32_t slice-height = 176 V/ACodec ( 1783): int32_t color-format = 2130708361 V/ACodec ( 1783): int32_t width = 144 V/ACodec ( 1783): int32_t height = 176 V/ACodec ( 1783): } V/ACodec ( 1783): [OMX.qcom.video.encoder.avc] output format is AMessage(what = 'codc', target = 19) = { V/ACodec ( 1783): string mime = "video/avc" V/ACodec ( 1783): int32_t width = 144 V/ACodec ( 1783): int32_t height = 176 V/ACodec ( 1783): } V/ACodec ( 1783): onCreateInputSurface I/VideoEncoder( 1783): prepared I/RtmpCameraConnector( 1783): prepareGlInterface 0 true E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so V/Camera ( 1783): Close recoordingCaptureSession I/RequestQueue( 1783): Repeating capture request cancelled. I/RequestThread-1( 1783): Flushing all pending requests. E/RequestQueue( 1783): cancel failed: no repeating request exists. W/RequestHolder( 1783): Capture failed for request: 0 I/CameraDeviceState( 1783): Legacy camera service transitioning to state IDLE V/Camera ( 1783): createCaptureSession 640x480 mediaOrientation: 270 currentOrientation: 0 sensorOrientation: 270 porteait: true I/CameraDeviceState( 1783): Legacy camera service transitioning to state CONFIGURING I/RequestThread-1( 1783): Configure outputs: 2 surfaces configured. D/Camera ( 1783): stopPreview D/Camera ( 1783): app passed NULL surface E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so I/CameraDeviceState( 1783): Legacy camera service transitioning to state IDLE V/Camera ( 1783): open successful I/RequestQueue( 1783): Repeating capture request set. I/SrsFlvMuxer( 1783): worker: connecting to RTMP server by url=rtmp://fra-origin.livepeer.live/[my url] D/RtmpConnection( 1783): connect() called. Host: fra-origin.livepeer.live, port: 1935, appName: n6f1-bqx5-1d6j, publishPath: [...my path] I/System ( 1783): core_booster, getBoosterConfig = false W/LegacyRequestMapper( 1783): convertRequestMetadata - control.awbRegions setting is not supported, ignoring value W/LegacyRequestMapper( 1783): Only received metering rectangles with weight 0. W/LegacyRequestMapper( 1783): convertRequestToMetadata - Ignoring android.lens.focusDistance false, only 0.0f is supported I/System.out( 1783): [socket][3] connection fra-origin.livepeer.live/195.181.174.250:1935;LocalPort=60780(5000) I/System.out( 1783): [CDS]connect[fra-origin.livepeer.live/195.181.174.250:1935] tm:5 I/System.out( 1783): [socket][/192.168.0.101:60780] connected D/RtmpConnection( 1783): connect(): socket connection established, doing handhake... D/Handshake( 1783): writeC0 D/Handshake( 1783): writeC1 D/Handshake( 1783): writeC1(): Calculating digest offset D/Handshake( 1783): writeC1(): (real value of) digestOffset: 504 D/Handshake( 1783): writeC1(): recalculated digestOffset: 1280 D/Handshake( 1783): writeC1(): digestOffsetBytes: 0000F9FF D/Handshake( 1783): partBeforeDigest(): size: 1280 D/Handshake( 1783): writeC1(): Writing timestamp and Flash Player version D/Handshake( 1783): partAfterDigest(): size: 224 D/Handshake( 1783): copying digest offset bytes in partBeforeDigest D/Handshake( 1783): writeC1(): Calculating digest D/Handshake( 1783): writeC1(): writing C1 packet D/Handshake( 1783): readS0 D/Handshake( 1783): readS1 D/Handshake( 1783): readS1(): S1 total bytes read OK D/Handshake( 1783): writeC2 D/Handshake( 1783): readS2 D/Handshake( 1783): readS2(): S2 total bytes read OK D/RtmpConnection( 1783): connect(): handshake done D/RtmpConnection( 1783): rtmpConnect(): Building 'connect' invoke packet D/RtmpConnection( 1783): wrote packet: RTMP Command (command: connect, transaction ID: 1), size: 298 D/RtmpConnection( 1783): starting main rx handler loop I/RtmpConnection( 1783): handleRxInvoke: Got result for invoked method: connect D/RtmpConnection( 1783): createStream(): Sending releaseStream command... D/RtmpConnection( 1783): wrote packet: RTMP Command (command: releaseStream, transaction ID: 2), size: 39 D/RtmpConnection( 1783): createStream(): Sending FCPublish command... D/RtmpConnection( 1783): wrote packet: RTMP Command (command: FCPublish, transaction ID: 3), size: 35 D/RtmpConnection( 1783): createStream(): Sending createStream command... D/RtmpConnection( 1783): wrote packet: RTMP Command (command: createStream, transaction ID: 4), size: 25 D/RtmpDecoder( 1783): readPacket(): Setting chunk size to: 65536 D/RtmpConnection( 1783): handleRxPacketLoop(): Setting acknowledgement window size: 2500000 D/RtmpConnection( 1783): handleRxPacketLoop(): Send acknowledgement window size: 524288 D/RtmpConnection( 1783): wrote packet: RTMP Window Acknowledgment Size, size: 4 I/System.out( 1783): [CDS]SO_SNDBUF:524288 D/RtmpConnection( 1783): handleRxInvoke(): 'onFCPublish' I/RtmpConnection( 1783): handleRxInvoke: Got result for invoked method: createStream D/RtmpConnection( 1783): handleRxInvoke(): Stream ID to publish: 1 D/RtmpConnection( 1783): fmlePublish(): Sending publish command... D/RtmpConnection( 1783): wrote packet: RTMP Command (command: publish, transaction ID: 0), size: 40 W/RtmpConnection( 1783): handleRxPacketLoop(): Not handling unimplemented/unknown packet of type: ACKNOWLEDGEMENT E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so I/CameraDeviceState( 1783): Legacy camera service transitioning to state CAPTURING E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/gralloc.msm8909.so I/RtmpConnection( 1783): handleRxPacketLoop(): Stream EOF reached, closing RTMP writer... D/RtmpConnection( 1783): handleRxInvoke(): onStatus NetStream.Play.Stop D/RtmpConnection( 1783): handleRxInvoke(): onStatus NetStream.Play.UnpublishNotify W/CameraCaptureSession( 1783): Session 1: The camera device was already closed: W/CameraCaptureSession( 1783): java.lang.IllegalStateException: CameraDevice was already closed W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInError(CameraDeviceImpl.java:1482) W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDeviceImpl.java:677) W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:328) W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraCaptureSessionImpl.finalize(CameraCaptureSessionImpl.java:561) W/CameraCaptureSession( 1783): at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:191) W/CameraCaptureSession( 1783): at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:174) W/CameraCaptureSession( 1783): at java.lang.Thread.run(Thread.java:831) W/CameraCaptureSession( 1783): Session 1: The camera device was already closed: W/CameraCaptureSession( 1783): java.lang.IllegalStateException: CameraDevice was already closed W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInError(CameraDeviceImpl.java:1482) W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDeviceImpl.java:677) W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:328) W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraCaptureSessionImpl.finalize(CameraCaptureSessionImpl.java:561) W/CameraCaptureSession( 1783): at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:191) W/CameraCaptureSession( 1783): at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:174) W/CameraCaptureSession( 1783): at java.lang.Thread.run(Thread.java:831) W/CameraCaptureSession( 1783): Session 1: The camera device was already closed: W/CameraCaptureSession( 1783): java.lang.IllegalStateException: CameraDevice was already closed W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInError(CameraDeviceImpl.java:1482) W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDeviceImpl.java:677) W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:328) W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraCaptureSessionImpl.finalize(CameraCaptureSessionImpl.java:561) W/CameraCaptureSession( 1783): at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:191) W/CameraCaptureSession( 1783): at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:174) W/CameraCaptureSession( 1783): at java.lang.Thread.run(Thread.java:831) I/System.out( 1783): [CDS]close[60780] I/System.out( 1783): close [socket][/0.0.0.0:60780] D/RtmpConnection( 1783): socket closed I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped W/Adreno-EGLSUB( 1783): : dequeue native buffer fail: No such device, buffer=0x0, handle=0x0 V/ACodec ( 1783): Now uninitialized W/Adreno-EGL( 1783): : EGL_BAD_SURFACE I/Choreographer( 1783): Skipped 267 frames! The application may be doing too much work on its main thread. I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped W/ALooperRoster( 1783): failed to deliver message. Target handler 19 registered, but object gone. I/VideoEncoder( 1783): stopped I/AudioEncoder( 1783): stopped V/ACodec ( 1783): Now uninitialized W/Adreno-EGLSUB( 1783): : dequeue native buffer fail: No such device, buffer=0x0, handle=0x0 W/Adreno-EGL( 1783): : EGL_BAD_SURFACE I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Failed retry} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/art ( 1783): Background sticky concurrent mark sweep GC freed 366251(11MB) AllocSpace objects, 0(0B) LOS objects, 40% free, 11MB/19MB, paused 812us total 104.943ms at GCDaemon thread CareAboutPauseTimes 1 E/BufferQueueProducer( 1783): [unnamed-1783-18] dequeueBuffer: BufferQueue has been abandoned W/Adreno-EGLSUB( 1783): : dequeue native buffer fail: No such device, buffer=0x0, handle=0x0 W/Adreno-EGL( 1783): : EGL_BAD_SURFACE E/CameraDeviceGLThread-1( 1783): Received exception on GL render thread: E/CameraDeviceGLThread-1( 1783): java.lang.IllegalStateException: swapBuffers: EGL error: 0x300d E/CameraDeviceGLThread-1( 1783): at android.hardware.camera2.legacy.SurfaceTextureRenderer.checkEglError(SurfaceTextureRenderer.java:530) E/CameraDeviceGLThread-1( 1783): at android.hardware.camera2.legacy.SurfaceTextureRenderer.swapBuffers(SurfaceTextureRenderer.java:523) E/CameraDeviceGLThread-1( 1783): at android.hardware.camera2.legacy.SurfaceTextureRenderer.drawIntoSurfaces(SurfaceTextureRenderer.java:729) E/CameraDeviceGLThread-1( 1783): at android.hardware.camera2.legacy.GLThreadManager$1.handleMessage(GLThreadManager.java:105) E/CameraDeviceGLThread-1( 1783): at android.os.Handler.dispatchMessage(Handler.java:98) E/CameraDeviceGLThread-1( 1783): at android.os.Looper.loop(Looper.java:135) E/CameraDeviceGLThread-1( 1783): at android.os.HandlerThread.run(HandlerThread.java:61) I/CameraDeviceState( 1783): Legacy camera service transitioning to state ERROR V/Camera ( 1783): onError(1) V/Camera ( 1783): Close recoordingCaptureSession W/RtmpCamera( 1783): Error from camera W/RtmpCamera( 1783): android.hardware.camera2.CameraAccessException: The camera device has encountered a serious error W/RtmpCamera( 1783): at android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInError(CameraDeviceImpl.java:1478) W/RtmpCamera( 1783): at android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDeviceImpl.java:677) W/RtmpCamera( 1783): at android.hardware.camera2.impl.CameraCaptureSessionImpl.stopRepeating(CameraCaptureSessionImpl.java:239) W/RtmpCamera( 1783): at com.whelksoft.camera_with_rtmp.Camera.closeCaptureSession(Camera.kt:485) W/RtmpCamera( 1783): at com.whelksoft.camera_with_rtmp.Camera.close(Camera.kt:498) W/RtmpCamera( 1783): at com.whelksoft.camera_with_rtmp.Camera$open$1.onError(Camera.kt:149) W/RtmpCamera( 1783): at android.hardware.camera2.impl.CameraDeviceImpl$CameraDeviceCallbacks$1.run(CameraDeviceImpl.java:1207) W/RtmpCamera( 1783): at android.os.Handler.handleCallback(Handler.java:739) W/RtmpCamera( 1783): at android.os.Handler.dispatchMessage(Handler.java:95) W/RtmpCamera( 1783): at android.os.Looper.loop(Looper.java:135) W/RtmpCamera( 1783): at android.app.ActivityThread.main(ActivityThread.java:5593) W/RtmpCamera( 1783): at java.lang.reflect.Method.invoke(Native Method) W/RtmpCamera( 1783): at java.lang.reflect.Method.invoke(Method.java:372) W/RtmpCamera( 1783): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960) W/RtmpCamera( 1783): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) E/RequestThread-1( 1783): Timed out while waiting for request to complete. W/CaptureCollector( 1783): Preview buffers dropped for request: 1 E/CameraDeviceState( 1783): Cannot receive result while in state: 0 E/CameraDeviceState( 1783): Cannot receive result while in state: 0 E/CameraDeviceState( 1783): Cannot receive result while in state: 0 E/BufferQueueProducer( 1783): [unnamed-1783-19] cancelBuffer: BufferQueue has been abandoned E/BufferQueueProducer( 1783): [unnamed-1783-19] cancelBuffer: BufferQueue has been abandoned E/BufferQueueProducer( 1783): [unnamed-1783-19] cancelBuffer: BufferQueue has been abandoned E/BufferQueueProducer( 1783): [unnamed-1783-19] cancelBuffer: BufferQueue has been abandoned E/BufferQueueProducer( 1783): [unnamed-1783-19] cancelBuffer: BufferQueue has been abandoned E/BufferQueueProducer( 1783): [unnamed-1783-19] cancelBuffer: BufferQueue has been abandoned E/BufferQueueProducer( 1783): [unnamed-1783-19] cancelBuffer: BufferQueue has been abandoned E/BufferQueueProducer( 1783): [unnamed-1783-19] cancelBuffer: BufferQueue has been abandoned E/BufferQueueProducer( 1783): [unnamed-1783-19] cancelBuffer: BufferQueue has been abandoned E/BufferQueueProducer( 1783): [unnamed-1783-19] cancelBuffer: BufferQueue has been abandoned I/Choreographer( 1783): Skipped 243 frames! The application may be doing too much work on its main thread. I/flutter ( 1783): Event {eventType: error, errorDescription: The camera device is in use already.} I/flutter ( 1783): Event {eventType: camera_closing}

pinkfish commented 3 years ago

Ok, I see the close event. It should reopen the connection and not close it then? Do a retry?

On Thu, 30 Jul 2020 at 23:55, IBurychka notifications@github.com wrote:

We are working with livepeer (https://livepeer.org/) and are facing an issue in development. The livepeer sends an EOF when the connection state resets. This is the type of behavior that most RTMP sdks expect. However, flutter_rtmppublisher closes the connection if EOF is received. It would be great if the connection stays open on EOF.

log: V/AudioManager( 1783): playSoundEffect effectType: 0 V/AudioManager( 1783): querySoundEffectsEnabled... V/AudioManager( 1783): isWiredHeadsetOn... V/AudioManager( 1783): isBluetoothA2dpOn... I/Stuff ( 1783): {bitrate=1228800, url=rtmp://[my url] , textureId=3} I/FlutterCamera( 1783): prepareCameraForRecordAndStream(opengl=true, portrait: true, currentOrientation: 0, mediaOrientation: 270, frontfacing: true) I/MicrophoneManager( 1783): Microphone created, 32000hz, Stereo V/ACodec ( 1783): Now uninitialized V/ACodec ( 1783): onAllocateComponent I/OMXClient( 1783): Using client-side OMX mux. E/OMXMaster( 1783): A component of name 'OMX.qcom.audio.decoder.aac' already exists, ignoring this one. V/ACodec ( 1783): [OMX.google.aac.encoder] Now Loaded V/ACodec ( 1783): onConfigureComponent I/AudioEncoder( 1783): prepared I/VideoEncoder( 1783): VideoEncoder OMX.qcom.video.encoder.avc I/VideoEncoder( 1783): Color supported: 2141391876 I/VideoEncoder( 1783): Color supported: 2130708361 V/ACodec ( 1783): Now uninitialized V/ACodec ( 1783): onAllocateComponent I/OMXClient( 1783): Using client-side OMX mux. V/ACodec ( 1783): [OMX.qcom.video.encoder.avc] Now Loaded I/VideoEncoder( 1783): Prepare video info: SURFACE, 144x176 V/ACodec ( 1783): onConfigureComponent E/ACodec ( 1783): [OMX.qcom.video.encoder.avc] storeMetaDataInBuffers (output) failed w/ err -1010 W/ACodec ( 1783): do not know color format 0x7fa30c04 = 2141391876 W/ACodec ( 1783): do not know color format 0x7f000789 = 2130708361 I/ACodec ( 1783): [OMX.qcom.video.encoder.avc] setupVideoEncoder succeeded W/ACodec ( 1783): do not know color format 0x7f000789 = 2130708361 V/ACodec ( 1783): [OMX.qcom.video.encoder.avc] input format is AMessage(what = 0x00000000) = { V/ACodec ( 1783): string mime = "video/raw" V/ACodec ( 1783): int32_t stride = 144 V/ACodec ( 1783): int32_t slice-height = 176 V/ACodec ( 1783): int32_t color-format = 2130708361 V/ACodec ( 1783): int32_t width = 144 V/ACodec ( 1783): int32_t height = 176 V/ACodec ( 1783): } V/ACodec ( 1783): [OMX.qcom.video.encoder.avc] output format is AMessage(what = 'codc', target = 19) = { V/ACodec ( 1783): string mime = "video/avc" V/ACodec ( 1783): int32_t width = 144 V/ACodec ( 1783): int32_t height = 176 V/ACodec ( 1783): } V/ACodec ( 1783): onCreateInputSurface I/VideoEncoder( 1783): prepared I/RtmpCameraConnector( 1783): prepareGlInterface 0 true E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so V/Camera ( 1783): Close recoordingCaptureSession I/RequestQueue( 1783): Repeating capture request cancelled. I/RequestThread-1( 1783): Flushing all pending requests. E/RequestQueue( 1783): cancel failed: no repeating request exists. W/RequestHolder( 1783): Capture failed for request: 0 I/CameraDeviceState( 1783): Legacy camera service transitioning to state IDLE V/Camera ( 1783): createCaptureSession 640x480 mediaOrientation: 270 currentOrientation: 0 sensorOrientation: 270 porteait: true I/CameraDeviceState( 1783): Legacy camera service transitioning to state CONFIGURING I/RequestThread-1( 1783): Configure outputs: 2 surfaces configured. D/Camera ( 1783): stopPreview D/Camera ( 1783): app passed NULL surface E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so I/CameraDeviceState( 1783): Legacy camera service transitioning to state IDLE V/Camera ( 1783): open successful I/RequestQueue( 1783): Repeating capture request set. I/SrsFlvMuxer( 1783): worker: connecting to RTMP server by url=rtmp://fra-origin.livepeer.live/[my url] D/RtmpConnection( 1783): connect() called. Host: fra-origin.livepeer.live, port: 1935, appName: n6f1-bqx5-1d6j, publishPath: [...my path] I/System ( 1783): core_booster, getBoosterConfig = false W/LegacyRequestMapper( 1783): convertRequestMetadata - control.awbRegions setting is not supported, ignoring value W/LegacyRequestMapper( 1783): Only received metering rectangles with weight 0. W/LegacyRequestMapper( 1783): convertRequestToMetadata - Ignoring android.lens.focusDistance false, only 0.0f is supported I/System.out( 1783): [socket][3] connection fra-origin.livepeer.live/195.181.174.250:1935;LocalPort=60780(5000) I/System.out( 1783): [CDS]connect[fra-origin.livepeer.live/ 195.181.174.250:1935] tm:5 I/System.out( 1783): [socket][/192.168.0.101:60780] connected D/RtmpConnection( 1783): connect(): socket connection established, doing handhake... D/Handshake( 1783): writeC0 D/Handshake( 1783): writeC1 D/Handshake( 1783): writeC1(): Calculating digest offset D/Handshake( 1783): writeC1(): (real value of) digestOffset: 504 D/Handshake( 1783): writeC1(): recalculated digestOffset: 1280 D/Handshake( 1783): writeC1(): digestOffsetBytes: 0000F9FF D/Handshake( 1783): partBeforeDigest(): size: 1280 D/Handshake( 1783): writeC1(): Writing timestamp and Flash Player version D/Handshake( 1783): partAfterDigest(): size: 224 D/Handshake( 1783): copying digest offset bytes in partBeforeDigest D/Handshake( 1783): writeC1(): Calculating digest D/Handshake( 1783): writeC1(): writing C1 packet D/Handshake( 1783): readS0 D/Handshake( 1783): readS1 D/Handshake( 1783): readS1(): S1 total bytes read OK D/Handshake( 1783): writeC2 D/Handshake( 1783): readS2 D/Handshake( 1783): readS2(): S2 total bytes read OK D/RtmpConnection( 1783): connect(): handshake done D/RtmpConnection( 1783): rtmpConnect(): Building 'connect' invoke packet D/RtmpConnection( 1783): wrote packet: RTMP Command (command: connect, transaction ID: 1), size: 298 D/RtmpConnection( 1783): starting main rx handler loop I/RtmpConnection( 1783): handleRxInvoke: Got result for invoked method: connect D/RtmpConnection( 1783): createStream(): Sending releaseStream command... D/RtmpConnection( 1783): wrote packet: RTMP Command (command: releaseStream, transaction ID: 2), size: 39 D/RtmpConnection( 1783): createStream(): Sending FCPublish command... D/RtmpConnection( 1783): wrote packet: RTMP Command (command: FCPublish, transaction ID: 3), size: 35 D/RtmpConnection( 1783): createStream(): Sending createStream command... D/RtmpConnection( 1783): wrote packet: RTMP Command (command: createStream, transaction ID: 4), size: 25 D/RtmpDecoder( 1783): readPacket(): Setting chunk size to: 65536 D/RtmpConnection( 1783): handleRxPacketLoop(): Setting acknowledgement window size: 2500000 D/RtmpConnection( 1783): handleRxPacketLoop(): Send acknowledgement window size: 524288 D/RtmpConnection( 1783): wrote packet: RTMP Window Acknowledgment Size, size: 4 I/System.out( 1783): [CDS]SO_SNDBUF:524288 D/RtmpConnection( 1783): handleRxInvoke(): 'onFCPublish' I/RtmpConnection( 1783): handleRxInvoke: Got result for invoked method: createStream D/RtmpConnection( 1783): handleRxInvoke(): Stream ID to publish: 1 D/RtmpConnection( 1783): fmlePublish(): Sending publish command... D/RtmpConnection( 1783): wrote packet: RTMP Command (command: publish, transaction ID: 0), size: 40 W/RtmpConnection( 1783): handleRxPacketLoop(): Not handling unimplemented/unknown packet of type: ACKNOWLEDGEMENT E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so I/CameraDeviceState( 1783): Legacy camera service transitioning to state CAPTURING E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so E/HAL ( 1783): hw_get_module_by_class: lib loaded: /system/lib/hw/ gralloc.msm8909.so I/RtmpConnection( 1783): handleRxPacketLoop(): Stream EOF reached, closing RTMP writer... D/RtmpConnection( 1783): handleRxInvoke(): onStatus NetStream.Play.Stop D/RtmpConnection( 1783): handleRxInvoke(): onStatus NetStream.Play.UnpublishNotify W/CameraCaptureSession( 1783): Session 1: The camera device was already closed: W/CameraCaptureSession( 1783): java.lang.IllegalStateException: CameraDevice was already closed W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInError(CameraDeviceImpl.java:1482) W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDeviceImpl.java:677) W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:328) W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraCaptureSessionImpl.finalize(CameraCaptureSessionImpl.java:561) W/CameraCaptureSession( 1783): at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:191) W/CameraCaptureSession( 1783): at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:174) W/CameraCaptureSession( 1783): at java.lang.Thread.run(Thread.java:831) W/CameraCaptureSession( 1783): Session 1: The camera device was already closed: W/CameraCaptureSession( 1783): java.lang.IllegalStateException: CameraDevice was already closed W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInError(CameraDeviceImpl.java:1482) W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDeviceImpl.java:677) W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:328) W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraCaptureSessionImpl.finalize(CameraCaptureSessionImpl.java:561) W/CameraCaptureSession( 1783): at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:191) W/CameraCaptureSession( 1783): at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:174) W/CameraCaptureSession( 1783): at java.lang.Thread.run(Thread.java:831) W/CameraCaptureSession( 1783): Session 1: The camera device was already closed: W/CameraCaptureSession( 1783): java.lang.IllegalStateException: CameraDevice was already closed W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInError(CameraDeviceImpl.java:1482) W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDeviceImpl.java:677) W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:328) W/CameraCaptureSession( 1783): at android.hardware.camera2.impl.CameraCaptureSessionImpl.finalize(CameraCaptureSessionImpl.java:561) W/CameraCaptureSession( 1783): at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:191) W/CameraCaptureSession( 1783): at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:174) W/CameraCaptureSession( 1783): at java.lang.Thread.run(Thread.java:831) I/System.out( 1783): [CDS]close[60780] I/System.out( 1783): close [socket][/0.0.0.0:60780] D/RtmpConnection( 1783): socket closed I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped W/Adreno-EGLSUB( 1783): DequeueBuffer:721: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0 V/ACodec ( 1783): Now uninitialized W/Adreno-EGL( 1783): : EGL_BAD_SURFACE I/Choreographer( 1783): Skipped 267 frames! The application may be doing too much work on its main thread. I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped W/ALooperRoster( 1783): failed to deliver message. Target handler 19 registered, but object gone. I/VideoEncoder( 1783): stopped I/AudioEncoder( 1783): stopped V/ACodec ( 1783): Now uninitialized W/Adreno-EGLSUB( 1783): DequeueBuffer:721: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0 W/Adreno-EGL( 1783): : EGL_BAD_SURFACE I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): SrsFlvMuxer closed I/MicrophoneManager( 1783): Microphone stopped I/AudioEncoder( 1783): stopped I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/SrsFlvMuxer( 1783): worker: disconnect ok. I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Failed retry} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/flutter ( 1783): Event {eventType: rtmp_stopped, errorDescription: Disconnected} I/art ( 1783): Background sticky concurrent mark sweep GC freed 366251(11MB) AllocSpace objects, 0(0B) LOS objects, 40% free, 11MB/19MB, paused 812us total 104.943ms at GCDaemon thread CareAboutPauseTimes 1 E/BufferQueueProducer( 1783): [unnamed-1783-18] dequeueBuffer: BufferQueue has been abandoned W/Adreno-EGLSUB( 1783): DequeueBuffer:721: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0 W/Adreno-EGL( 1783): : EGL_BAD_SURFACE E/CameraDeviceGLThread-1( 1783): Received exception on GL render thread: E/CameraDeviceGLThread-1( 1783): java.lang.IllegalStateException: swapBuffers: EGL error: 0x300d E/CameraDeviceGLThread-1( 1783): at android.hardware.camera2.legacy.SurfaceTextureRenderer.checkEglError(SurfaceTextureRenderer.java:530) E/CameraDeviceGLThread-1( 1783): at android.hardware.camera2.legacy.SurfaceTextureRenderer.swapBuffers(SurfaceTextureRenderer.java:523) E/CameraDeviceGLThread-1( 1783): at android.hardware.camera2.legacy.SurfaceTextureRenderer.drawIntoSurfaces(SurfaceTextureRenderer.java:729) E/CameraDeviceGLThread-1( 1783): at android.hardware.camera2.legacy.GLThreadManager$1.handleMessage(GLThreadManager.java:105) E/CameraDeviceGLThread-1( 1783): at android.os.Handler.dispatchMessage(Handler.java:98) E/CameraDeviceGLThread-1( 1783): at android.os.Looper.loop(Looper.java:135) E/CameraDeviceGLThread-1( 1783): at android.os.HandlerThread.run(HandlerThread.java:61) I/CameraDeviceState( 1783): Legacy camera service transitioning to state ERROR V/Camera ( 1783): onError(1) V/Camera ( 1783): Close recoordingCaptureSession W/RtmpCamera( 1783): Error from camera W/RtmpCamera( 1783): android.hardware.camera2.CameraAccessException: The camera device has encountered a serious error W/RtmpCamera( 1783): at android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInError(CameraDeviceImpl.java:1478) W/RtmpCamera( 1783): at android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDeviceImpl.java:677) W/RtmpCamera( 1783): at android.hardware.camera2.impl.CameraCaptureSessionImpl.stopRepeating(CameraCaptureSessionImpl.java:239) W/RtmpCamera( 1783): at com.whelksoft.camera_with_rtmp.Camera.closeCaptureSession(Camera.kt:485) W/RtmpCamera( 1783): at com.whelksoft.camera_with_rtmp.Camera.close(Camera.kt:498) W/RtmpCamera( 1783): at com.whelksoft.camera_with_rtmp.Camera$open$1.onError(Camera.kt:149) W/RtmpCamera( 1783): at android.hardware.camera2.impl.CameraDeviceImpl$CameraDeviceCallbacks$1.run(CameraDeviceImpl.java:1207) W/RtmpCamera( 1783): at android.os.Handler.handleCallback(Handler.java:739) W/RtmpCamera( 1783): at android.os.Handler.dispatchMessage(Handler.java:95) W/RtmpCamera( 1783): at android.os.Looper.loop(Looper.java:135) W/RtmpCamera( 1783): at android.app.ActivityThread.main(ActivityThread.java:5593) W/RtmpCamera( 1783): at java.lang.reflect.Method.invoke(Native Method) W/RtmpCamera( 1783): at java.lang.reflect.Method.invoke(Method.java:372) W/RtmpCamera( 1783): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960) W/RtmpCamera( 1783): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) E/RequestThread-1( 1783): Timed out while waiting for request to complete. W/CaptureCollector( 1783): Preview buffers dropped for request: 1 E/CameraDeviceState( 1783): Cannot receive result while in state: 0 E/CameraDeviceState( 1783): Cannot receive result while in state: 0 E/CameraDeviceState( 1783): Cannot receive result while in state: 0 E/BufferQueueProducer( 1783): [unnamed-1783-19] cancelBuffer: BufferQueue has been abandoned E/BufferQueueProducer( 1783): [unnamed-1783-19] cancelBuffer: BufferQueue has been abandoned E/BufferQueueProducer( 1783): [unnamed-1783-19] cancelBuffer: BufferQueue has been abandoned E/BufferQueueProducer( 1783): [unnamed-1783-19] cancelBuffer: BufferQueue has been abandoned E/BufferQueueProducer( 1783): [unnamed-1783-19] cancelBuffer: BufferQueue has been abandoned E/BufferQueueProducer( 1783): [unnamed-1783-19] cancelBuffer: BufferQueue has been abandoned E/BufferQueueProducer( 1783): [unnamed-1783-19] cancelBuffer: BufferQueue has been abandoned E/BufferQueueProducer( 1783): [unnamed-1783-19] cancelBuffer: BufferQueue has been abandoned E/BufferQueueProducer( 1783): [unnamed-1783-19] cancelBuffer: BufferQueue has been abandoned E/BufferQueueProducer( 1783): [unnamed-1783-19] cancelBuffer: BufferQueue has been abandoned I/Choreographer( 1783): Skipped 243 frames! The application may be doing too much work on its main thread. I/flutter ( 1783): Event {eventType: error, errorDescription: The camera device is in use already.} I/flutter ( 1783): Event {eventType: camera_closing}

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pinkfish/flutter_rtmppublisher/issues/26, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATOMMNWV4ZVGSCJGE3RXYDR6JTEPANCNFSM4PPTIOWQ .

IBurychka commented 3 years ago

Hello. Yes. It should reopen the connection and not close

ericxtang commented 3 years ago

@pinkfish another problem - which is why I think this issue is filed in the first place, is that the RTMP connection is closed unexpectedly after about 30 seconds of streaming into our custom RTMP ingest point. It looks like some kind of timeout behavior.

Is it possible that the SDK or the application is waiting for a non-standard signal from the media server that's not being sent, which eventually causes a timeout?

IBurychka commented 3 years ago

@pinkfish , we tested streaming fo iOS and Android. For iOS - it's work, for Android - doesn't work.

itsatifsiddiqui commented 3 years ago

@IBurychka we're you able to find the solution? For me, it's working on ios and not android.