sergey-dryabzhinsky / nginx-rtmp-module

NGINX-based Media Streaming Server
http://nginx-rtmp.blogspot.com
BSD 2-Clause "Simplified" License
1.02k stars 217 forks source link

Delaying the stream utilizing on_publish hook #349

Open yildizsc opened 2 years ago

yildizsc commented 2 years ago

Hi @sergey-dryabzhinsky,

Thanks for your effort in this RTMP module. I have a special case. I want to delay the stream using on_publish hook due to the fact that I want to extract the audio and send it to the transcription service for subtitles. That is, the stream needs to be delayed so that transcriptions and the video would meet at the same time. Right now I can do it with ffmpeg but this is not ideal solution because there are multiple roundtrips between ffmpeg and RTMP server to accomplish the delay. I am using on_publish and put there sleep for a couple of seconds and make it wait.

If this is not possible, is there a way to increase the timeout of on_publish call. AFAIK, there is 10 secs. It would be good if it would be parametric so that I can customize it. If I need 30 secs for delay, I need to create 3 delayer applications on RTMP side.

I wish I helped with this issue but unfortunately, I do not know C lang. I search for some specific keywords such as timeout, on_publish, etc but due to the fact that the codebase is very sophisticated to me, there is no way for me.

Thanks in advance.

yildizsc commented 2 years ago

updating netcall_timeout directive seems working thanks to @fatihorhan