Skip to content

onVideoFrameReceived will never be called #7

@sinabolouki

Description

@sinabolouki

Hi, I am using this plugin in my project to capture images from rtsp stream and do some process on it. I followed the sample code in readme.md like the following:

var rtsp = Rtsp()
rtsp.init(uri.toString(), timeout = 10000)
rtsp.setStatusListener(object : RtspStatusListener {
    override fun onConnecting() {}
    override fun onConnected(sdpInfo: SdpInfo) {
        println("connected")
    }
    override fun onDisconnected() {
        println("disconnected")
    }
    override fun onUnauthorized() {
        print("unauthorized")
    }
    override fun onFailed(message: String?) {
        println("failed ${message.orEmpty()}")
    }
})

rtsp.setFrameListener(object :RtspFrameListener {
    override fun onVideoNalUnitReceived(frame: Frame?) {
        println("video nal received ${frame?.offset} ${frame?.timestamp} ${frame?.length}")
    }
    override fun onVideoFrameReceived(width: Int, height: Int, mediaImage: Image?, yuv420Bytes: ByteArray?, bitmap: Bitmap?) {
        println("video frame received ${width} ${height} ")
    }
    override fun onAudioSampleReceived(frame: Frame?) {
    }
})

rtsp.setRequestBitmap(true)
rtsp.start(autoPlayAudio = false)

My problem is that the onVideoFrameReceived method is never called. Can you help me fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions