wysaid / android-gpuimage-plus

Android Image & Camera Filters Based on OpenGL.
MIT License
1.8k stars 473 forks source link

How to add watermark when is recording #169

Open nvquockhtn opened 7 years ago

nvquockhtn commented 7 years ago

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

wysaid commented 7 years ago

yes

nvquockhtn commented 7 years ago

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

huunhan18pro commented 7 years ago

The same question. Thanks

wysaid commented 7 years ago

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.

huunhan18pro commented 7 years ago

Thanks for you reply. Let me try it.

huunhan18pro commented 7 years ago

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

wysaid commented 7 years ago

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'.

huunhan18pro commented 7 years ago

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

wysaid commented 7 years ago

@huunhan18pro Thanks.

deepakrokz commented 6 years ago

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.

wysaid commented 6 years ago

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

Gaurav-pix commented 6 months ago

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

wysaid commented 6 months ago

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.