robertosamayoa Posted October 20, 2022 Share Posted October 20, 2022 Hello, i was testing 2. Overlay Filter: You can use an overlay filter to add a stream over another one as an overlay. curl command: curl -i -X POST -H "Accept: Application/json" -H "Content-Type: application/json" "http://localhost:5080/WebRTCAppEE/rest/v2/filters/create" -d '{"filterId":"overlaydemo","inputStreams":["stream1","stream2"],"outputStreams":["test"],"videoFilter":"[in0]scale=240:160[s0];[in1][s0]overlay[out0]","audioFilter":"[in0][in1]amix=inputs=2[out0]","videoEnabled":"true","audioEnabled":"true","type":"asynchronous"}' Input streams: stream1 and stream2 Output streams: test Video Filter Text:[in0]scale=240:160[s0];[in1][s0]overlay[out0]","audioFilter":"[in0][in1]amix=inputs=2[out0] Explanation: We scale stream1(in0) to 240×160 and obtain a hidden stream(s0). The we apply it to the stream2(in1) and obtain the output stream test(out0). Output: but not working for me version 2.4.1 i get stream black. So question is: here say we have to inputs Stream 1 and stream 2 and the output stream name test {"filterId":"overlaydemo","inputStreams":["stream1","stream2"],"outputStreams":["test"] So the output here we create or should be existing one. input streams are i guess from where we get the video to insert in the output , or not? Link to comment Share on other sites More sharing options...
0 robertosamayoa Posted October 20, 2022 Author Share Posted October 20, 2022 6 minutes ago, robertosamayoa said: Hello, i was testing 2. Overlay Filter: You can use an overlay filter to add a stream over another one as an overlay. curl command: curl -i -X POST -H "Accept: Application/json" -H "Content-Type: application/json" "http://localhost:5080/WebRTCAppEE/rest/v2/filters/create" -d '{"filterId":"overlaydemo","inputStreams":["stream1","stream2"],"outputStreams":["test"],"videoFilter":"[in0]scale=240:160[s0];[in1][s0]overlay[out0]","audioFilter":"[in0][in1]amix=inputs=2[out0]","videoEnabled":"true","audioEnabled":"true","type":"asynchronous"}' Input streams: stream1 and stream2 Output streams: test Video Filter Text:[in0]scale=240:160[s0];[in1][s0]overlay[out0]","audioFilter":"[in0][in1]amix=inputs=2[out0] Explanation: We scale stream1(in0) to 240×160 and obtain a hidden stream(s0). The we apply it to the stream2(in1) and obtain the output stream test(out0). Output: but not working for me version 2.4.1 i get stream black. So question is: here say we have to inputs Stream 1 and stream 2 and the output stream name test {"filterId":"overlaydemo","inputStreams":["stream1","stream2"],"outputStreams":["test"] So the output here we create or should be existing one. input streams are i guess from where we get the video to insert in the output , or not? Also if i want to rewrite means i already create output test then i want to add another filter on same output test? without loosing transmition. 6 minutes ago, robertosamayoa said: Link to comment Share on other sites More sharing options...
0 robertosamayoa Posted October 20, 2022 Author Share Posted October 20, 2022 16 minutes ago, robertosamayoa said: Also if i want to rewrite means i already create output test then i want to add another filter on same output test? without loosing transmition. ERROR i.antmedia.filter.utils.FilterGraph - error avfilter_graph_parse 2022-10-20 17:59:52,565 [http-nio2-0.0.0.0-5080-exec-2] ERROR io.antmedia.filter.FilterAdaptor - Video filter graph can not be initiated Link to comment Share on other sites More sharing options...
0 Burak Posted October 21, 2022 Share Posted October 21, 2022 Hi @robertosamayoa, First you don't have to have a stream with the id of output stream, it will be created automatically. Also do you have the input streams available when you called the REST method? Could you please send me the filter text you send? Link to comment Share on other sites More sharing options...
0 robertosamayoa Posted March 27 Author Share Posted March 27 i was able to test plugin option, making testing i saw the issue here is, if we get input sources A and B we also have to create an output stream, the problem here is we want to apply new plugin to same outpout stream is not possible, as we have to delete current and create new, and doing that is a new stream. get it? or i am wrong? Link to comment Share on other sites More sharing options...
0 Yash Posted March 29 Share Posted March 29 @robertosamayoa Using source A and source B, you can update the existing plugin output stream without creating a new one. Here's a postman Curl sample: curl --location --request PUT 'https://domain-name:port/LiveApp/rest/v2/filters/mcu-filter' \ --header 'Accept: Application/json' \ --header 'Content-Type: application/json' \ --data '{"filterId":"overlay","inputStreams":["sourceA","sourceB"],"outputStreams":["output"],"videoFilter":"[in0]scale=240:160[s0];[in1][s0]overlay[out0]","audioFilter":"[in0][in1]amix=inputs=2[out0]","type":"asynchronous","videoEnabled":true,"audioEnabled":true}' For example, I used the overlay filter. You can use different filters depending on your needs. I hope it helps. Link to comment Share on other sites More sharing options...
0 robertosamayoa Posted March 29 Author Share Posted March 29 thanks, really, these make my day... is working properly. 1 Link to comment Share on other sites More sharing options...
0 robertosamayoa Posted March 31 Author Share Posted March 31 hi, i has being testing just one comment. if one of the sources goes down, and then goes up, the current output stream wont run again, i have to restart ams to work again, how to deal with these? Link to comment Share on other sites More sharing options...
0 robertosamayoa Posted March 31 Author Share Posted March 31 3 hours ago, robertosamayoa said: hi, i has being testing just one comment. if one of the sources goes down, and then goes up, the current output stream wont run again, i have to restart ams to work again, how to deal with these? also when i update the same filter not start playing not even if refresh. i am testing playing streams on DASH. example 1./ Put first api 2./ Put second api and keep changing, will see example curl --location --request PUT 'https://domain:5443/WebRTCAppEE/rest/v2/filters/mcu-filter' \ --header 'Accept: Application/json' \ --header 'Content-Type: application/json' \ --data '{"filterId":"overlay3","inputStreams":["stream1","stream2"],"outputStreams":["hellomundo"],"videoFilter":"[in0]scale=534:354:force_original_aspect_ratio=decrease,pad=720:360:93:3:color=black[s0];[in1]scale=174:114:force_original_aspect_ratio=decrease,pad=720:120:273:3:color=black[s1];[s0][s1]vstack=inputs=2,pad=720:480:0:0[out0]","audioFilter":"[in0][in1]amix=inputs=2[out0]","type":"asynchronous","videoEnabled":true,"audioEnabled":true}' curl --location --request PUT 'https://domain:5443/WebRTCAppEE/rest/v2/filters/mcu-filter' \ --header 'Accept: Application/json' \ --header 'Content-Type: application/json' \ --data '{"filterId":"overlay3","inputStreams":["stream2","stream1"],"outputStreams":["hellomundo"],"videoFilter":"[in0]scale=240:160[s0];[in1][s0]overlay[out0]","audioFilter":"[in0][in1]amix=inputs=2[out0]","type":"asynchronous","videoEnabled":true,"audioEnabled":true}' Link to comment Share on other sites More sharing options...
0 robertosamayoa Posted April 1 Author Share Posted April 1 On 3/29/2023 at 12:39 AM, robertosamayoa said: thanks, really, these make my day... is working properly. any idea? Link to comment Share on other sites More sharing options...
0 robertosamayoa Posted April 2 Author Share Posted April 2 Link to comment Share on other sites More sharing options...
0 Yash Posted April 2 Share Posted April 2 @robertosamayoa Both are known issues currently with filter plugin. Please check the following Git Hub issues.https://github.com/ant-media/Ant-Media-Server/issues/4862https://github.com/ant-media/Ant-Media-Server/issues/4441 These issues will be scheduled asap in weekly sprints. 1 Link to comment Share on other sites More sharing options...
Question
robertosamayoa
Hello, i was testing
2. Overlay Filter:
You can use an overlay filter to add a stream over another one as an overlay.
curl command:
Input streams: stream1 and stream2
Output streams: test
Video Filter Text:
[in0]scale=240:160[s0];[in1][s0]overlay[out0]","audioFilter":"[in0][in1]amix=inputs=2[out0]
Explanation: We scale stream1(in0) to 240×160 and obtain a hidden stream(s0). The we apply it to the stream2(in1) and obtain the output stream test(out0).
Output:
but not working for me version 2.4.1
i get stream black.
So question is:
here say we have to inputs Stream 1 and stream 2 and the output stream name test
{"filterId":"overlaydemo","inputStreams":["stream1","stream2"],"outputStreams":["test"]
So the output here we create or should be existing one.
input streams are i guess from where we get the video to insert in the output , or not?
Link to comment
Share on other sites
Top Posters For This Question
9
2
1
Popular Days
Oct 20
3
Apr 2
2
Mar 29
2
Mar 31
2
Top Posters For This Question
robertosamayoa 9 posts
Yash 2 posts
Burak 1 post
Popular Days
Oct 20 2022
3 posts
Apr 2 2023
2 posts
Mar 29 2023
2 posts
Mar 31 2023
2 posts
Popular Posts
robertosamayoa
thanks, really, these make my day... is working properly.
Yash
@robertosamayoa Both are known issues currently with filter plugin. Please check the following Git Hub issues. https://github.com/ant-media/Ant-Media-Server/issues/4862 https://github.com/ant-media
Posted Images
11 answers to this question
Recommended Posts