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

Send Recording To Encoder #2577

Closed gabeq123 closed 4 years ago

gabeq123 commented 4 years ago

After the last update and reinstalling the plug-in, my live videos are no longer saved. If using the mobile app video is not even streamed, only audio. Using OBS and other software from the PC does result in both audio and video, but the stream is not saved. This did work with no issues before updating the site

DanielnetoDotCom commented 4 years ago

please check your log file.

gabeq123 commented 4 years ago

where is it located? I will grab it and paste here

akhilleusuggo commented 4 years ago

/var/www/html/YouPHPTube/videos/avideo.log ( for streaming server ) /var/www/html/YouPHPTube-Encoder/videos/avideo.log ( Encoder server )

gabeq123 commented 4 years ago

No such file or directory

akhilleusuggo commented 4 years ago

1-cd /var/www/html 2- ls 3-cd ( put the name of the folder of your streamer site ) , maybe yours is AVideo 4- go to videos directory , you should find avideo.log you can cat -n avideo.log

gabeq123 commented 4 years ago

Here is the last few entry lines..

[20-Dec-2019 13:58:47 America/Denver] Bot stopped [20-Dec-2019 14:02:57 America/Denver] Bot Detected, NOT showing the cache (/cat/default/video/the-angry-birds-movie-2-2019-fullmovie-sub-eng?catName=default) FROM: 46.229.168.147 Browser: Mozilla/5.0 (compatible; SemrushBot/6~bl; +http://www.semrush.com/bot.html) [20-Dec-2019 14:02:57 America/Denver] Bot stopped [20-Dec-2019 14:17:38 America/Denver] Bot Detected, NOT showing the cache (/) FROM: 157.55.39.208 Browser: Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm) [20-Dec-2019 14:17:38 America/Denver] Bot stopped [21-Dec-2019 07:15:17 America/Denver] PHP Warning: mysqli::__construct(): (HY000/2002): No such file or directory in /var/www/html/YouPHPTube/objects/include_config.php on line 6 [21-Dec-2019 07:15:17 America/Denver] ERROR: your site is offline

DanielnetoDotCom commented 4 years ago
[21-Dec-2019 07:15:17 America/Denver] PHP Warning: mysqli::__construct(): (HY000/2002): No such file or directory in /var/www/html/YouPHPTube/objects/include_config.php on line 6
[21-Dec-2019 07:15:17 America/Denver] ERROR: your site is offline

here is clear your MySQL is gone.

check your mysql server.

gabeq123 commented 4 years ago

Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 39049 Server version: 5.7.26-0ubuntu0.18.04.1 (Ubuntu)

gabeq123 commented 4 years ago

Everything seems to work except the live stream being sent to encoder. I just use the embed link option and it shows up.

DanielnetoDotCom commented 4 years ago

Can you please show here how your nginx.conf looks like?

also check your log files from nginx and from streamer

gabeq123 commented 4 years ago
worker_processes  1;
error_log  logs/error.log debug;
events {
        worker_connections  1024;
}
rtmp {
        server {
                listen 1935;
                allow play all;
                #creates our "live" full-resolution HLS videostream from our incoming encoder stream and tells where to put the HLS video manifest and video fragments
                application live {
                        allow play all;
                        live on;
                        #record all;
                        #record_path /video_recordings;
                        #record_unique on;
                        hls on;
                        hls_nested on;
                        hls_path /HLS/live;
                        #hls_playlist_length 4s;
                        #hls_fragment 1s;
                        hls_fragment 10s;
                        on_publish http://localhost/YouPHPTube/plugin/Live/on_publish.php;
                        on_play http://localhost/YouPHPTube/plugin/Live/on_play.php;
                        on_record_done http://localhost/YouPHPTube/plugin/Live/on_record_done.php;
                }
        }
}
http {
        include       mime.types;
        default_type  application/octet-stream;
        server {
                listen 8080;
                server_name localhost www.klcsabq1.com  klcsabq1.com;
                #creates the http-location for our full-resolution (desktop) HLS stream - "http://my-ip/live/my-stream-key/index.m3u8"      
                location /live {
                        # Disable cache
                        add_header 'Cache-Control' 'no-cache';

                        # CORS setup
                        add_header 'Access-Control-Allow-Origin' '*' always;
                        add_header 'Access-Control-Expose-Headers' 'Content-Length';

                        # allow CORS preflight requests
                        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/live;
                }
                #allows us to see how stats on viewers on our Nginx site using a URL like: "http://my-ip/stats"     
                #location /stats {
                #        stub_status;
                #}
                location /stat {
                        rtmp_stat all;
                        rtmp_stat_stylesheet stat.xsl;
                }
                location /stat.xsl {
                        root html;
                }
                location /control {
                        rtmp_control all;
                }
                #allows us to host some webpages which can show our videos: "http://my-ip/my-page.html"     
                location / {
                        root   html;
                        index  index.html index.htm;
                }   

listen 444 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/klcsabq1.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/klcsabq1.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

} }

DanielnetoDotCom commented 4 years ago

Ok, I can see you do not have the correct configuration in this file. you are missing the recorder video parameter

please make sure you follow this https://github.com/WWBN/AVideo/wiki/Record-Live-Stream

gabeq123 commented 4 years ago

Does anything have to be modified? ....

recorder video{ record all; record_path /var/www/tmp; record_notify on; record_max_size 2048M;

will produce files of the form yourUserKey-24-Apr-13-18:23:38.flv

record_suffix -%d-%b-%y-%T.flv;

}

DanielnetoDotCom commented 4 years ago

If you have the directory /var/www/tmp and it has write permission, you are fine, just copy and paste

gabeq123 commented 4 years ago

the directory does exit, I brought the file over, did a live video from the mobile app now the site is just spinning, nothing will load.

DanielnetoDotCom commented 4 years ago

check errors when you restart nginx.

probably you have a sintax error in your nginx.conf file.

if is all fine on nginx, try to connect from the PC first. (I use OBS for myself)

gabeq123 commented 4 years ago

I will reboot the server then try your instructions. I will post an update later this afternoon

gabeq123 commented 4 years ago

https://klcsabq1.com/Encoder/getImage/aHR0cHM6Ly9rbGNzYWJxMS5jb206NDQ0L2xpdmUvNWUzMWUxMmUxZTE3OC9pbmRleC5tM3U4/jpg [06-Feb-2020 12:50:28 America/Denver] Live:getImage Cached Good until 06/02/2020 12:52:18 NOW is 06/02/2020 12:50:28 [06-Feb-2020 12:50:33 America/Denver] PHP Fatal error: Uncaught RuntimeException: Failed to listen on "tcp://0.0.0.0:8888": Address already in use in /var/www/html/YouPHPTube/plugin/LiveChat/ratchet/react/socket/src/TcpServer.php:164 Stack trace:

0 /var/www/html/YouPHPTube/plugin/LiveChat/ratchet/react/socket/src/Server.php(31): React\Socket\TcpServer->__construct('tcp://0.0.0.0:8...', Object(React\EventLoop\StreamSelectLoop), Array)

1 /var/www/html/YouPHPTube/plugin/LiveChat/ratchet/cboden/ratchet/src/Ratchet/Server/IoServer.php(59): React\Socket\Server->__construct('0.0.0.0:8888', Object(React\EventLoop\StreamSelectLoop))

2 /var/www/html/YouPHPTube/plugin/LiveChat/chat-server.php(20): Ratchet\Server\IoServer::factory(Object(Ratchet\Http\HttpServer), '8888')

3 {main}

thrown in /var/www/html/YouPHPTube/plugin/LiveChat/ratchet/react/socket/src/TcpServer.php on line 164 [06-Feb-2020 12:50:34 America/Denver] Live:getImage start [06-Feb-2020 12:50:34 America/Denver] Live:getImage https://klcsabq1.com/Encoder/getImage/aHR0cHM6Ly9rbGNzYWJxMS5jb206NDQ0L2xpdmUvNWUzMWUxMmUxZTE3OC9pbmRleC5tM3U4/jpg [06-Feb-2020 12:50:34 America/Denver] Live:getImage Cached Good until 06/02/2020 12:52:18 NOW is 06/02/2020 12:50:34 [06-Feb-2020 12:50:34 America/Denver] Live:getImage start [06-Feb-2020 12:50:34 America/Denver] Live:getImage https://klcsabq1.com/Encoder/getImage/aHR0cHM6Ly9rbGNzYWJxMS5jb206NDQ0L2xpdmUvNWUzMWUxMmUxZTE3OC9pbmRleC5tM3U4/gif [06-Feb-2020 12:50:34 America/Denver] Live:getImage Cached Good until 06/02/2020 12:52:19 NOW is 06/02/2020 12:50:34 [06-Feb-2020 12:50:39 America/Denver] PHP Notice: Undefined index: HTTP_USER_AGENT in /var/www/html/YouPHPTube/plugin/Cache/Cache.php on line 71 [06-Feb-2020 12:50:39 America/Denver] Bot Detected, NOT showing the cache (/plugin/Live/stats.json.php) FROM: 127.0.0.1 Browser:

DanielnetoDotCom commented 4 years ago

Please check the nginx log file.

I guess your nginx.conf is wrong after you change it.