ChillingVan / AndroidInstantVideo

展现Android硬编码下的视频数据流动,可以对视频做处理,例如加滤镜,加水印等,做直播推流(用RTMP)。 Show the stream of Android video hardware encode, including video processing and video publishing by RTMP.
Apache License 2.0
718 stars 196 forks source link

请教一下怎么加Text 文字水印? #26

Open anye0803 opened 2 years ago

anye0803 commented 2 years ago
private void drawVideoFrame(ICanvasGL canvasGL, @Nullable SurfaceTexture outsideSurfaceTexture, @Nullable BasicTexture outsideTexture) {
        // Here you can do video process
        // 此处可以视频处理,例如加水印等等
        if(textureFilterLT == null) {
            textureFilterLT = new BasicTextureFilter();
        }
        if(textureFilterRT == null) {
            textureFilterRT = new HueFilter(180);
        }
}

这里说了可以加水印,但是还是不会加text的文本水印,求教

ChillingVan commented 2 years ago

可以直接调用CanvasGL.drawBitmap()方法。如果要文字的话可以看可以看这个项目的例子:https://github.com/ChillingVan/android-openGL-canvas:参考DrawTextTextureView绘制文字的方法,本质是把文字变成Bitmap