Git Product home page Git Product logo

flutter_rtmppublisher's People

Contributors

aryana101a avatar eittipat avatar ollyde avatar pinkfish avatar reiji012 avatar topilski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

flutter_rtmppublisher's Issues

Android: Camera freezes on launch.

We're getting so close!

On Android, the camera freezes on the first frame.

Current error logs.

The relevant error-causing widget was
    CameraStreamView 
lib/…/screens_requestival_streaming/live_stream_body.dart:99
When the exception was thrown, this was the stack
#0      Object.noSuchMethod  (dart:core-patch/object_patch.dart:53:5)
#1      _CameraStreamViewState._body 
package:Requestival/…/screens_requestival_streaming/camera_stream_view.dart:94
#2      _CameraStreamViewState.build 
package:Requestival/…/screens_requestival_streaming/camera_stream_view.dart:49
#3      StatefulElement.build 
package:flutter/…/widgets/framework.dart:4619
#4      ComponentElement.performRebuild 
package:flutter/…/widgets/framework.dart:4502
...
════════════════════════════════════════════════════════════════════════════════
E/BufferQueueConsumer(10761): disconnect by : com.polydelic.myapp my_pid = 10761
E/BufferQueueConsumer(10761): disconnect by : com.polydelic.myapp my_pid = 10761
I/MicrophoneManager(10761): Microphone stopped
I/VideoEncoder(10761): stopped
I/AudioEncoder(10761): stopped
E/SensorManager(10761): registerListenerImpl sensorName:lsm6ds3c Accelerometer Non-wakeup,isWakeUpSensor:false,callingApp: com.polydelic.myapp,callingPid:10761,callingUid:10016
E/libc    (10761): Access denied finding property "persist.vendor.camera.privapp.list"
W/elic.myapp(10761): type=1400 audit(0.0:803): avc: denied { read } for name="u:object_r:persist_camera_prop:s0" dev="tmpfs" ino=22857 scontext=u:r:untrusted_app_27:s0:c16,c256,c512,c768 tcontext=u:object_r:persist_camera_prop:s0 tclass=file permissive=0

I/Stuff   (10761): {textureId=3, url=rtmps://global-live.mux.com:443/app/00463915-10fe-08b0-3138-f71608eb7d57}
I/MicrophoneManager(10761): Microphone created, 32000hz, Stereo
D/MediaCodec(10761):  name = c2.android.aac.encoder
D/CCodec  (10761): allocate(c2.android.aac.encoder)
I/CCodec  (10761): Created component [c2.android.aac.encoder]
D/CCodecConfig(10761): read media type: audio/mp4a-latm
D/ReflectedParamUpdater(10761): extent() != 1 for single value type: algo.buffers.max-count.values
D/ReflectedParamUpdater(10761): extent() != 1 for single value type: output.subscribed-indices.values
D/ReflectedParamUpdater(10761): extent() != 1 for single value type: input.buffers.allocator-ids.values
D/ReflectedParamUpdater(10761): extent() != 1 for single value type: output.buffers.allocator-ids.values
D/ReflectedParamUpdater(10761): extent() != 1 for single value type: algo.buffers.allocator-ids.values
D/ReflectedParamUpdater(10761): extent() != 1 for single value type: output.buffers.pool-ids.values
D/ReflectedParamUpdater(10761): extent() != 1 for single value type: algo.buffers.pool-ids.values
I/CCodecConfig(10761): query failed after returning 9 values (BAD_INDEX)
D/CCodecConfig(10761): c2 config is Dict {
D/CCodecConfig(10761):   c2::u32 coded.bitrate.value = 64000
D/CCodecConfig(10761):   c2::u32 coded.pl.level = 0
D/CCodecConfig(10761):   c2::u32 coded.pl.profile = 8192
D/CCodecConfig(10761):   c2::u32 coding.aac-sbr-mode.value = 3
D/CCodecConfig(10761):   c2::u32 input.buffers.max-size.value = 2048
D/CCodecConfig(10761):   c2::u32 input.delay.value = 0
D/CCodecConfig(10761):   string input.media-type.value = "audio/raw"
D/CCodecConfig(10761):   string output.media-type.value = "audio/mp4a-latm"
D/CCodecConfig(10761):   c2::u32 raw.channel-count.value = 1
D/CCodecConfig(10761):   c2::u32 raw.sample-rate.value = 44100
D/CCodecConfig(10761): }

W/MediaCodec(10761): RETYR:0
D/CCodecConfig(10761): no c2 equivalents for aac-profile
D/CCodecConfig(10761): no c2 equivalents for encoder
D/CCodecConfig(10761): c2 config is Dict {
D/CCodecConfig(10761):   c2::u32 coded.bitrate.value = 65536
D/CCodecConfig(10761):   c2::u32 coded.pl.level = 0
D/CCodecConfig(10761):   c2::u32 coded.pl.profile = 8192
D/CCodecConfig(10761):   c2::u32 coding.aac-sbr-mode.value = 3
D/CCodecConfig(10761):   c2::u32 input.buffers.max-size.value = 4096
D/CCodecConfig(10761):   c2::u32 input.delay.value = 0
D/CCodecConfig(10761):   string input.media-type.value = "audio/raw"
D/CCodecConfig(10761):   string output.media-type.value = "audio/mp4a-latm"
D/CCodecConfig(10761):   c2::u32 raw.channel-count.value = 2
D/CCodecConfig(10761):   c2::u32 raw.sample-rate.value = 32000
D/CCodecConfig(10761): }
W/Codec2Client(10761): query -- param skipped: index = 1107298332.
D/CCodec  (10761): setup formats input: AMessage(what = 0x00000000) = {
D/CCodec  (10761):   int32_t channel-count = 2
D/CCodec  (10761):   int32_t max-input-size = 4096
D/CCodec  (10761):   string mime = "audio/raw"
D/CCodec  (10761):   int32_t sample-rate = 32000
D/CCodec  (10761): } and output: AMessage(what = 0x00000000) = {
D/CCodec  (10761):   int32_t bitrate = 65536
D/CCodec  (10761):   int32_t channel-count = 2
D/CCodec  (10761):   int32_t level = 0
D/CCodec  (10761):   int32_t max-bitrate = 65536
D/CCodec  (10761):   string mime = "audio/mp4a-latm"
D/CCodec  (10761):   int32_t profile = 2
D/CCodec  (10761):   int32_t sample-rate = 32000
D/CCodec  (10761): }

I/AudioEncoder(10761): prepared
I/VideoEncoder(10761): VideoEncoder OMX.qcom.video.encoder.avc
I/VideoEncoder(10761): Color supported: 2141391878
I/VideoEncoder(10761): Color supported: 2141391876
I/VideoEncoder(10761): Color supported: 2141391872
I/VideoEncoder(10761): Color supported: 2141391881
I/VideoEncoder(10761): Color supported: 2141391882
I/VideoEncoder(10761): Color supported: 2141391880
I/VideoEncoder(10761): Color supported: 2141391879
I/VideoEncoder(10761): Color supported: 2130708361
D/MediaCodec(10761):  name = OMX.qcom.video.encoder.avc
I/OMXClient(10761): IOmx service obtained
I/VideoEncoder(10761): Prepare video info: SURFACE, 480x720
W/MediaCodec(10761): RETYR:0
I/ExtendedACodec(10761): setupVideoEncoder()
W/OMXUtils(10761): do not know color format 0x7fa30c06 = 2141391878
W/OMXUtils(10761): do not know color format 0x7fa30c04 = 2141391876
W/OMXUtils(10761): do not know color format 0x7fa30c00 = 2141391872
W/OMXUtils(10761): do not know color format 0x7fa30c09 = 2141391881
W/OMXUtils(10761): do not know color format 0x7fa30c0a = 2141391882
W/OMXUtils(10761): do not know color format 0x7fa30c08 = 2141391880
W/OMXUtils(10761): do not know color format 0x7fa30c07 = 2141391879
W/OMXUtils(10761): do not know color format 0x7f000789 = 2130708361
I/ACodec  (10761): setupAVCEncoderParameters: Open /proc/10761/comm succeed
I/ACodec  (10761): setupAVCEncoderParameters: Get package name: elic.myapp
I/ACodec  (10761): setupAVCEncoderParameters with [profile: High] [level: Level1]
I/ACodec  (10761): setupAVCEncoderParameters: AVC codec setting: 480 x 720 bitrate: 1228800, P-frame: 59, B-frame: 0, fps: 30.000000
I/ACodec  (10761): [OMX.qcom.video.encoder.avc] cannot encode HDR static metadata. Ignoring.
I/ACodec  (10761): setupVideoEncoder succeeded
I/ExtendedACodec(10761): [OMX.qcom.video.encoder.avc] configure, AMessage : AMessage(what = 'conf', target = 23) = {
I/ExtendedACodec(10761):   int32_t color-format = 2130708361
I/ExtendedACodec(10761):   int32_t i-frame-interval = 2
I/ExtendedACodec(10761):   string mime = "video/avc"
I/ExtendedACodec(10761):   int32_t width = 480
I/ExtendedACodec(10761):   int32_t bitrate = 1228800
I/ExtendedACodec(10761):   int32_t max-input-size = 0
I/ExtendedACodec(10761):   int32_t frame-rate = 30
I/ExtendedACodec(10761):   int32_t height = 720
I/ExtendedACodec(10761):   int32_t encoder = 1
I/ExtendedACodec(10761): }
W/OMXUtils(10761): do not know color format 0x7f000789 = 2130708361
I/VideoEncoder(10761): prepared
W/CameraDevice-JV-1(10761): Stream configuration failed due to: endConfigure:508: Camera 1: Unsupported set of inputs/outputs provided
E/CameraCaptureSession(10761): Session 1: Failed to create capture session; configuration failed
D/OnePlusJankManager(10761):  Chor uploadMDM JANK_TYPE_ONCE mViewTitle = com.polydelic.myapp/com.polydelic.myapp.MainActivity--- jank level = 1

I/flutter (10761): Event {errorDescription: Failed to configure camera session., eventType: error}
E/flutter (10761): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method stopVideoStreaming on channel plugins.flutter.io/camera_with_rtmp)



Build Issue when using a component but working when running it from source

I am getting the below issue when I use the camera_with_rtmp as a component. However when I run the example given in the github folder, it seems to be working without issue. I'd appreciate some help. This working yesterday and suddenly it stopped working.

Using hardware rendering with device Android SDK built for x86. If you notice graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
Launching lib\main.dart on Android SDK built for x86 in debug mode...
../../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/lib/camera.dart:81:49: Error: 'await' can only be used in 'async' or 'async*' methods.
final List<Map<dynamic, dynamic>> cameras = await _channel
^^^^^
../../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/lib/camera.dart:89:8: Error: A value of type 'List' can't be assigned to a variable of type 'Future<List>'.

  • 'List' is from 'dart:core'.
  • 'CameraDescription' is from 'package:camera_with_rtmp/camera.dart' ('../../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/lib/camera.dart').
  • 'Future' is from 'dart:async'.
    }).toList();
    ^

FAILURE: Build failed with an exception.

  • Where:

  • What went wrong:
    Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command 'C:\Projects\SDK\flutter\bin\flutter.bat'' finished with non-zero exit value 1

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 14s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 15.6s
Exception: Gradle task assembleDebug failed with exit code 1

example documentation

I am an experienced Flutter developer but new to streaming and interested in learning how to use this plugin for streaming video. Would it be possible to use the example app to stream video directly to my Windows computer with Media Player, or to another mobile using VLC for Android, or something like that? I. e. without having to set up a media server or learning Wowza for example. Simple step by step instructions for running the example app like that would be much appreciated! (If it is possible.)

Build errors on Android

While trying to build for Android I get the following errors.

I think you are building this plugin with a really old version of Flutter.
I think you need to upgrade your version of Flutter/Xcode/Android. (developer of this library)

flutter_rtmppublisher/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/CameraPermissions.kt: (7, 17): Unresolved reference: core
flutter_rtmppublisher/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/CameraPermissions.kt: (8, 17): Unresolved reference: core
flutter_rtmppublisher/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/CameraPermissions.kt: (37, 13): Unresolved reference: ActivityCompat
flutter_rtmppublisher/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/CameraPermissions.kt: (48, 17): Unresolved reference: ContextCompat
flutter_rtmppublisher/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/CameraPermissions.kt: (53, 17): Unresolved reference: ContextCompat

Android front facing camera streams upside down in at least some cases

Hi,

I've successfully implemented this library into a test project. First of all, thanks for making this!

Broadcasting works fine, except there is an issue with the front facing camera, at least on the Android devices I am able to test on. The preview in the app looks correct, however the resulting stream has the front facing camera upside down. I did some digging and found that the issue doesn't stem from your library, but rather Android itself, however I thought it might be worth letting you know to see if we can brainstorm a fix.

Affected devices: Pixel 3a, Pixel 2XL (potentially more?)

The problem derives from an issue in the CameraManager class, part of Android's camera2 API, which this library uses. The CameraCharacteristics you get thinks the orientation of the front facing camera is 180 degrees off of the rear facing camera for some reason. I was able to log it here:

2020-06-29 21:50:24.707 29763-29763/com.example.rtmptest D/===RTMP Test===: name: 0; lens direction: back; orientation: 90
2020-06-29 21:50:24.710 29763-29763/com.example.rtmptest D/===RTMP Test===: name: 1; lens direction: front; orientation: 270

The method you can use to see this is this:

CameraCharacteristics characteristics = manager.getCameraCharacteristics(camera);
int sensorOrientationDegrees = characteristics.get(CameraCharacteristics.SENSOR_ORIENTATION);

Where sensorOrientationDegrees refers to 0, 90, 180, or 270. As you can see in the log above, the front facing camera is inverted (270) compared to the rear (90). What's interesting is that this only happens in portrait mode, in landscape, it works fine:

2020-06-29 21:50:22.152 29763-29763/fitness.classmate.rtmptest D/===RTMP Test===: name: 0; lens direction: back; orientation: 180
2020-06-29 21:50:22.154 29763-29763/fitness.classmate.rtmptest D/===RTMP Test===: name: 1; lens direction: front; orientation: 180

I've dug around for solutions to this but haven't had any luck with what little I've found. The library you derived the Android solution from also faces this same problem, so it's not just you. Given that I can use Hangouts and other video apps on this device without being upside down, I know there is a solution, I just can't find it yet. I just wanted to create this issue here so that others might be able to see that they're not crazy if they run into this wall like I did, and hopefully spark a conversation that can lead to a solution.

Thanks!

Can not live stream with RTMP on Activity

Hi owner, this is an awesome plugin. I can work with IOS perfectly. But in Android, after I click startVideoStreaming, I check my server is not found image video so I guess it has the same problem as this issue: pedroSG94/RootEncoder#721. I notice you have an option androidUseOpenGL in function startVideoStreaming(), but it isn't used in native code

Camera not found

Hello ! I using the example from pub dev .
When I am running the debug app. It shows No camera found and nothing works.
I have tried two phones : One plus 6 and Redmi 8A dual
How to fix this.

Flutter fails to build after adding camera_with_rtmp dependency

After installing camera_with_rtmp: ^0.2.2 onto my project, I started to get the following error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > File 'com.android.builder.files.ZipCentralDirectory@123f8712' was deleted, but previous version not found in cache

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 9s
Exception: Gradle task assembleDebug failed with exit code 1

My Flutter version: 1.17.3
My Dart version: 2.8.4

show date time

I want to show the date-time on-screen during streaming as well, currently, we have this feature yet?

Streaming disconnecting when switching Camera

Hi,

I am exploring this for my streaming project. i am using Wowza cloud. Given example(in this repo) working perfectly. But when i switch the camera while streaming, the stream got disconnecting.

I am using the example which is given in this repo. Can someone help me here.

Note: I don't know whether it is bug or not.

Thank you.

camera_with_rtmp: android build failure due to type mismatch

I've been unable to run on an android device due to the following failure during the gradle build:

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':camera_with_rtmp:compileDebugKotlin'.

Compilation error. See log for more details

...\flutter.pub-cache\hosted\pub.dartlang.org\camera_with_rtmp-0.3.2\android\src\main\kotlin\com\whelksoft\camera_with_rtmp\Camera.kt: (682, 29): Type mismatch: inferred type is Int? but Int was expected
...\flutter.pub-cache\hosted\pub.dartlang.org\camera_with_rtmp-0.3.2\android\src\main\kotlin\com\whelksoft\camera_with_rtmp\Camera.kt: (682, 45): Type mismatch: inferred type is Int? but Int was expected
...\flutter.pub-cache\hosted\pub.dartlang.org\camera_with_rtmp-0.3.2\android\src\main\kotlin\com\whelksoft\camera_with_rtmp\CameraUtils.kt: (51, 44): Type mismatch: inferred type is Int? but TypeVariable(V) was expected
...\flutter.pub-cache\hosted\pub.dartlang.org\camera_with_rtmp-0.3.2\android\src\main\kotlin\com\whelksoft\camera_with_rtmp\VideoEncoder.kt: (427, 23): Type mismatch: inferred type is ByteBuffer? but ByteBuffer was expected

snippet from pubspec.yaml:

version: 1.0.0+1

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  google_maps_flutter: ^0.5.27+3
  flutter_material_pickers: ^1.8.0
  video_player: ^0.11.1+2
  camera_with_rtmp: ^0.3.2

build.gradle:

buildscript {
    ext.kotlin_version = '1.4.0'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.4'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

app\build.gradle:

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 29

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        applicationId "com.example.exampleapp"
        minSdkVersion 23
        targetSdkVersion 29
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    buildTypes {
        release {
            signingConfig signingConfigs.debug
        }
    }

    packagingOptions {
       exclude 'project.clj'
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}

apply plugin: 'com.google.gms.google-services'

flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 1.24.0-4.0.pre.107, on Microsoft Windows
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[√] Android Studio (version 4.1.0)
[√] IntelliJ IDEA Community Edition (version 2019.3)
[√] VS Code (version 1.47.3)
[√] Connected device (1 available)

• No issues found!

Video preview turns dark when video streaming starts.

I'm using the youtube live stream api for streaming live videos.
Whenever i start to the live stream, my video becomes dark.

It happens after i enable androidUseOpenGL property. Cannot disable because it leads to video freeze on stream start.

This is how my controller is initialized.
`void getCameraDescription() async{
var cameras = await availableCameras();
cameraDescription = cameras.length > 1 ? cameras[1] : cameras[0];

cameraController = CameraController(cameraDescription, ResolutionPreset.medium, enableAudio: true, androidUseOpenGL: true);

cameraController.initialize().then((value){
  if(!mounted)
    return;
  setState(() {

  });
});

}`

Live stream start code.
`Future startVideoStreaming() async{
if(cameraController == null){
return null;
}
if(!cameraController.value.isInitialized){
return null;
}
String myUrl = "rtmp://a.rtmp.youtube.com/live2/";

try{
  await cameraController.startVideoStreaming(myUrl);
}
catch(e){
  print(e);
  return null;
}

return myUrl;

}`

IOS Orientation

Hi!
I am running your demo app on a physical IPhone and am not able to get the RTMP stream to switch from portrait to landscape.
I really just need the stream to in landscape.

Not sure if this is a bug or intended.

Can not turn off audio

If audio mode is false.
fail log:
E/AndroidRuntime(18814): FATAL EXCEPTION: Thread-1373
E/AndroidRuntime(18814): Process: com.example.camera_with_rtmp_demo, PID: 18814
E/AndroidRuntime(18814): java.lang.NullPointerException: Attempt to invoke virtual method 'void android.media.MediaCodec.start()' on a null object reference
E/AndroidRuntime(18814): at com.pedro.encoder.BaseEncoder.initCodec(BaseEncoder.java:56)
E/AndroidRuntime(18814): at com.pedro.encoder.BaseEncoder.start(BaseEncoder.java:44)
E/AndroidRuntime(18814): at com.whelksoft.camera_with_rtmp.RtmpCameraConnector.startEncoders(RtmpCameraConnector.kt:243)
E/AndroidRuntime(18814): at com.whelksoft.camera_with_rtmp.RtmpCameraConnector.onConnectionSuccessRtmp(RtmpCameraConnector.kt:492)
E/AndroidRuntime(18814): at net.ossrs.rtmp.SrsFlvMuxer$2.run(SrsFlvMuxer.java:290)
E/AndroidRuntime(18814): at java.lang.Thread.run(Thread.java:818)

image stream instead of video stream with audio

is there any way to close video stream (or send picture) and only send audio data when make streaming. Because some apps like whatsapp, user can close camera and only make audio stream . I reviewed your source code but i cant figure out.

Attempting to record video crashes app (iOS)

Issue description

Attempting to record video crashes app on iOS. Android is unaffected

How to reproduce

Version Info

  • flutter_rtmppublisher : bec8781
  • Xcode: 11.5 (11E608c)
  • Flutter: Flutter 1.17.3 • channel stable
  • Device: iPhone 6s (12.3.1) AND iPhone Xs Max (13.3.1)

Steps

  1. Run example via Xcode
  2. Select either front or rear camera
  3. Ensure audio is enabled
  4. Press Icons.videocam
  5. App will crash w/ exception

Exception:

2020-06-15 11:39:40.013797-0700 Runner[17722:864140] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[AVAssetWriterInput appendSampleBuffer:] Media type of sample buffer must match receiver's media type ("soun")'
*** First throw call stack:
(0x229ca927c 0x228e839f8 0x22fc071a0 0x100e04770 0x100e03b48 0x22fc6f7cc 0x22fc6f478 0x22d18f34c 0x22d1ac8ec 0x10332cc74 0x10332fffc 0x103342610 0x103334a4c 0x1033358ec 0x103334a4c 0x1033358b4 0x10333f77c 0x2298c9114 0x2298cbcd4)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

On iOS example app crashes

I try to run example app, but it crashes on
await controller.startVideoStreaming(url);
No messages, app just disappears
iOS 12.4, camera and microphone privileges are given

Rtmp video stream player

Stream part is ok but Is there any way to show another rtmp stream in video player? It can be useful for video chat applications.

can we do image overlay?

I am trying to browser overlay, something like OBS but with ffmpeg i am getting very less frames. I can convert my html into image but can i merge it with the camera stream?

Example code on pub.dev - error after taking a photo

When I have been testing code I found one problem. After taking one photo I cannot take another or start a stream.

The error:
E/MethodChannel#plugins.flutter.io/camera_with_rtmp(10631): Failed to handle method call E/MethodChannel#plugins.flutter.io/camera_with_rtmp(10631): java.lang.IllegalStateException: Session has been closed; further changes are illegal. E/MethodChannel#plugins.flutter.io/camera_with_rtmp(10631): at android.hardware.camera2.impl.CameraCaptureSessionImpl.checkNotClosed(CameraCaptureSessionImpl.java:834) E/MethodChannel#plugins.flutter.io/camera_with_rtmp(10631): at android.hardware.camera2.impl.CameraCaptureSessionImpl.capture(CameraCaptureSessionImpl.java:164) E/MethodChannel#plugins.flutter.io/camera_with_rtmp(10631): at com.whelksoft.camera_with_rtmp.Camera.takePicture(Camera.kt:200) E/MethodChannel#plugins.flutter.io/camera_with_rtmp(10631): at com.whelksoft.camera_with_rtmp.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.kt:55) E/MethodChannel#plugins.flutter.io/camera_with_rtmp(10631): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233) E/MethodChannel#plugins.flutter.io/camera_with_rtmp(10631): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) E/MethodChannel#plugins.flutter.io/camera_with_rtmp(10631): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692) E/MethodChannel#plugins.flutter.io/camera_with_rtmp(10631): at android.os.MessageQueue.nativePollOnce(Native Method) E/MethodChannel#plugins.flutter.io/camera_with_rtmp(10631): at android.os.MessageQueue.next(MessageQueue.java:336) E/MethodChannel#plugins.flutter.io/camera_with_rtmp(10631): at android.os.Looper.loop(Looper.java:174) E/MethodChannel#plugins.flutter.io/camera_with_rtmp(10631): at android.app.ActivityThread.main(ActivityThread.java:7356) E/MethodChannel#plugins.flutter.io/camera_with_rtmp(10631): at java.lang.reflect.Method.invoke(Native Method) E/MethodChannel#plugins.flutter.io/camera_with_rtmp(10631): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) E/MethodChannel#plugins.flutter.io/camera_with_rtmp(10631): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) I/flutter (10631): Error: error I/flutter (10631): Error Message: Session has been closed; further changes are illegal.

Android needs a packagingOptions/exclude int he app.gradle file

Need to put this in the app.gradel file
packagingOptions {
exclude 'project.clj'
}

It comes from the dependency on the rtmp library being used, not sure how to get rid of it in the library. Tried a few things but it kept turning up, putting this in your android file itself fixes the problem.

Recover on network issues/problems

The system stops sending correctly and doesn't try and recover if the network stops working correctly or if the user resets up the system by doing a camera switch. Fix to make it work twice.

How to detect that RTMP url has valid or invalid?

I tried to put the wrong RTMP url and it's still record streaming, it's supposed to be a streaming error.
the code controller.startVideoStreaming(url) is not get catch although we put the wrong RTMP url.
How to detect that RTMP url has valid or invalid?
Thank you

When i try to use this plugin, it give me this

e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.2.3/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/Camera.kt: (33, 7): Redeclaration: Camera
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.2.3/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/DartMessenger.kt: (10, 7): Redeclaration: DartMessenger
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.2.3/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/MethodCallHandlerImpl.kt: (14, 16): Redeclaration: MethodCallHandlerImpl
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.2.3/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/RtmpCameraConnector.kt: (41, 7): Redeclaration: RtmpCameraConnector
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.2.3/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/VideoEncoder.kt: (33, 7): Redeclaration: VideoEncoder
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/Camera.kt: (33, 7): Redeclaration: Camera
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/Camera.kt: (77, 17): Cannot find a parameter with this name: isPortrait
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/Camera.kt: (311, 49): Unresolved reference: startRecord
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/Camera.kt: (315, 30): Unresolved reference: startRecord
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/Camera.kt: (336, 30): Unresolved reference: stopRecord
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/Camera.kt: (361, 30): Unresolved reference: stopRecord
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/Camera.kt: (399, 49): Unresolved reference: isRecording
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/Camera.kt: (404, 26): Unresolved reference: pauseRecord
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/Camera.kt: (413, 49): Unresolved reference: isRecording
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/Camera.kt: (418, 26): Unresolved reference: resumeRecord
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/Camera.kt: (571, 38): Unresolved reference: startRecord
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/Camera.kt: (674, 60): Unresolved reference: ROTATION_UPDATE
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/DartMessenger.kt: (10, 7): Redeclaration: DartMessenger
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/MethodCallHandlerImpl.kt: (14, 16): Redeclaration: MethodCallHandlerImpl
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/MethodCallHandlerImpl.kt: (75, 25): Type mismatch: inferred type is MethodChannel.Result but Boolean was expected
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/MethodCallHandlerImpl.kt: (75, 31): No value passed for parameter 'result'
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/MethodCallHandlerImpl.kt: (87, 25): Type mismatch: inferred type is MethodChannel.Result but Boolean was expected
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/MethodCallHandlerImpl.kt: (87, 31): No value passed for parameter 'result'
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/MethodCallHandlerImpl.kt: (99, 26): Unresolved reference: stopVideoRecording
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/MethodCallHandlerImpl.kt: (102, 26): Unresolved reference: stopVideoStreaming
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/MethodCallHandlerImpl.kt: (168, 17): Too many arguments for public constructor Camera(activity: Activity?, flutterTexture: TextureRegistry.SurfaceTextureEntry, dartMessenger: DartMessenger, cameraName: String, resolutionPreset: String?, streamingPreset: String?, enableAudio: Boolean) defined in com.whelksoft.camera_with_rtmp.Camera
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/RtmpCameraConnector.kt: (43, 7): Redeclaration: RtmpCameraConnector
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/RtmpCameraConnector.kt: (491, 29): Cannot access 'running': it is protected in 'VideoEncoder'
e: /home/kestrel/Documents/Code/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/VideoEncoder.kt: (28, 7): Redeclaration: VideoEncoder

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':camera_with_rtmp:compileDebugKotlin'.

Compilation error. See log for more details

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 32s

Closes the connection if EOF is received

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): <qeglDrvAPI_eglSwapBuffers:3706>: 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): <qeglDrvAPI_eglSwapBuffers:3706>: 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): <qeglDrvAPI_eglSwapBuffers:3706>: 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}

Flutter desktop support

Now that Flutter has desktop support in the dev channel, is there a plan to add desktop support to this package?

adding date-time into streaming

I want to add date-time into the video during streaming like this, I can add it as Text Widget over VideoPreview but sometimes the viewer they’re not using Mobile App there might be used the web to view the video stream of publishers, any solution help, please

Build errors

Hey, I love that you created this library, really wish I could pay you somehow cause you are saving my ass.

Anyhow; I have some build errors when trying to build this for iOS. Something to do with the POD Logboard, perhaps it just needs updating.

I think you need to upgrade your version of Flutter/Xcode/Android. (developer of this library)

/Users/olly/Projects/spotify_mobile/ios/Pods/Logboard/Sources/Logboard/SocketAppender.swift:149:66: error: 'default' has been renamed to
    'RunLoopMode.defaultRunLoopMode'
            inputStream.schedule(in: runloop!, forMode: RunLoop.Mode.default)
                                                                     ^~~~~~~
                                                                     RunLoopMode.defaultRunLoopMode
    Foundation.RunLoop.Mode:4:23: note: 'default' was introduced in Swift 4.2
        public static let `default`: RunLoopMode
                          ^
    /Users/olly/Projects/spotify_mobile/ios/Pods/Logboard/Sources/Logboard/SocketAppender.swift:153:67: error: 'default' has been renamed to
    'RunLoopMode.defaultRunLoopMode'
            outputStream.schedule(in: runloop!, forMode: RunLoop.Mode.default)
                                                                      ^~~~~~~
                                                                      RunLoopMode.defaultRunLoopMode
    Foundation.RunLoop.Mode:4:23: note: 'default' was introduced in Swift 4.2
        public static let `default`: RunLoopMode
                          ^
    /Users/olly/Projects/spotify_mobile/ios/Pods/Logboard/Sources/Logboard/SocketAppender.swift:174:67: error: 'default' has been renamed to
    'RunLoopMode.defaultRunLoopMode'
            inputStream?.remove(from: runloop!, forMode: RunLoop.Mode.default)
                                                                      ^~~~~~~
                                                                      RunLoopMode.defaultRunLoopMode
    Foundation.RunLoop.Mode:4:23: note: 'default' was introduced in Swift 4.2
        public static let `default`: RunLoopMode
                          ^
    /Users/olly/Projects/spotify_mobile/ios/Pods/Logboard/Sources/Logboard/SocketAppender.swift:178:68: error: 'default' has been renamed to
    'RunLoopMode.defaultRunLoopMode'
            outputStream?.remove(from: runloop!, forMode: RunLoop.Mode.default)
                                                                       ^~~~~~~
                                                                       RunLoopMode.defaultRunLoopMode
    Foundation.RunLoop.Mode:4:23: note: 'default' was introduced in Swift 4.2
        public static let `default`: RunLoopMode

INSTALL_FAILED_DEXOPT on 21 SDK

When running new project with you package on 28 SDK- all fine, but have some problems on 21 SDK(Android 5).
All recommendations written in the "getting started" section have been implemented.

Launching lib\main.dart on ASUS Z00AD in debug mode...
Running Gradle task 'assembleDebug'...
✓ Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app.apk...
Package install error: Failure [INSTALL_FAILED_DEXOPT]
Error launching application on ASUS Z00AD.

If i remove "camera_with_rtmp" from pubsec - all fine.
Tried all answers from stackoverflow, but without result.

android kotlin `Expected type mismatch: inferred type is Int? but Int was expected` error

PLEASE HELP

Hi, Is there any got this error??
only have this error when I run the apps on the android.
no issue for ios.

Flutter Doctor

[✓] Flutter (Channel unknown, 1.24.0-10.2.pre, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.53.2)
[✓] Connected device (1 available)
// Java Version
openjdk version "1.8.0_242-release"
OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
OpenJDK 64-Bit Server VM (build 25.242-b3-6915495, mixed mode)

// Flutter Version
Flutter 1.24.0-10.2.pre • channel unknown • unknown source
Framework • revision 022b333a08 (4 months ago) • 2020-11-18 11:35:09 -0800
Engine • revision 07c1eed46b
Tools • Dart 2.12.0 (build 2.12.0-29.10.beta)

Error Message

e: /home/XXXXXXXXXXXX/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/Camera.kt: (682, 45): Type inference failed. Expected type mismatch: inferred type is Int? but Int was expected
e: /home/XXXXXXXXXXXX/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/CameraUtils.kt: (51, 13): Type inference failed: Cannot infer type parameter V in inline operator fun <K, V> MutableMap<K, V>.set(key: K, value: V): Unit
None of the following substitutions                                     
receiver: MutableMap<String, Any>  arguments: (String,Any)              
receiver: MutableMap<String, Int?>  arguments: (String,Int?)            
can be applied to                                                       
receiver: HashMap<String, Any>  arguments: (String,Int?)                
                                                                        
e: /home/XXXXXXXXXXXX/flutter/.pub-cache/hosted/pub.dartlang.org/camera_with_rtmp-0.3.2/android/src/main/kotlin/com/whelksoft/camera_with_rtmp/VideoEncoder.kt: (427, 23): Type mismatch: inferred type is ByteBuffer? but ByteBuffer was expected
                                                                        
FAILURE: Build failed with an exception.                                
                                                                        
* What went wrong:                                                      
Execution failed for task ':camera_with_rtmp:compileDebugKotlin'.       
> Compilation error. See log for more details                           
                                                                        
* Try:                                                                  
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
                                                                        
* Get more help at https://help.gradle.org                              
                                                                        
BUILD FAILED in 23s 

Video streaming not working on iPhone

Running the sample on a physical iPhone 6S, and the video streaming does not work. I am trying to stream to an RTMPS URL online and the livestream simply does not appear. No errors appear in the console.

Android works just fine.

Can anyone advise?

Bug of camera switching in Android 8.1

There is ndk level bug that manifests while dispose() method calls.
com.whelksoft.camera_with_rtmp.Camera.kt

fun dispose() {
  close()
  flutterTexture.release()
  orientationEventListener.disable()
}

flutterTexture.release() method causes exception but it is impossible to catch it in kotlin since it is lower level exception. Example of exception log:

F/libc    ( 3696): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 3696 (elic.requestify), pid 3696 (elic.requestify)

Build fingerprint: 'google/sdk_gphone_x86/generic_x86:8.1.0/OSM1.180201.007/4586646:user/release-keys'
Revision: '0'
ABI: 'x86'
pid: 3696, tid: 3696, name: elic.requestify  >>> com.polydelic.requestify <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference
    eax ffffffff  ebx ab3b6e70  ecx 00002ace  edx af16d000
    esi 00000000  edi 7fa724a4
    xcs 00000073  xds 0000007b  xes 0000007b  xfs 0000003b  xss 0000007b
    eip ab3a2df3  ebp bf99e788  esp bf99e760  flags 00210292
backtrace:
    #00 pc 0000bdf3  /system/lib/libutils.so (android::RefBase::decStrong(void const*) const+35)
    #01 pc 00145aad  /system/lib/libstagefright.so (android::MediaCodec::~MediaCodec()+1613)
    #02 pc 00145fe1  /system/lib/libstagefright.so (android::MediaCodec::~MediaCodec()+33)
    #03 pc 0000be2f  /system/lib/libutils.so (android::RefBase::decStrong(void const*) const+95)
    #04 pc 001571a9  /system/lib/libstagefright.so (android::MediaCodec::stop()+329)
    #05 pc 00026072  /system/lib/libmedia_jni.so (android_media_MediaCodec_stop(_JNIEnv*, _jobject*)+146)
    #06 pc 00606568  /system/framework/x86/boot-framework.oat (offset 0x606000) (android.os.Binder.destroyBinder [DEDUPED]+104)
    #07 pc 00642262  /system/lib/libart.so (art_quick_invoke_stub+338)
    #08 pc 001160cf  /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+223)
    #09 pc 0032153f  /system/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+335)
    #10 pc 0031a7a4  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+836)
    #11 pc 0062942c  /system/lib/libart.so (MterpInvokeDirect+428)
    #12 pc 006333a1  /system/lib/libart.so (artMterpAsmInstructionStart+14369)
    #13 pc 002f3a2b  /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+539)
    #14 pc 002fa2e7  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+231)
    #15 pc 0031a78a  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+810)
    #16 pc 00627e14  /system/lib/libart.so (MterpInvokeVirtual+756)
    #17 pc 006332a1  /system/lib/libart.so (artMterpAsmInstructionStart+14113)
    #18 pc 002f3a2b  /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+539)
    #19 pc 002fa2e7  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+231)
    #20 pc 0031a78a  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+810)
    #21 pc 00627e14  /system/lib/libart.so (MterpInvokeVirtual+756)
    #22 pc 006332a1  /system/lib/libart.so (artMterpAsmInstructionStart+14113)
    #23 pc 002f3a2b  /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+539)
    #24 pc 002fa2e7  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+231)
    #25 pc 0031a78a  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+810)
    #26 pc 00627e14  /system/lib/libart.so (MterpInvokeVirtual+756)
    #27 pc 006332a1  /system/lib/libart.so (artMterpAsmInstructionStart+14113)
    #28 pc 002f3a2b  /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+539)
    #29 pc 002fa2e7  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+231)
    #30 pc 0031a78a  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+810)
    #31 pc 00627e14  /system/lib/libart.so (MterpInvokeVirtual+756)
    #32 pc 006332a1  /system/lib/libart.so (artMterpAsmInstructionStart+14113)
    #33 pc 002f3a2b  /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+539)
    #34 pc 002fa2e7  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+231)
    #35 pc 0031a78a  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+810)
    #36 pc 00627e14  /system/lib/libart.so (MterpInvokeVirtual+756)
    #37 pc 006332a1  /system/lib/libart.so (artMterpAsmInstructionStart+14113)
    #38 pc 002f3a2b  /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+539)
    #39 pc 002fa1cb  /system/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*)+139)
    #40 pc 006179bf  /system/lib/libart.so (artQuickToInterpreterBridge+1311)
    #41 pc 0064832d  /system/lib/libart.so (art_quick_to_interpreter_bridge+77)
    #42 pc 00020e95  /dev/ashmem/dalvik-jit-code-cache (deleted)

Steps to reproduce (Android 8.1):

  1. User starts streaming (creates controller)
  2. User switches camera (disposes prev controller and creates new one synchronously)
  3. Exception occurs after 1 or more switches.

Android have wrong orientation output

hi, i have wrong orientation issue on android side. i have recorded on portrait position and the output result is landscape. can you help me how to fix this?

Exception on getStreamStatistics

@pinkfish Thank You for the code.
I executed the example code, but when I start streaming the video I get an exception at getStreamStatistics as 'No camera is streaming images'. Can you please help

example demo error

I/Stuff ( 5434): {filePath=null, bitrate=1228800, textureId=0, enableAndroidOpenGL=false, url=rtmp://34.70.40.166:1935/LiveApp/815794454132232781694481}
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 5434): Failed to handle method call
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 5434): kotlin.KotlinNullPointerException
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 5434): at com.whelksoft.camera_with_rtmp.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.kt:93)
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 5434): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:226)
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 5434): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 5434): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631)
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 5434): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 5434): at android.os.MessageQueue.next(MessageQueue.java:335)
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 5434): at android.os.Looper.loop(Looper.java:176)
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 5434): at android.app.ActivityThread.main(ActivityThread.java:7464)
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 5434): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 5434): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 5434): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:955)
I/flutter ( 5434): Error: error
I/flutter ( 5434): Error Message: null

Recording not works

I copy/past example and try to record video.

Android:
When I press the stop button in snackbar I receive Error null.
in the console I have error:
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 9800): Failed to handle method call
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 9800): kotlin.KotlinNullPointerException
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 9800): at com.whelksoft.camera_with_rtmp.Camera.stopVideoRecordingOrStreaming(Camera.kt:337)
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 9800): at com.whelksoft.camera_with_rtmp.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.kt:96)
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 9800): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:230)
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 9800): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 9800): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 9800): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 9800): at android.os.MessageQueue.next(MessageQueue.java:336)
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 9800): at android.os.Looper.loop(Looper.java:197)
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 9800): at android.app.ActivityThread.main(ActivityThread.java:8019)
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 9800): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 9800): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/MethodChannel#plugins.flutter.io/camera_with_rtmp( 9800): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

For iOS
Also, I can't record video. Application on iPhone crashes and closes

@pinkfish Can You check the ability to store video locally?

Do I have to change the link if I want to upload the recording into MediaLive of AWS?

Hi,
I am a novice in RTMP.
I'd like to upload the camera recording on the phone into the MediaLive of AWS.
I have found the below in your sample codes.

TextEditingController(text: "rtmp://34.70.40.166:1935/LiveApp/815794454132232781694481");

If I change the above rtmp url into the MediaLive of AWS, do it can upload the camera recording?

Aspect ratio issue

Hi,
The aspect ratio on the camera preview is fine but not on the output of the stream. The output is a bit cropped and doesn't respect the aspect ratio.
Do you have any solution for this issue ?
Thanks,
Gaël

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.