You can check the VideoLAN player. The open source player, available with the GPL license, displays almost all types of video files. You can get the source code and modify as per your requirements. In this case, you need to add a layer on top of the video for a predetermined period of time or just leave the 'ON' watermark for the entire video rendering period.
The project code is available in GIT . See Mobile VLC for a better vision of this.
For recording on the Android screen, methods were provided for Kitkat version and higher (> 4.4). You can access screen recording using the adb tool included in the Android SDK with the adb shell screenrecord command.
Code example: (by default, it is recorded at 4 Mbps)
adb shell screenrecord --bit-rate 8000000 /sdcard/yourfilename.mp4
This question will be of interest to you.
source share