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

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

Closed wann2 closed 4 years ago

wann2 commented 4 years ago

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?

adminant commented 4 years ago

Yes, change this example address to your MediaLive RTMP server address, and start streaming.

wann2 commented 4 years ago

Thanks for the answer. When I set AWS MediaLive, it gives 2 rtmp endpoint urls. How can I set the 2 rtmp urls inside your sample codes?

adminant commented 4 years ago

As far as I know these two urls are for redundancy, so you can use first of them

wann2 commented 4 years ago

Thanks for the guide.

I changed the rtmp url of your Flutter sample codes with my own MediaLive's rtmp url.

I started MediaLive channel.

When I click Icons.ondemand_video to execute onRecordingAndVideoStreamingButtonPressed and from the popup dialog I click OK, then I got null error on snackbar. and the below error displayed.

MethodChannel#plugins.flutter.io/camera_with_rtmp: Failed to handle method call kotlin.KotlinNullPointerException at com.whelksoft.camera_with_rtmp.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.kt:93) at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:226)

I wonder if the above error is related to MediaLive setting. or could I get any idea what is wrong?

adminant commented 4 years ago

I would suggest to try not startVideoRecordingAndStreaming, but startVideoStreaming method (on example page it's shown as a watch afaik). But in current version of plugin 0.2.2 it leads to error as discussed in thread "livestreming from android isn't stoping even after calling stopVideoStreaming " I currentry use 0.1.9 of plugin, It works but video is turned 90 deg.

wann2 commented 4 years ago

Thanks for guide.

When I use 0.1.9, I get the build error, but after executing Flutter Clean, the build is OK. And startVideoStreaming seems to work fine.

When I use 0.2.2, then the build is OK, but when I execute startVideoStreaming, "Camera error Failed to configure camera session" error happens. I tested at Samsung Galaxy 6 and Samsung Note 5. Both of them got the error.

KakaoTalk_Photo_2020-06-06-17-25-19

adminant commented 4 years ago

That's right, I have the same issue on Xiaomi phone with v 0.2.2 of plugin. BTW as I mentioned in parallel thread the Android virtual Pixel 2 API 28 device works nice.

adminant commented 4 years ago

See
https://github.com/pinkfish/flutter_rtmppublisher/issues/12#issuecomment-640127317

pinkfish commented 4 years ago

I fixed the crashing issues with the new version btw, should have fixed the issues around the camera not setting up correctly too. It is doing the 90 degree flip in software now so the output should be rotated correctly now. Hopefully anyway :). Looked good when I was testing, although not sure if it putting the right metadata into the stream for the size of the video right now.

pinkfish commented 4 years ago

I really should change the default streaming url so it doesn't run on my machines :)