AutelSDK / MSDK2.0

Android Autel Mobile SDK 2.0 MSDK2.0
6 stars 0 forks source link

Rtmp service does not work on SDK Demo #9

Open yusufgngor opened 1 month ago

yusufgngor commented 1 month ago

Issue Summary:

I am unable to stream the drone camera via RTMP using the SDK.

Steps to Reproduce the Issue:

RTMP Server:

SDK:

There is one hack to run rtmp service using sdk :

  • Run the native Autel Enterprise application.**
  • Start the live stream.
  • Close the application without stopping the live stream.
  • Try to start live streaming with the SDK.
fun initRTMP() {
        coroutineScope.launch {
            RtmpServiceManager.getInstance().initRtmpConfig(
                rtmpUrl,
                SDKConstants.STREAM_CHANNEL_16110,
                false
            )
            RtmpServiceManager.getInstance().setRtmpPublishListener(object : IPublishListener {
                override fun onConnecting() {
                    Log.d(TAG, "Rtmp Status : connecting")
                    connectStatus = 0;
                }

                override fun onConnected() {
                    Log.d(TAG, "Rtmp Status : connected.")
                    connectStatus = 1;
                }

                override fun onConnectedFailed(code: Int) {
                    Log.d(TAG, "Rtmp Status : connected failed code=" + code)
                    connectStatus = 2;
                }

                override fun onStartPublish() {
                    Log.d(TAG, "Rtmp Status : start publish stream")
                }

                override fun onStopPublish() {
                    Log.d(TAG, "Rtmp Status : stoppublish now")
                }

                override fun onFpsStatistic(fps: Int) {
                    Log.d(TAG, "Rtmp upload fps : " + fps)
                }

                override fun onRtmpDisconnect() {
                    Log.d(TAG, "Rtmp Status : disconnect..")
                }

                override fun onVideoBriate(value: Int) {
                    Log.d(TAG, "Rtmp onVideoBriate : " + value + " KBPS")
                }

                override fun onAudioBriate(value: Int) {
                    Log.d(TAG, "Rtmp onAudioBriate : " + value + " KBPS")
                }

                override fun onPublishSuccess() {
                    Log.d(TAG, "Rtmp onPublishSuccess")
                }

                override fun onPublishFailed(errorCode: Int) {
                    Log.d(TAG, "Rtmp onPublishFailed errcode" + errorCode)
                }
            })

        }
    }

 fun startRTSPStream() {

        if (connectStatus == 0) initRTMP()
        coroutineScope.launch {

            try {
                RtmpServiceManager.getInstance().startPublishStream()
            } catch (e: Exception) {
                Log.d(TAG, "Exception ${e.toString()}")
            }
        }
    }
AutelSDK commented 1 month ago

can you show the rtmpUrl address to us ?

yusufgngor commented 1 month ago

I am using Mediamtx as rtmp server (https://github.com/bluenviron/mediamtx) and I serve it on my local network. So my rtmp url is rtmp://192.168.0.x:1935/live

AutelSDK commented 1 month ago

I am using Mediamtx as rtmp server (https://github.com/bluenviron/mediamtx) and I serve it on my local network. So my rtmp url is rtmp://192.168.0.x:1935/live

please try this code CameraKey.KeyCameraTransferPayLoadType.create().set(VideoCompressStandardEnum.H264) before you startPublishStream and then see if it is ok, thanks. we support H264 live only