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

livestreming from android isn't stoping even after calling stopVideoStreaming #12

Closed AnandASanthosh closed 4 years ago

Nijinsha commented 4 years ago

Same issue.

pinkfish commented 4 years ago

Just fixed this. Update to the newest version.

AnandASanthosh commented 4 years ago

now when stream starting it shows failed to configure camera session (i am using your code from example)

AnandASanthosh commented 4 years ago

V/Camera (27988): createCaptureSession W/CameraDevice-JV-0(27988): Stream configuration failed due to: endConfigure:503: Camera 0: Unsupported set of inputs/outputs provided E/CameraCaptureSession(27988): Session 1: Failed to create capture session; configuration failed I/flutter (27988): Event {errorDescription: Failed to configure camera session., eventType: error}

pinkfish commented 4 years ago

Latest version failed to upload apparently. Uploaded now.

AnandASanthosh commented 4 years ago

still it shows a snackbar with text failed to configure camera session

Nijinsha commented 4 years ago

Experiencing some issue with camera configuration

pinkfish commented 4 years ago

Which version of the android api are you running with?

On Sun, 31 May 2020 at 22:58, Nijinsha Rahman notifications@github.com wrote:

Experiencing some issue with camera configuration

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pinkfish/flutter_rtmppublisher/issues/12#issuecomment-636629102, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATOMMIHPLBGCJBHT5OLZS3RUM7PZANCNFSM4NPIP7ZQ .

AnandASanthosh commented 4 years ago

minSdkVersion 21 compileSdkVersion 28

device using android 10(not emulator)

I/Stuff (17492): {bitrate=1228800, textureId=1, enableAndroidOpenGL=false, url=rtmp://global-live.mux.com:5222/app/20d58dbc-45f0-4ec7-6014-6a2a1860de35} W/xample.pingpong(17492): type=1400 audit(0.0:6015236): avc: granted { search } for name="/" dev="mmcblk0p66" ino=2 scontext=u:r:untrusted_app_27:s0:c216,c256,c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir I/MicrophoneManager(17492): Microphone created, 32000hz, Stereo W/xample.pingpong(17492): type=1400 audit(0.0:6015237): avc: granted { search } for name="/" dev="mmcblk0p66" ino=2 scontext=u:r:untrusted_app_27:s0:c216,c256,c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir D/CCodec (17492): allocate(c2.android.aac.encoder) I/CCodec (17492): Created component [c2.android.aac.encoder] D/CCodecConfig(17492): read media type: audio/mp4a-latm D/ReflectedParamUpdater(17492): extent() != 1 for single value type: algo.buffers.max-count.values D/ReflectedParamUpdater(17492): extent() != 1 for single value type: output.subscribed-indices.values D/ReflectedParamUpdater(17492): extent() != 1 for single value type: input.buffers.allocator-ids.values D/ReflectedParamUpdater(17492): extent() != 1 for single value type: output.buffers.allocator-ids.values D/ReflectedParamUpdater(17492): extent() != 1 for single value type: algo.buffers.allocator-ids.values D/ReflectedParamUpdater(17492): extent() != 1 for single value type: output.buffers.pool-ids.values D/ReflectedParamUpdater(17492): extent() != 1 for single value type: algo.buffers.pool-ids.values I/CCodecConfig(17492): query failed after returning 9 values (BAD_INDEX) D/CCodecConfig(17492): c2 config diff is Dict { D/CCodecConfig(17492): c2::u32 coded.bitrate.value = 64000 D/CCodecConfig(17492): c2::u32 coded.pl.level = 0 D/CCodecConfig(17492): c2::u32 coded.pl.profile = 8192 D/CCodecConfig(17492): c2::u32 coding.aac-sbr-mode.value = 3 D/CCodecConfig(17492): c2::u32 input.buffers.max-size.value = 2048 D/CCodecConfig(17492): c2::u32 input.delay.value = 0 D/CCodecConfig(17492): string input.media-type.value = "audio/raw" /CCodecConfig(17492): string output.media-type.value = "audio/mp4a-latm" D/CCodecConfig(17492): c2::u32 raw.channel-count.value = 1 D/CCodecConfig(17492): c2::u32 raw.sample-rate.value = 44100 D/CCodecConfig(17492): } D/CCodecConfig(17492): no c2 equivalents for aac-profile D/CCodecConfig(17492): no c2 equivalents for encoder D/CCodecConfig(17492): c2 config diff is c2::u32 coded.bitrate.value = 65536 D/CCodecConfig(17492): c2::u32 input.buffers.max-size.value = 4096 D/CCodecConfig(17492): c2::u32 raw.channel-count.value = 2 D/CCodecConfig(17492): c2::u32 raw.sample-rate.value = 32000 W/Codec2Client(17492): query -- param skipped: index = 1107298332. D/CCodec (17492): setup formats input: AMessage(what = 0x00000000) = { D/CCodec (17492): int32_t channel-count = 2 D/CCodec (17492): int32_t max-input-size = 4096 D/CCodec (17492): string mime = "audio/raw" D/CCodec (17492): int32_t sample-rate = 32000 D/CCodec (17492): } and output: AMessage(what = 0x00000000) = { D/CCodec (17492): int32_t bitrate = 65536 D/CCodec (17492): int32_t channel-count = 2 D/CCodec (17492): int32_t level = 0 D/CCodec (17492): int32_t max-bitrate = 65536 D/CCodec (17492): string mime = "audio/mp4a-latm" D/CCodec (17492): int32_t profile = 2 D/CCodec (17492): int32_t sample-rate = 32000 D/CCodec (17492): } I/AudioEncoder(17492): prepared I/WSVideoEncoder(17492): VideoEncoder OMX.qcom.video.encoder.avc I/WSVideoEncoder(17492): Color supported: 2141391876 I/WSVideoEncoder(17492): Color supported: 2130708361 W/xample.pingpong(17492): type=1400 audit(0.0:6015238): avc: granted { search } for name="/" dev="mmcblk0p66" ino=2 scontext=u:r:untrusted_app_27:s0:c216,c256,c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir I/OMXClient(17492): IOmx service obtained I/WSVideoEncoder(17492): Prepare video info: SURFACE, 480x720 W/OMXUtils(17492): do not know color format 0x7fa30c04 = 2141391876 W/OMXUtils(17492): do not know color format 0x7f000789 = 2130708361 I/ACodec (17492): setupAVCEncoderParameters with [profile: Baseline] [level: Level3] I/ACodec (17492): [OMX.qcom.video.encoder.avc] cannot encode HDR static metadata. Ignoring. I/ACodec (17492): setupVideoEncoder succeeded W/OMXUtils(17492): do not know color format 0x7f000789 = 2130708361 I/WSVideoEncoder(17492): prepared V/Camera (17492): Close recoordingCaptureSession V/Camera (17492): createCaptureSession W/CameraDevice-JV-0(17492): Stream configuration failed due to: endConfigure:503: Camera 0: Unsupported set of inputs/outputs provided E/CameraCaptureSession(17492): Session 3: Failed to create capture session; configuration failed W/Binder:17492_3(17492): type=1400 audit(0.0:6015240): avc: granted { search } for name="/" dev="mmcblk0p66" ino=2 scontext=u:r:untrusted_app_27:s0:c216,c256,c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir I/flutter (17492): Event {errorDescription: Failed to configure camera session., eventType: error}

adminant commented 4 years ago

Same issue after upgrading from 0.1.9 to 0.2.1 version of plugin. Start video streaming leads to error:

E/CameraDevice-0-LE(29360): submitRequestList - cannot use a surface that wasn't configured I/flutter (29360): Event {eventType: error, errorDescription: CAMERA_ERROR (3): submitRequestList - cannot use a surface that wasn't configured}

Nothing changed in app, only plugin version to 0.2.1. build.gradle settings: minSdkVersion 21 targetSdkVersion 28

Nijinsha commented 4 years ago

Any update on this?

adminant commented 4 years ago

Updated to 0.2.2, but still the same error(

AnandASanthosh commented 4 years ago

Any update

adminant commented 4 years ago

I managed to discover that Android virtual Pixel 2 API 28 device works nice on 0.2.2 (except that video is still rotated 90 degree). May be it could help somehow to isolate the problem.

adminant commented 4 years ago

Further experiments showed that "androidUseOpenGL" parameter helps to get rid of error. Use it like this in example's startVideoStreaming function:

await controller.startVideoStreaming(url, bitrate: 1200 * 1024, androidUseOpenGL: true); instead of await controller.startVideoStreaming(url);