WWBN / AVideo

Create Your Own Broadcast Network With AVideo Platform Open-Source. OAVP OVP
https://avideo.tube/AVideo_OpenSource
Other
1.91k stars 972 forks source link

What is the "Offline-Poster" for? #4772

Closed morbificagent closed 3 years ago

morbificagent commented 3 years ago

Hi together, Hi Daniel,

last time i asked you to make it possible to hide the offline badge on the upper left of the live-streams and you made it possible. THX for that.

But one Offline-Message is left in form of the "poster-image" on the start-screen:

image

Is it possible to get rid of this too and use the "On-Air" (red on grey) image instead as default?

And in generally i dont understand what is it for?

When im Offline and not streaming there is no entry on the start-page. When im Online and streaming it creates an entry on the start-page.

-> How should i send a stream while im offline like the picture says !?!?

The only situation i could imagine where this Offline-Poster would be helpful is when a running stream ended and the users are furthermore on the stream-site.... then they could see that the stream has ended. But especially in THIS situation this Offline-Poster ISN'T shown and a rotating circle remains there:

image

morbificagent commented 3 years ago

God morning together,

Any news about this? Git pull shows no difference :-(

@DanielnetoDotCom you are saying on_publish and on_publish_done are responsible to clear the cache. they must be working properly to clear it

And because of my shown log is full of errors with exact these files ( https://github.com/WWBN/AVideo/issues/4775 ) it feels strange that you was saying "this shouldnt be the problem"...

Are you really sure ?

DanielnetoDotCom commented 3 years ago

@morbificagent can you please provide what exact error (in the log) are you talking about?

morbificagent commented 3 years ago

image

DanielnetoDotCom commented 3 years ago

@morbificagent This is something related to your socket, lets keep the conversation into that thread

guymass commented 3 years ago

"mysite.com is replaced for security reasons.

try to create an entry in your hosts file to make your PHP use the internal IP 127.0.0.1 to retrieve the stats instead use the internet"

Any suggestion on how to do this entry? do I need an entry for www.mysite.com or to my own domain?

Also, would this also cause a problem with the OFFLINE issue? why does it say "path/to/my/myMySQLUser"

[24-Mar-2021 17:09:13 Asia/Jerusalem] AVideoLog::DEBUG: im_resizeV2: path/to/my/myMySQLUser/site/videos/cache/_jpg_605b56190b253.jpg, path/to/my/myMySQLUser/site/videos/cache/og_200X200.jpg, 200, 200, 100 SCRIPT_NAME: /view/iframe.php [24-Mar-2021 17:09:12 Asia/Jerusalem] PHP Notice: Trying to access array offset on value of type null in path/to/my/myMySQLUser/site/objects/video_statistic.php on line 354 [24-Mar-2021 17:09:12 Asia/Jerusalem] PHP Notice: Trying to access array offset on value of type null in path/to/my/myMySQLUser/site/objects/video.php on line 1004 [24-Mar-2021 17:09:12 Asia/Jerusalem] AVideoLog::DEBUG: CustomizeUser::canShareVideosFromVideo canShareVideosFromUser() = false SCRIPT_NAME: /view/index.php [24-Mar-2021 17:09:12 Asia/Jerusalem] PHP Notice: Trying to access array offset on value of type null in path/to/my/myMySQLUser/site/objects/video.php on line 1515

morbificagent commented 3 years ago

@peterflitz please try this if your site is reachable via http too:

https://github.com/WWBN/AVideo/issues/4775#issuecomment-805971871

guymass commented 3 years ago

Daniel I want to clarify this live server option, do I need this checked in order to live stream? Do I need to use my live server or is this not needed?

Screen Shot 5781-07-11 at 21 18 10 Screen Shot 5781-07-11 at 21 18 44

DanielnetoDotCom commented 3 years ago

Regarding the notification, I got a customer with a similar problem, and I could look directly into his server. I am pretty sure it is fixed now, please update and try again.

morbificagent commented 3 years ago

Hallelujah...... Its working!

Daniel, thank you for your hard work!

morbificagent commented 3 years ago

@guymass Like i understand the "Live-Servers" are to outsource these part of the workload to other servers. So if you dont plan to do that you can disable it and leave all empty there.

guymass commented 3 years ago

Daniel this is also an issue which should be addressed I don't think another issues should be opened, but I have this also causing streaming issues.

Error in writeSql : (1406) Data too long for column 'uniqidV4'

guymass commented 3 years ago

OK I updated and tested with my adaptive mode. I still don't see live on front page and I get the following in log:

Screen Shot 5781-07-11 at 23 03 47

DanielnetoDotCom commented 3 years ago

@guymass try this

guymass commented 3 years ago

:( why me... still nothing, here is some of the log:

[24-Mar-2021 23:11:33 Asia/Jerusalem] AVideoLog::DEBUG: wget Start (wget --tries=1 http://live.ahava528.com:8443/stat -O /var/www/html/AVideo/videos/cache/YPTurl_get_contents/dec547bb02dd107b2eb901904bc02cc6 --no-check-certificate) SCRIPT_NAME: /plugin/Live/stats.json.php [24-Mar-2021 23:11:33 Asia/Jerusalem] AVideoLog::DEBUG: wget: ERROR the url download but is empty http://live.ahava528.com:8443/stat, /var/www/html/AVideo/videos/cache/YPTurl_get_contents/dec547bb02dd107b2eb901904bc02cc6 SCRIPT_NAME: /plugin/Live/stats.json.php [24-Mar-2021 23:11:33 Asia/Jerusalem] AVideoLog::DEBUG: url_get_contents: wget success http://live.ahava528.com:8443/stat SCRIPT_NAME: /plugin/Live/stats.json.php [24-Mar-2021 23:11:33 Asia/Jerusalem] AVideoLog::ERROR: Live::getStatsObject RTMP Server (http://live.ahava528.com:8443/stat) is OFFLINE, timeout=(4) we could not connect on it => live_servers_id = (0) SCRIPT_NAME: /plugin/Live/stats.json.php [24-Mar-2021 23:11:33 Asia/Jerusalem] AVideoLog::DEBUG: Live::getStats(0) 1 SCRIPT_NAME: /plugin/Live/stats.json.php [24-Mar-2021 23:11:33 Asia/Jerusalem] AVideoLog::DEBUG: Live::createStatsCache {"bytes":155,"cachefile":"\/var\/www\/html\/AVideo\/videos\/cache\/YPTObjectCache\/getstats\/getstatsnotifications\/live.ahava528.com\/https\/getStats\/getStatsNotificationsa34db68754d32b7a5dec7eddb7768b0d.cache"} SCRIPT_NAME: /plugin/Live/stats.json.php [24-Mar-2021 23:12:08 Asia/Jerusalem] AVideoLog::DEBUG: Warning: Slow process detected [video::getAllVideos foreach] On Line 1223 takes 0.8858 seconds to complete, Limit (0.7). /var/www/html/AVideo/view/channel.php SCRIPT_NAME: /view/channel.php

Screen Shot 5781-07-11 at 23 14 08

DanielnetoDotCom commented 3 years ago

did you add the hosts entry for live.ahava528.com?

Looks like your server cannot connect to http://live.ahava528.com:8443/stat

guymass commented 3 years ago

like this 127.0.0.1 live.ahava528.com

DanielnetoDotCom commented 3 years ago

yes

guymass commented 3 years ago

I tried it it didn't work. I have to say we use to IP addresses on is set for the RTMP and one is for the main site. I am not sure if this is important but it was working for us before. I tried also setting the hosts to point to the correct IP, but also this shows the same error.

DanielnetoDotCom commented 3 years ago

so try to use the IP

http://127.0.0.1:8443/stat

guymass commented 3 years ago

Nope, it will not work on 127.0.0.1. I probably need to change the whole nginx configuration to have it running on this IP. I have everything already setup pretty well, and the whole point of using separate IP for the encoder to reduce load. Currently I can stream and the post is being created just fine, its just the notification on front page not showing. Very strange.

guymass commented 3 years ago

24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: NGINX ON Publish success SCRIPT_NAME: /plugin/Live/on_publish.php [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: Live::deleteStatsCache [/var/www/html/AVideo/videos/cache/YPTObjectCache/getstats/] SCRIPT_NAME: /plugin/Live/on_publish.php [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: Live::deleteStatsCache [/var/www/html/AVideo/videos/cache/YPTObjectCache/getstats/] Success SCRIPT_NAME: /plugin/Live/on_publish.php [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: NGINX Live::on_publish start SCRIPT_NAME: /plugin/Live/on_publish.php [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: Live:restream (https://live.ahava528.com/plugin/Live/standAloneFiles/restreamer.json.php) {"m3u8":"https:\/\/live.ahava528.com:8443\/live\/60180f42a4efa.m3u8","restreamerURL":"https:\/\/live.ahava528.com\/plugin\/Live\/standAloneFiles\/restreamer.json.php","restreamsDestinations":[],"token":"WWtoY0NvR2FZYU5QUThtcXhQb0FPMXRhYW13VmY3anpiVFRuaG55eEdCeHk3U2l5QWFhL1pjZUpidWpwSEN3NGZQMGFxMjZqbjJMV0wwNXJvSGU5YUE9PQ==","users_id":3} SCRIPT_NAME: /plugin/Live/on_publish.php [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: Cache::isREQUEST_URIWhitelisted: (restreamer.json.php) is whitelisted SCRIPT_NAME: /plugin/Live/standAloneFiles/restreamer.json.php [24-Mar-2021 23:56:27 Asia/Jerusalem] Restreamer.json.php start [24-Mar-2021 23:56:27 Asia/Jerusalem] Restreamer.json.php php://input {"m3u8":"https:\/\/live.ahava528.com:8443\/live\/60180f42a4efa.m3u8","restreamerURL":"https:\/\/live.ahava528.com\/plugin\/Live\/standAloneFiles\/restreamer.json.php","restreamsDestinations":[],"token":"WWtoY0NvR2FZYU5QUThtcXhQb0FPMXRhYW13VmY3anpiVFRuaG55eEdCeHk3U2l5QWFhL1pjZUpidWpwSEN3NGZQMGFxMjZqbjJMV0wwNXJvSGU5YUE9PQ==","users_id":3} [24-Mar-2021 23:56:27 Asia/Jerusalem] Restreamer.json.php ERROR There are no restreams Destinations [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: NGINX Live::on_publish end SCRIPT_NAME: /plugin/Live/on_publish.php [24-Mar-2021 23:56:27 Asia/Jerusalem] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0 [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: Live::getStatsObject (http://live.ahava528.com:8443/stat) (4) [{"file":"\/var\/www\/html\/AVideo\/plugin\/Live\/Live.php","line":1055,"function":"getStatsObject","class":"Live","object":{},"type":"->","args":[0]},{"file":"\/var\/www\/html\/AVideo\/plugin\/Live\/Live.php","line":862,"function":"_getStats","class":"Live","type":"::","args":[0]},{"file":"\/var\/www\/html\/AVideo\/objects\/functions.php","line":5978,"function":"getStats","class":"Live","type":"::","args":[]},{"file":"\/var\/www\/html\/AVideo\/plugin\/Live\/stats.json.php","line":23,"function":"getStatsNotifications","args":[]}] SCRIPT_NAME: /plugin/Live/stats.json.php [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: Live::get_data(http://live.ahava528.com:8443/stat, 4) SCRIPT_NAME: /plugin/Live/stats.json.php [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: url_get_contents: Start http://live.ahava528.com:8443/stat, , 4 https://live.ahava528.com/plugin/Live/stats.json.php?Menu 213.57.226.226 [{"file":"\/var\/www\/html\/AVideo\/plugin\/Live\/Live.php","line":663,"function":"url_get_contents","args":["http:\/\/live.ahava528.com:8443\/stat","","4",true]},{"file":"\/var\/www\/html\/AVideo\/plugin\/Live\/Live.php","line":630,"function":"get_data","class":"Live","object":{},"type":"->","args":["http:\/\/live.ahava528.com:8443\/stat","4"]},{"file":"\/var\/www\/html\/AVideo\/plugin\/Live\/Live.php","line":1055,"function":"getStatsObject","class":"Live","object":{},"type":"->","args":[0]},{"file":"\/var\/www\/html\/AVideo\/plugin\/Live\/Live.php","line":862,"function":"_getStats","class":"Live","type":"::","args":[0]},{"file":"\/var\/www\/html\/AVideo\/objects\/functions.php","line":5978,"function":"getStats","class":"Live","type":"::","args":[]},{"file":"\/var\/www\/html\/AVideo\/plugin\/Live\/stats.json.php","line":23,"function":"getStatsNotifications","args":[]}] SCRIPT_NAME: /plugin/Live/stats.json.php [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: url_get_contents: allow_url_fopen http://live.ahava528.com:8443/stat SCRIPT_NAME: /plugin/Live/stats.json.php [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: url_get_contents: ERROR file_get_contents(http://live.ahava528.com:8443/stat) SCRIPT_NAME: /plugin/Live/stats.json.php [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: url_get_contents: Nothing yet http://live.ahava528.com:8443/stat SCRIPT_NAME: /plugin/Live/stats.json.php [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: url_get_contents: try wget /var/www/html/AVideo/videos/cache/YPTurl_get_contents/dec547bb02dd107b2eb901904bc02cc6 http://live.ahava528.com:8443/stat SCRIPT_NAME: /plugin/Live/stats.json.php [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: wget Start (wget --tries=1 http://live.ahava528.com:8443/stat -O /var/www/html/AVideo/videos/cache/YPTurl_get_contents/dec547bb02dd107b2eb901904bc02cc6 --no-check-certificate) SCRIPT_NAME: /plugin/Live/stats.json.php [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: wget: ERROR the url download but is empty http://live.ahava528.com:8443/stat, /var/www/html/AVideo/videos/cache/YPTurl_get_contents/dec547bb02dd107b2eb901904bc02cc6 SCRIPT_NAME: /plugin/Live/stats.json.php [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: url_get_contents: wget success http://live.ahava528.com:8443/stat SCRIPT_NAME: /plugin/Live/stats.json.php [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::ERROR: Live::getStatsObject RTMP Server (http://live.ahava528.com:8443/stat) is OFFLINE, timeout=(4) we could not connect on it => live_servers_id = (0) SCRIPT_NAME: /plugin/Live/stats.json.php [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: Live::getStats(0) 1 SCRIPT_NAME: /plugin/Live/stats.json.php [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: Live::createStatsCache {"bytes":155,"cachefile":"\/var\/www\/html\/AVideo\/videos\/cache\/YPTObjectCache\/getstats\/getstatsnotifications\/live.ahava528.com\/https\/getStats\/getStatsNotificationsa34db68754d32b7a5dec7eddb7768b0d.cache"} SCRIPT_NAME: /plugin/Live/stats.json.php [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: Cache::isREQUESTURIWhitelisted: (plugin/Live/on) is whitelisted SCRIPT_NAME: /plugin/Live/on_play.php [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: NGINX ON Play POST: {"app":"live2","flashver":"LNX 9,0,124,2","swfurl":"","tcurl":"rtmp:\/\/178.162.220.42:1935\/live2","pageurl":"","addr":"178.162.220.42","clientid":"6975","call":"play","name":"60180f42a4efa","start":"4294965296","duration":"0","reset":"0","redirectUri":""} SCRIPT_NAME: /plugin/Live/on_play.php [24-Mar-2021 23:56:27 Asia/Jerusalem] AVideoLog::DEBUG: NGINX ON Play GET: [] SCRIPT_NAME: /plugin/Live/on_play.php [24-Mar-2021 23:56:55 Asia/Jerusalem] AVideoLog::DEBUG: Warning: Slow process detected [video::getAllVideos foreach] On Line 1223 takes 0.9443 seconds to complete, Limit (0.7). /var/www/html/AVideo/view/index.php SCRIPT_NAME: /view/index.php [24-Mar-2021 23:56:55 Asia/Jerusalem] AVideoLog::DEBUG: Resize JPG /var/www/html/AVideo/videos/_YPTuniqid_5fc9ebe54c4e32.10159249.jpg, /var/www/html/AVideo/videos/_YPTuniqid_5fc9ebe54c4e32.10159249_thumbsV2.jpg SCRIPT_NAME: /view/index.php [24-Mar-2021 23:56:55 Asia/Jerusalem] AVideoLog::DEBUG: im_resizeV3: /var/www/html/AVideo/videos/_YPTuniqid_5fc9ebe54c4e32.10159249.jpg, /var/www/html/AVideo/videos/_YPTuniqid_5fc9ebe54c4e32.10159249_thumbsV2.jpg, 640, 360 SCRIPT_NAME: /view/index.php [24-Mar-2021 23:56:56 Asia/Jerusalem] AVideoLog::DEBUG: Resize Small JPG /var/www/html/AVideo/videos/_YPTuniqid_5fc9ebe54c4e32.10159249.jpg, /var/www/html/AVideo/videos/_YPTuniqid_5fc9ebe54c4e32.10159249_thumbsSmallV2.jpg SCRIPT_NAME: /view/index.php [24-Mar-2021 23:56:56 Asia/Jerusalem] AVideoLog::DEBUG: im_resizeV3: /var/www/html/AVideo/videos/_YPTuniqid_5fc9ebe54c4e32.10159249.jpg, /var/www/html/AVideo/videos/_YPTuniqid_5fc9ebe54c4e32.10159249_thumbsSmallV2.jpg, 640, 360 SCRIPT_NAME: /view/index.php [24-Mar-2021 23:56:59 Asia/Jerusalem] AVideoLog::DEBUG: Bot Detected, NOT showing the cache (/program/18926/6/stopthecrime/5g_weapon/mark-steele-%F0%9F%93%B5-5g-is-not-for-control-its-for-something-else-watch-the-video-spread-the-word.-1) FROM: 54.36.148.7 Browser: Mozilla/5.0 (compatible; AhrefsBot/7.0; +http://ahrefs.com/robot/) SCRIPT_NAME: /view/index.php [24-Mar-2021 23:57:00 Asia/Jerusalem] AVideoLog::DEBUG: Warning: Slow process detected [video::getAllVideos foreach] On Line 1223 takes 0.9451 seconds to complete, Limit (0.7). /var/www/html/AVideo/view/index.php SCRIPT_NAME: /view/index.php [24-Mar-2021 23:57:00 Asia/Jerusalem] PHP Notice: Undefined variable: class in /var/www/html/AVideo/objects/functions.php on line 4915 [24-Mar-2021 23:57:01 Asia/Jerusalem] AVideoLog::DEBUG: Warning: Slow process detected [video::getAllVideos foreach] On Line 1223 takes 2.5469 seconds to complete, Limit (0.7). /var/www/html/AVideo/view/index.php SCRIPT_NAME: /view/index.php [24-Mar-2021 23:57:03

peterflitz commented 3 years ago

I am not sure but: guymass uses restreamer. For me the problem is with "Ad a Live Link" The problem of display / notification still exists here. ? Both external streaming

guymass commented 3 years ago

[25-Mar-2021 00:20:45 Asia/Jerusalem] AVideoLog::DEBUG: NGINX ON Publish parse_str: {"p":"73edeef8c4b2ff49611688e91bf2bb28"} SCRIPT_NAME: /plugin/Live/on_publish.php [25-Mar-2021 00:20:45 Asia/Jerusalem] AVideoLog::DEBUG: NGINX ON Publish check if key exists (60511597ca413-000742) SCRIPT_NAME: /plugin/Live/on_publish.php [25-Mar-2021 00:20:45 Asia/Jerusalem] AVideoLog::SECURITY: NGINX ON Publish error, Transmition name not found (60511597ca413-000742) SCRIPT_NAME: /plugin/Live/on_publish.php [25-Mar-2021 00:20:45 Asia/Jerusalem] AVideoLog::DEBUG: NGINX ON Publish deciding ... SCRIPT_NAME: /plugin/Live/on_publish.php [25-Mar-2021 00:20:45 Asia/Jerusalem] AVideoLog::SECURITY: NGINX ON Publish denied SCRIPT_NAME: /plugin/Live/on_publish.php [25-Mar-2021 00:20:53 Asia/Jerusalem] AVideoLog::DEBUG: CustomizeUser::canShareVideosFromVideo canShareVideosFromUser() = false SCRIPT_NAME: /plugin/Live/index.php [25-Mar-2021 00:20:53 Asia/Jerusalem] AVideoLog::DEBUG: isLiveFromKey: SCRIPT_NAME: /plugin/Live/index.php [25-Mar-2021 00:20:53 Asia/Jerusalem] AVideoLog::DEBUG: m3u8: https://live.ahava528.com:8443/live/60180f42a4efa.m3u8 SCRIPT_NAME: /plugin/Live/index.php [25-Mar-2021 00:20:53 Asia/Jerusalem] AVideoLog::DEBUG: is200: 1 SCRIPT_NAME: /plugin/Live/index.php [25-Mar-2021 00:20:53 Asia/Jerusalem] AVideoLog::DEBUG: Live::deleteStatsCache [/var/www/html/AVideo/videos/cache/YPTObjectCache/getstats/] SCRIPT_NAME: /plugin/Live/index.php

guymass commented 3 years ago

My Adaptive nginx conf: rtmp { access_log /var/log/nginx/rtmp_access.log; server { listen 178.162.xxx.xxx:1935; chunk_size 4000;

creates our "live" full-resolution HLS videostream from our incomi>

                application live2 {
                        allow play all;
                        live on; #

           interleave off;
           meta on;
           wait_key on;
           wait_video on;
        idle_streams off;
        sync 300ms;
        session_relay on;
        allow publish all;
        allow play all;
        max_connections 1000;

            ## == DASH == ##
            dash off;
            # dash_nested on;
            # dash_path /var/livestream/dash;
            # dash_fragment 10s;
            # dash_playlist_length 60s;
            # dash_cleanup on;

on_publish http://live.ahava528.com/plugin/Live/on_publish.php;

guy added on_publish_done

on_publish_done http://live.ahava528.com/plugin/Live/on_publish_done.php;

on_play http://live.ahava528.com/plugin/Live/on_play.php;
on_record_done http://live.ahava528.com/plugin/Live/on_record_done.php;
    #ADAPTATIVE MODE
                        exec ffmpeg -i rtmp://178.162.xxx.xxx/live2/$name 
                            -c:a aac -strict -2 -b:a 128k -c:v libx264 -vf scale=-2:240 -g 48 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 400k -maxrate 700k -bufsize 1200k -b:a 96k -r 20 -f hls -hls_time 6 -hls_list_size 0 -f flv rtmp://178.162.xxx.xxx/adaptive/$name_low  
                            -c:a aac -strict -2 -b:a 128k -c:v libx264 -vf scale=-2:480 -g 48 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 1200k -maxrate 2100k -bufsize 2400k -b:a 128k -f hls -hls_time 6 -hls_list_size 0 -f flv rtmp://178.162.xxx.xxx/adaptive/$name_mid  
                            -c:a aac -strict -2 -b:a 128k -c:v libx264 -vf scale=-2:720 -g 48 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 2400k -maxrate 4200k -bufsize 100000k -b:a 128k -f hls -hls_time 6 -hls_list_size 0 -f flv rtmp://178.162.xxx.xxx/adaptive/$name_hi;

                       recorder video{
                            record all;
                            record_path /var/www/tmp;
                            record_notify on;
                            record_max_size 2048M;
                            record_suffix -%d-%b-%y-%T.flv;
                        }
                }

            #ADAPTATIVE MODE
            application adaptive {
                live on;
                hls on;
                hls_type live; 
                #hls_fragment_naming system;
                hls_nested on;
                hls_path /HLS/ahava;
                hls_playlist_length 15m;
                hls_fragment 4s;

                # Guy adding configurations for tests
                hls_sync 100ms;
                hls_cleanup on;

                allow play all;
                allow publish 178.162.xxx.xxx;
                deny publish all;

                hls_variant _low BANDWIDTH=400000;
                hls_variant _mid BANDWIDTH=2100000;
                hls_variant _hi  BANDWIDTH=4200000;
            }
        }
}
guymass commented 3 years ago

My server block:

server { listen 178.162.xxx.xxx:8444; server_name live.ahava528.com;
client_max_body_size 2048M; location /live { add_header 'Cache-Control' 'no-cache'; add_header 'Access-Control-Allow-Origin' '' always; add_header 'Access-Control-Expose-Headers' 'Content-Length'; if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin' ''; add_header 'Access-Control-Max-Age' 1728000; add_header 'Content-Type' 'text/plain charset=UTF-8'; add_header 'Content-Length' 0; return 204; } types { application/vnd.apple.mpegurl m3u8; } alias /HLS/ahava; } location /stat { rtmp_stat all; rtmp_stat_stylesheet stat.xsl; } location /stat.xsl { root /var/www/html; } location /control { rtmp_control all; }
location / { root html; index index.html index.htm; } location ~ .php$ { include /etc/nginx/snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.4-fpm.sock;
} } server { listen 178.162.xxx.xxx:8443 ssl; ssl_certificate /etc/letsencrypt/live/live.ahava528.com/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/live.ahava528.com/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # server_name live.ahava528.com;
client_max_body_size 2048M; location /live { add_header 'Cache-Control' 'no-cache'; add_header 'Access-Control-Allow-Origin' '' always; add_header 'Access-Control-Expose-Headers' 'Content-Length'; if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin' ''; add_header 'Access-Control-Max-Age' 1728000; add_header 'Content-Type' 'text/plain charset=UTF-8'; add_header 'Content-Length' 0; return 204; } types { application/vnd.apple.mpegurl m3u8; } alias /HLS/ahava; } location /stat { rtmp_stat all; rtmp_stat_stylesheet stat.xsl; } location /stat.xsl { root /var/www/html; } location /control { rtmp_control all; }
location / { root html; index index.html index.htm; } location ~ .php$ { include /etc/nginx/snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.4-fpm.sock;
} }

guymass commented 3 years ago

My plugin config:

Screen Shot 5781-07-12 at 0 30 53

Screen Shot 5781-07-12 at 0 30 47

guymass commented 3 years ago

Would Network Encoder have any effect on this issues? I am rally lost here, tried everything.

DanielnetoDotCom commented 3 years ago

@guymass the only problem I can see is that your streamer cannot see the http://live.ahava528.com:8443/stat

Try to make a wget http://live.ahava528.com:8443/stat

If works it is something in your PHP configuration.

guymass commented 3 years ago

I can wget http://live.ahava528.com:8444/stat however the page wont open, but I can open the page on port 8443 however wget http://live.ahava528.com:8443/stat will not work, strange ha!

guymass commented 3 years ago

I see this when I was searching for some video, I suddenly showed me all those live stream tests and they are all set to the default category. Its like it still remembers them, idk.

Screen Shot 5781-07-12 at 20 57 24

guymass commented 3 years ago

wget works! still not live!

Screen Shot 5781-07-12 at 22 20 29

DanielnetoDotCom commented 3 years ago

Look at this ...

I run this code on my local computer and I could get your stats.

<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
echo htmlentities(file_get_contents('http://live.ahava528.com:8444/stat'));
?>

Create a .php file in your server and run it, check if it return the XML

image

guymass commented 3 years ago

OK I found my problem with this, I have http running on port 8444 and because I set the url to https it wasn't working. Well now I set it properly and this work now on port 8444 however I still don't get live. It was showing it for 5 seconds and than it flipped back to OFFLINE status.

I see this message repeating. [26-Mar-2021 15:54:57 Asia/Jerusalem] AVideoLog::DEBUG: Warning: Slow process detected [video::getAllVideos foreach] On Line 1223 takes 0.8837 seconds to complete, Limit (0.7). /var/www/html/AVideo/view/channel.php SCRIPT_NAME: /view/channel.php

And This:

[26-Mar-2021 15:53:56 Asia/Jerusalem] AVideoLog::ERROR: sendSocketMessage SCRIPT_NAME: /plugin/Live/on_publish_done.php [26-Mar-2021 15:53:56 Asia/Jerusalem] AVideoLog::DEBUG: NGINX Live::on_publish_socket_notification SocketMessageToAll END SCRIPT_NAME: /plugin/Live/on_publish_done.php

DanielnetoDotCom commented 3 years ago

Hi,

I just sent some updates for the live cache, can you please check?

guymass commented 3 years ago

[27-Mar-2021 02:07:21 Asia/Jerusalem] AVideoLog::ERROR: sendSocketMessage SCRIPT_NAME: /var/www/html/AVideo/plugin/Live/on_publish_socket_notification.php [27-Mar-2021 02:07:21 Asia/Jerusalem] AVideoLog::DEBUG: NGINX Live::on_publish_socket_notification SocketMessageToAll END SCRIPT_NAME: /var/www/html/AVideo/plugin/Live/on_publish_socket_notification.php [27-Mar-2021 02:07:21 Asia/Jerusalem] AVideoLog::DEBUG: NGINX Live::on_publish_socket_notification end SCRIPT_NAME: /var/www/html/AVideo/plugin/Live/on_publish_socket_notification.php [27-Mar-2021 02:07:21 Asia/Jerusalem] PHP Notice: Undefined property: stdClass::$autoEvalCodeOnHTML in /var/www/html/AVideo/plugin/YPTSocket/Message.php on line 59

guymass commented 3 years ago

We are going to test separating the RTMP to its own server, only installing the encoder. We want to point all streaming to it from all sites. Any suggestions? We hope this will take some stress off the main site allowing it to only deal with serving the video for viewing while the other server will deal with live streams. What do you think?

DanielnetoDotCom commented 3 years ago

your socket server seems like is running, but is it connecting?

are you still not getting notifications right?

guymass commented 3 years ago

Yes it seems to be working fine but I still don't see those notifications. Screen Shot 5781-07-15 at 0 52 30

guymass commented 3 years ago

Now I cannot even see my stream but when I stop streaming it will still create the file. I see this on log:

Live::get_data(http://live.ahava528.com:8444/stat, 4) function: _error_log_debug Line: {684} File: {/var/www/html/AVideo/plugin/Live/Live.php} function: get_data Line: {650} File: {/var/www/html/AVideo/plugin/Live/Live.php} function: getStatsObject Line: {1079} File: {/var/www/html/AVideo/plugin/Live/Live.php} function: _getStats Line: {882} File: {/var/www/html/AVideo/plugin/Live/Live.php} function: getStats Line: {1375} File: {/var/www/html/AVideo/plugin/Live/Live.php} function: isKeyLiveInStats Line: {1464} File: {/var/www/html/AVideo/plugin/Live/Live.php} function: isLiveAndIsReadyFromKey Line: {37} File: {/var/www/html/AVideo/plugin/Live/on_publish_socket_notification.php} *** SCRIPT_NAME: /var/www/html/AVideo/plugin/Live/on_publish_socket_notification.php [28-Mar-2021 00:58:55 Asia/Jerusalem] AVideoLog::DEBUG: Live::isLiveFromKey 60180f42a4efa-220739 JSON was not empty SCRIPT_NAME: /var/www/html/AVideo/plugin/Live/on_publish_socket_notification.php [28-Mar-2021 00:58:55 Asia/Jerusalem] AVideoLog::DEBUG: Live::isLiveFromKey is NOT online [60180f42a4efa-220739] SCRIPT_NAME: /var/www/html/AVideo/plugin/Live/on_publish_socket_notification.php [28-Mar-2021 00:58:55 Asia/Jerusalem] AVideoLog::DEBUG: isLiveAndIsReadyFromKey the key 60180f42a4efa-220739 is not present on the stats SCRIPT_NAME: /var/www/html/AVideo/plugin/Live/on_publish_socket_notification.php [28-Mar-2021 00:58:55 Asia/Jerusalem] AVideoLog::DEBUG: live is not ready [11] request again in 5 seconds (https://live.ahava528.com:8443/live/60180f42a4efa-220739.m3u8) SCRIPT_NAME: /var/www/html/AVideo/plugin/Live/on_publish_socket_notification.php [28-Mar-2021 00:58:55 Asia/Jerusalem] PHP Notice: Undefined property: stdClass::$autoEvalCodeOnHTML in /var/www/html/AVideo/plugin/YPTSocket/Message.php on line 59 [28-Mar-2021 00:59:00 Asia/Jerusalem] AVideoLog::DEBUG: Live::getStatsObject[0] 5: forced to be recreated SCRIPT_NAME: /var/www/html/AVideo/plugin/Live/on_publish_socket_notification.php [28-Mar-2021 00:59:00 Asia/Jerusalem] AVideoLog::DEBUG: Live::getStatsObject[0]: Creating a waitfile /var/www/html/AVideo/videos/cache/a84fdc425fca22fe1f87e4a7a8db29b9 SCRIPT_NAME: /var/www/html/AVideo/plugin/Live/on_publish_socket_notification.php [28-Mar-2021 00:59:00 Asia/Jerusalem] AVideoLog::DEBUG: