Open MinhMinh8722 opened 6 days ago
Hello,
If you want record the screen you can use this example: https://github.com/pedroSG94/RootEncoder/tree/master/app/src/main/java/com/pedro/streamer/screen
If you want record instead of stream you can replace isStreaming to isRecording, startStream to startRecord and stopStream to stopRecord.
isStreaming: https://github.com/pedroSG94/RootEncoder/blob/master/app/src/main/java/com/pedro/streamer/screen/ScreenService.kt#L112 To:
return genericStream.isRecording
startRecord: https://github.com/pedroSG94/RootEncoder/blob/master/app/src/main/java/com/pedro/streamer/screen/ScreenService.kt#L155 To:
if (!genericStream.isRecording) genericStream.startRecord(filePath)
And stop record: https://github.com/pedroSG94/RootEncoder/blob/master/app/src/main/java/com/pedro/streamer/screen/ScreenService.kt#L119 To:
fun stopStream() {
if (genericStream.isRecording) {
genericStream.stopRecord()
notificationManager?.cancel(notifyId)
}
}
In ScreenActivity you will need replace the stream url provided in the startRecord to a valid file path
Thanks for your answer. And can I draw a watermark on surfaceview?
You can use filters: https://github.com/pedroSG94/RootEncoder/blob/master/app/src/main/java/com/pedro/streamer/utils/FilterMenu.kt#L211 You can get glInterface with:
genericStream.getGlInterface()
Can you show me where the code for recording the screen and saving the file into local storage? Thanks!!! 🙏