Jump to content
  • 0

Plugin black image


robertosamayoa
 Share

Question

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

11 answers to this question

Recommended Posts

  • 0
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

  • 0
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

  • 0

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

  • 0

@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

  • 0
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

 Share

×
×
  • Create New...