ant-media / Ant-Media-Server

Ant Media Server is a live streaming engine software that provides adaptive, ultra low latency streaming by using WebRTC technology with ~0.5 seconds latency. Ant Media Server is auto-scalable and it can run on-premise or on-cloud.
https://antmedia.io
Other
4.25k stars 626 forks source link

Recording of synchronous filtered streams #4557

Closed fabiox23 closed 1 year ago

fabiox23 commented 1 year ago

When applying a text filter of "synchronous" type on an input stream (and using the same stream id for the output stream), the recording function seems to apply to the original (input) stream, not the filtered (output) one. I would expect the filtered stream to be recorded instead.

Ant Media Server version: Enterprise 2.5.1 on an AWS-EC2 Ubuntu 20.04 server

fabiox23 commented 1 year ago

Hi, the issue with the inability of recording asynchronous filtered streams has become quite urgent. Is there a quick fix that I can possibly apply? Thanks again, Fabio

mekya commented 1 year ago

I've increased the priority. I hope we can schedule it today.

burak-58 commented 1 year ago

Hi @fabiox23 , Thanks for your report. You should execute this scenario:

  1. Enable adaptive streaming
  2. Create a stream
  3. Apply filter in sync mode by setting type to synchronous and setting outputStrems same with the inputStreams in the Rest method like the following:

curl -i -X POST -H "Accept: Application/json" -H "Content-Type: application/json" "http://localhost:5080/WebRTCAppEE/rest/v2/filters/create" -d '{"filterId":"filter1","inputStreams":["stream1"],"outputStreams":["stream1"],"videoFilter":"[in0]vflip[out0]","audioFilter":"[in0]acopy[out0]","videoEnabled":"true","audioEnabled":"true","type":"synchronous"}'

  1. start recording ....
  2. stop recording
  3. delete filter
  4. stop stream

At the end you will have 2 records like {stream_id}.mp4 and {streamid}{resolution}p{bitrate}kbps.mp4 The first record has original stream and the second has the filtered stream.

PS: There is still a video duration issue in this scenario. I have sent the PR above to fix this.

mekya commented 1 year ago

I've merged the PR @burak-58. Thank you

Shall we need a test code to not encounter the same problem again?

fabiox23 commented 1 year ago

Hi,

I have tried the steps below but the procedure doesn't work for me.

After applying the filter and starting the recording, only one recording is available, ie {stream_id}.mp4.

Also, after stopping the recording, removing the filter and stopping the stream, the {stream_id} is still listed on the user interface and the corresponding .ts and .m3u8 files are not cleared. Even after removing those files manually, the file {stream_id}_adaptive.m3u8 is being recreated automatically.

Thanks.

On 23/11/2022 07:02, burak-58 wrote:

Hi @fabiox23 https://github.com/fabiox23 , Thanks for your report. You should execute this scenario:

  1. Enable adaptive streaming
  2. Create a stream
  3. Apply filter in sync mode by setting type to synchronous and setting outputStrems same with the inputStreams in the Rest method like the following:

|curl -i -X POST -H "Accept: Application/json" -H "Content-Type: application/json" "http://localhost:5080/WebRTCAppEE/rest/v2/filters/create" -d '{"filterId":"filter1","inputStreams":["stream1"],"outputStreams":["stream1"],"videoFilter":"[in0]vflip[out0]","audioFilter":"[in0]acopy[out0]","videoEnabled":"true","audioEnabled":"true","type":"synchronous"}'|

  1. start recording ....
  2. stop recording
  3. delete filter
  4. stop stream

At the end you will have 2 records like {stream_id}.mp4 and {streamid}{resolution}p{bitrate}kbps.mp4 The first record has original stream and the second has the filtered stream.

PS: There is still a video duration issue in this scenario. I have sent the PR above to fix this.

— Reply to this email directly, view it on GitHub https://github.com/ant-media/Ant-Media-Server/issues/4557#issuecomment-1324629907, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANUWG3DS4Q2GH4K32XL46ULWJW6R5ANCNFSM6AAAAAAR5XKUPA. You are receiving this because you were mentioned.Message ID: @.***>

burak-58 commented 1 year ago

I have created this issue for the last message. https://github.com/ant-media/Ant-Media-Server/issues/4640