{"action":"created","issue":{"url":"https://api.github.com/repos/sergey-dryabzhinsky/nginx-rtmp-module/issues/42","labels_url":"https://api.github.com/repos/sergey-dryabzhinsky/nginx-rtmp-module/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/sergey-dryabzhinsky/nginx-rtmp-module/issues/42/comments","events_url":"https://api.github.com/repos/sergey-dryabzhinsky/nginx-rtmp-module/issues/42/events","html_url":"https://github.com/sergey-dryabzhinsky/nginx-rtmp-module/issues/42","id":107152287,"number":42,"title":"Instability: clients receiving gibberish after some time","user":{"login":"jazzmanro","id":14343554,"avatar_url":"https://avatars.githubusercontent.com/u/14343554?v=3","gravatar_id":"","url":"https://api.github.com/users/jazzmanro","html_url":"https://github.com/jazzmanro","followers_url":"https://api.github.com/users/jazzmanro/followers","following_url":"https://api.github.com/users/jazzmanro/following{/other_user}","gists_url":"https://api.github.com/users/jazzmanro/gists{/gist_id}","starred_url":"https://api.github.com/users/jazzmanro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jazzmanro/subscriptions","organizations_url":"https://api.github.com/users/jazzmanro/orgs","repos_url":"https://api.github.com/users/jazzmanro/repos","events_url":"https://api.github.com/users/jazzmanro/events{/privacy}","received_events_url":"https://api.github.com/users/jazzmanro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-09-18T07:59:50Z","updated_at":"2015-09-30T18:15:35Z","closed_at":null,"body":"Hello there,\r\n\r\nThank you for trying to continue Roman's efforts for this great RTMP server.\r\nI tried using your fork especially for MP3 support.\r\n\r\nWhat I can say so far:\r\n- MP3 looks good and stable, running 24/24 streams without issues. Didn't test though on many devices but seems to work properly. Thank you very much for this!\r\n- EXT-X-PROGRAM-DATE-TIME is not really implemented according to recommendations of https://tools.ietf.org/html/draft-pantos-http-live-streaming-16: \"EXT-X-PROGRAM-DATE-TIME tags SHOULD provide millisecond accuracy\"\r\n- EXT-X-PROGRAM-DATE-TIME doesn't work with \"hls_continuous on\" as it only writes the tag during first session; when continuing, there is nothing implemented and the information is lost.\r\n\r\nAnd the main problem that makes the subject of this topic is that somewhere in your modifications there is a regression at least from stability point of view. Let me explain:\r\nI am using for a long time Roman's main version to stream even 24/24. The setup could be something like: Publisher (FMLE) => NGINX-RTMP => FFMPEG => NGINX-RTMP => HLS (HTTP). It works great with Roman's codebase.\r\nUsing your branch though the FFMPEG process crashes randomly with random output like:\r\n\r\n```\r\nframe=42824 fps= 25 q=0.0 q=0.0 q=-1.0 size=   76907kB time=03:08:08.03 bitrate=  55.8kbits/s    \r\nPast duration 0.924995 too large\r\n    Last message repeated 1 times\r\n[NULL @ 0x4260e40] luma_log2_weight_denom 12 is out of range\r\n[flv @ 0x425eae0] Stream discovered after head already parsed\r\n[flv @ 0x425eae0] New video stream 0:3 at pos:333058035 and DTS:11290.2s\r\n[flv @ 0x425eae0] Stream discovered after head already parsed\r\n[flv @ 0x425eae0] New video stream 0:4 at pos:333062118 and DTS:11290.2s\r\n[h264 @ 0x4f8fa80] luma_log2_weight_denom 12 is out of range\r\n[h264 @ 0x4f8fa80] deblocking_filter_idc 3 out of range\r\n[h264 @ 0x4f8fa80] decode_slice_header error \r\n```\r\n\r\n```\r\nframe=  504 fps= 23 q=20.0 q=19.0 q=-1.0 size=     927kB time=02:39:25.24 bitrate=   0.8kbits/s    \r\n[flv @ 0x2c96ae0] Stream discovered after head already parsed\r\n[flv @ 0x2c96ae0] New video stream 0:3 at pos:4668671 and DTS:9567.66s\r\n[h264 @ 0x3ade100] concealing 3502 DC, 3502 AC, 3502 MV errors in P frame\r\n*** glibc detected *** /blc/bin/ffmpeg: corrupted double-linked list: 0x0000000002e74b70 ***\r\n...\r\n```\r\n\r\n```\r\nframe=  391 fps= 24 q=24.0 q=23.0 q=-1.0 size=     764kB time=02:34:48.89 bitrate=   0.7kbits/s    \r\n[flv @ 0x3b23ae0] Stream discovered after head already parsed\r\n[flv @ 0x3b23ae0] Video codec (1) is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.\r\n[flv @ 0x3b23ae0] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)\r\n[flv @ 0x3b23ae0] New video stream 0:3 at pos:3725795 and DTS:9290.96s \r\n...\r\n```\r\nIn many cases, I get a segmentation fault.\r\nIn order to try isolate the issue, I manually merged Roman's branch and yours. I used from your branch everything from HLS/DASH and minor updates for STAT (port number), and the rest from Roman. It is working perfectly again with MP3 support and so on.\r\nMy assumption is that the problem seems to be somewhere in your changes impacting LIVE module as FFMPEG is actually a RTMP client when it crashes, launched using exec_push directive. I can only assume that at a moment in time it gets messages that he can't parse or understand and I've seen you submitted changes around this area.\r\n\r\nFFMPEG is a very recent build using internal rtmp support.\r\nI had thought that maybe building with librtmp would be better as maybe your changes require features not build into FFMPEG yet.\r\nUnfortunately, I don't have now the time to continue isolating this and find the culprit as it isn't easy to reproduce. Sometimes the stream could work for yours until a crash. Under heavier load though, it would seem to to crash every few minutes and after a while the entire worker process is stuck at 100% CPU usage, not responding and needs manual restart.\r\nNGINX worker process doesn't seem to crash though, other streams work fine until it could hang. It's just that it's sending data FFMPEG cannot understand.\r\n\r\nI think you can try to reproduce if you simply leave FFMPEG running as a live RTMP client for a few hours or a day or two. It should crash at some point. Ideally you should publish with latest FMLE as maybe it has something to do with commands came from FMLE?\r\nRelevant rtmp server options from my configuration:\r\n```\r\n  timeout       30s;\r\n  ping          30s;\r\n  ping_timeout  15s;\r\n  max_streams   128;\r\n  ack_window    1000000;\r\n  chunk_size    16384;\r\n  max_message   512k;\r\n  buflen        1s;\r\n  respawn_timeout   2s;\r\n  live                on;\r\n  meta                copy;\r\n  interleave          on;\r\n  wait_key            on;\r\n  wait_video          on;\r\n  publish_notify      on;\r\n  drop_idle_publisher 10s;\r\n  sync                100ms;\r\n  idle_streams        off;\r\n```\r\n\r\nSorry for not having more details, also debug logs would have been a problem because hours of running in debug generates file sizes that for now I can't afford.\r\nFor now I am very happy with my custom build but maybe this report helps and I would really like to completely use your branch someday.\r\n\r\nThank you."},"comment":{"url":"https://api.github.com/repos/sergey-dryabzhinsky/nginx-rtmp-module/issues/comments/144496368","html_url":"https://github.com/sergey-dryabzhinsky/nginx-rtmp-module/issues/42#issuecomment-144496368","issue_url":"https://api.github.com/repos/sergey-dryabzhinsky/nginx-rtmp-module/issues/42","id":144496368,"user":{"login":"sergey-dryabzhinsky","id":717597,"avatar_url":"https://avatars.githubusercontent.com/u/717597?v=3","gravatar_id":"","url":"https://api.github.com/users/sergey-dryabzhinsky","html_url":"https://github.com/sergey-dryabzhinsky","followers_url":"https://api.github.com/users/sergey-dryabzhinsky/followers","following_url":"https://api.github.com/users/sergey-dryabzhinsky/following{/other_user}","gists_url":"https://api.github.com/users/sergey-dryabzhinsky/gists{/gist_id}","starred_url":"https://api.github.com/users/sergey-dryabzhinsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergey-dryabzhinsky/subscriptions","organizations_url":"https://api.github.com/users/sergey-dryabzhinsky/orgs","repos_url":"https://api.github.com/users/sergey-dryabzhinsky/repos","events_url":"https://api.github.com/users/sergey-dryabzhinsky/events{/privacy}","received_events_url":"https://api.github.com/users/sergey-dryabzhinsky/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T18:15:35Z","updated_at":"2015-09-30T18:15:35Z","body":"Damn. Can't get stable nginx-rtmp on my build environment:\r\n- Ubuntu Trusty amd64\r\n- nginx 1.8.0\r\n\r\nSpawned ffmpeg still fall when I publish rfom FMLE. And any version of nginx-rtmp.\r\n\r\nFFmpeg 2.7.2, 2.8. With or w/out librtmp.\r\n\r\nWill try build on Wheezy soon."}}