pedroSG94 / RootEncoder

RootEncoder for Android (rtmp-rtsp-stream-client-java) is a stream encoder to push video/audio to media servers using protocols RTMP, RTSP, SRT and UDP with all code written in Java/Kotlin
Apache License 2.0
2.53k stars 772 forks source link

standalone local android (rtsp server) #1461

Closed dianyulius closed 5 months ago

dianyulius commented 5 months ago

Hey there,

i want to ask can i use this library to create a local android rtsp server to accept stream data (for example from local client ip OBS)?

i tried to call:

rtspServer = RtspServer(this, 1935)
rtspServer.startServer()

and remarking these code:

//        if (!serverCommandManager.videoDisabled) {
//          if (!serverCommandManager.videoInfoReady()) {
//            semaphore.drainPermits()
//            Log.i(TAG, "waiting for video info")
//            semaphore.tryAcquire(5000, TimeUnit.MILLISECONDS)
//          }
//          if (!serverCommandManager.videoInfoReady()) {
//            onMainThreadHandler {
//              connectChecker.onConnectionFailed("video info is null")
//            }
//            return@Thread
//          }
//        }

then i start the obs server through rtsp://IPADDRESS:1935

image

Thank you!

pedroSG94 commented 5 months ago

Hello,

This server is not designed to accept external data. This server is only to connect with a player and send data from the device sources. I mean. A stream server has 2 types of clients:

So this server only accept players and get the video/audio data from the device. External video/audio data from a pusher is not accepted.

dianyulius commented 5 months ago

Hello,

Okay thanks for the reply.