Agora-Flutter-SDK icon indicating copy to clipboard operation
Agora-Flutter-SDK copied to clipboard

AddWaterMark png doesn't work

Open jmlarbaig opened this issue 2 years ago • 8 comments

Hi everyone, I tried until moment to add watermark on video. With assets, with the function "getAbsoluthPath("assets...")" and create image with screenshot widget package and implemente it into addWatermark() function but, nothing worked.

Do you have some solutions please ?

Also, in the futur, usually the watermark will be change in the same time of recording. Do you think that the new watermark will be take in account if I integrate function "addWatermark" inside periodic timer ?

jmlarbaig avatar Apr 07 '22 09:04 jmlarbaig

Sorry for the late response, do you set the WatermarkOptions for addVideoWatermark function?

littleGnAl avatar Apr 20 '22 04:04 littleGnAl

Yes I set it, with positions and height / width

jmlarbaig avatar Apr 20 '22 13:04 jmlarbaig

Hello @jmlarbaig, can you show your code?

littleGnAl avatar Apr 25 '22 05:04 littleGnAl

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. If you find this problem please file a new issue with the same description, what happens, logs and the output. All system setups can be slightly different so it's always better to open new issues and reference the related ones. Thanks for your contribution.

github-actions[bot] avatar May 16 '22 06:05 github-actions[bot]

He @littleGnAl I'm sorry, I was buzy until now but I can answer,

So my code is that :

Future handleTimeout() async { setState(() { _counter++; }); print(_counter); print(directory); watermarkConfig.positionInLandscapeMode = Rectangle( x: (MediaQuery.of(context).size.width.toInt()) ~/ 2, y: (MediaQuery.of(context).size.height.toInt()) ~/ 2, width: MediaQuery.of(context).size.width.toInt(), height: MediaQuery.of(context).size.height.toInt()); watermarkConfig.positionInPortraitMode = Rectangle( x: (MediaQuery.of(context).size.width.toInt()) ~/ 2, y: (MediaQuery.of(context).size.height.toInt()) ~/ 2, width: MediaQuery.of(context).size.width.toInt(), height: MediaQuery.of(context).size.height.toInt()); try { setState(() { var path = _engine.getAssetAbsolutePath("images/test.png"); print(path); _engine.addVideoWatermark(path, watermarkConfig); }); } catch (event) { print("Error : $event"); }

}

jmlarbaig avatar May 29 '22 07:05 jmlarbaig

This handleTimeOut function is called at the begging of the main code. My aim is to change the picture every second but for the moment, I just want to stream with only one

jmlarbaig avatar May 29 '22 07:05 jmlarbaig

Hello @jmlarbaig, can you try add await before _engine.getAssetAbsolutePath("images/test.png") and _engine.addVideoWatermark(path, watermarkConfig)

littleGnAl avatar May 30 '22 06:05 littleGnAl

I alreeady try to add it but nothing change, the path is ok, png also, visibleInpreview is turn on on True and startPreview too

jmlarbaig avatar May 30 '22 06:05 jmlarbaig

@jmlarbaig hey, running into the same issue. Did you ever get the watermark to show up?

fabio-o0 avatar Nov 22 '22 15:11 fabio-o0

Hey Fabio,

I have search a lot and I didn't find solution. I went to other solution

jmlarbaig avatar Nov 22 '22 15:11 jmlarbaig

@jmlarbaig what solution did you end up going with?

fabio-o0 avatar Nov 22 '22 16:11 fabio-o0

I used this package :

https://pub.dev/packages/haishin_kit

jmlarbaig avatar Nov 22 '22 16:11 jmlarbaig

@jmlarbaig got you, I will look into it. Thanks for the quick responses btw. Did you still use agora for the videocall, just connected to the stream using haishin?

fabio-o0 avatar Nov 22 '22 16:11 fabio-o0

It depend of what you want, just streming something or if you want to do B2B

jmlarbaig avatar Nov 22 '22 16:11 jmlarbaig

If you still face this issue, please try upgrading to the latest version to see if it works or not.

littleGnAl avatar Dec 07 '23 09:12 littleGnAl

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. If you find this problem please file a new issue with the same description, what happens, logs and the output. All system setups can be slightly different so it's always better to open new issues and reference the related ones. Thanks for your contribution.

github-actions[bot] avatar Dec 21 '23 09:12 github-actions[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please raise a new issue.

github-actions[bot] avatar Dec 28 '23 10:12 github-actions[bot]