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.54k stars 772 forks source link

ScreenShare example #1246

Closed RebornQ closed 8 months ago

RebornQ commented 1 year ago

Hello PedroSG94, thank you so much for your library at first!

I would like to know how to push screen data with rtmp? Do you have an example of screen sharing with your library?

I can not figure it out. Thank you.

FrankLove commented 1 year ago

It's not too difficult to do that,you can use mediaprojection to get the data of screen and mediacodec to encode this data to h264 ,then use the rtmpclient of this liabray to send the data.

pedroSG94 commented 1 year ago

Hello, You can use this example that already implement all code commented by @FrankLove https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/tree/master/app/src/main/java/com/pedro/rtpstreamer/displayexample

RebornQ commented 8 months ago

Thank you very much! @FrankLove @pedroSG94