arut / nginx-rtmp-module

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

Retranslation to HLS using exec stops after multiple connection interruptions #293

Closed vkhramtsov closed 4 years ago

vkhramtsov commented 10 years ago

I am streaming from AFMLE to nginx with rtmp module and restream video to hls retranslator using next config:

exec /usr/bin/avconv -i rtmp://localhost:1935/<app_name>>/$name -vcodec copy -acodec aac -strict experimental -ar 44100 -ac 1 -f flv rtmp://<hls_servername>:1935/<app_name>/$name 2>>/tmp/ffmpeg-$name.log;

After multiple interruptions avconv send to log messages like this:

RTMP_ReadPacket, failed to read RTMP packet header
rtmp://localhost:1935/<app_name>/<stream_name>: Invalid data found when processing input
avconv version 0.8.9-4:0.8.9-0ubuntu0.12.04.1, Copyright (c) 2000-2013 the Libav developers
  built on Nov  9 2013 19:08:00 with gcc 4.6.3

After this restreaming to hls restranslator using exec stops completely (even if link become stable), while streaming to other retranslator works fine. How can I fix or skip incorrect rtmp packets which comes to avconv using exec?

Thanks in advance.

arut commented 10 years ago

Skipping data is not a good idea. It will definitely introduce protocol inconsistency. Please make avconv verbose and find out what it the error. It would be good to watch nginx debug log as well.