android-gpuimage-plus icon indicating copy to clipboard operation
android-gpuimage-plus copied to clipboard

How to add watermark when is recording

Open nvquockhtn opened this issue 8 years ago • 13 comments
trafficstars

This library can add watermark to video when is recording? Tks.

nvquockhtn avatar Jul 16 '17 15:07 nvquockhtn

yes

wysaid avatar Jul 17 '17 02:07 wysaid

@wysaid Can you share me document or demo about this? Thank.

nvquockhtn avatar Jul 17 '17 03:07 nvquockhtn

The same question. Thanks

huunhan18pro avatar Aug 02 '17 10:08 huunhan18pro

Make an image, for example: "watermark.png". Make a rule, for example: "@blend addrev watermark.png 1.0" Make sure the loadImageCallback is right. call setFilterWithConfig with the rule.

wysaid avatar Aug 02 '17 10:08 wysaid

Thanks for you reply. Let me try it.

huunhan18pro avatar Aug 02 '17 10:08 huunhan18pro

Awesome, It's work fine. "@blend addrev watermark.png 100" But can you explain about "addrev" text?

huunhan18pro avatar Aug 02 '17 10:08 huunhan18pro

See this: https://github.com/wysaid/android-gpuimage-plus/blob/master/library/src/main/java/org/wysaid/nativePort/CGENativeLibrary.java#L23

Because Android is using premultiplied bitmap&texture, 'CGE_BLEND_MIX' may get a result of twice the strength of the blendImage's alpha channel(The result would be darker than you want). For common usage of mix blending, please use 'CGE_BLEND_ADDREV'.

wysaid avatar Aug 02 '17 10:08 wysaid

Thanks you so much. I will donate to your Paypal account.

huunhan18pro avatar Aug 02 '17 10:08 huunhan18pro

@huunhan18pro Thanks.

wysaid avatar Aug 08 '17 02:08 wysaid

Hi @huunhan18pro @wysaid Where should I give mCameraView.setFilterWithConfig("@blend addrev watermark.png 100"); this watermark thing, without displaying it to user watermark can be applied to the recording.

deepakrokz avatar Jan 31 '18 10:01 deepakrokz

You may need to add a new filter group to do this. Change the c++ code, and add your functions.😬

wysaid avatar Jan 31 '18 12:01 wysaid

how can I change size of the watermark (It is getting stretched to the whole viewport) and the watermark image's position?

Gaurav-pix avatar Feb 26 '24 05:02 Gaurav-pix

how can I change size of the watermark (It is getting stretched to the whole viewport) and the watermark image's position?

You can add your own filter to do this.

wysaid avatar Feb 29 '24 03:02 wysaid