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.57k stars 776 forks source link

How to add text while streaming and encoding video #1623

Open Technology-For-Life opened 4 weeks ago

Technology-For-Life commented 4 weeks ago

Dear PedroSG94 Please let me know is there any way to add text to the live stream and encode the video? Thanks

pedroSG94 commented 4 weeks ago

Hello,

You have code example in the app example. You can add text using an Android view: https://github.com/pedroSG94/RootEncoder/blob/master/app/src/main/java/com/pedro/streamer/utils/FilterMenu.kt#L99 Or text directly: https://github.com/pedroSG94/RootEncoder/blob/master/app/src/main/java/com/pedro/streamer/utils/FilterMenu.kt#L308

You can test it using the app example, rotation example and use the menu button

Technology-For-Life commented 4 weeks ago

image

Thanks I did it However when i add multi text with different positions it only shows the last text, please tell me how can i do it Also can i add datetime to video streaming

pedroSG94 commented 4 weeks ago

hello,

That is because you replace the last text filter. You can set multiple filters using addFilter method: https://github.com/pedroSG94/RootEncoder/blob/master/library/src/main/java/com/pedro/library/view/GlInterface.java#L83

Technology-For-Life commented 4 weeks ago

Hi, Please tell me how i can call the addFilter method ? Thanks

pedroSG94 commented 4 weeks ago

Exactly the same way you are using setFilter method you can call addFilter.