WWBN / AVideo

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

Send record to encoder.... #8998

Closed milehighkaraoke closed 5 months ago

milehighkaraoke commented 5 months ago

Brand new install, Followed each step in send live recorded to encder. My lives are not being encoded. Everything else works perfectly now, live stream, ypt socket and nqinx.... @DanielnetoDotCom

milehighkaraoke commented 5 months ago

My manual uploads encode perfectly

DanielnetoDotCom commented 5 months ago

share your nginx.conf here

verticalhost commented 5 months ago

Brand new install, Followed each step in send live recorded to encder. My lives are not being encoded. Everything else works perfectly now, live stream, ypt socket and nqinx.... @DanielnetoDotCom

Can you try uploading simple video for fun just to see if you are able to read it ?

milehighkaraoke commented 5 months ago

@verticalhost yes regular upload works

milehighkaraoke commented 5 months ago

@DanielnetoDotCom user www-data;
worker_processes 1; error_log logs/error.log debug; events { worker_connections 1024; } rtmp { server { listen 1935; ping 5m; ping_timeout 4m;

Use case option (max_streams; default is 32 )

                #max_streams 10;
                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;
                        hls on;
                        hls_nested on;
                        hls_path /HLS/live;
                        hls_playlist_length 60m;
                        hls_fragment 3s;
                        drop_idle_publisher 30s;
                        sync 500ms;
                        #Experimental. Force dropped stream, or ended stream from being watched. (idle_streams)
                        #idle_streams off;
                        on_publish http://10.10.10.200/plugin/Live/on_publish.php;
                        on_publish_done http://10.10.10.200/plugin/Live/on_publish_done.php;
                        on_play http://10.10.10.200/plugin/Live/on_play.php;
                        on_record_done http://10.10.10.200/plugin/Live/on_record_done.php;

                        #exec ffmpeg -re -i rtmp://localhost/live/$name -c:v libx264 -preset veryfast -c:a copy -f hls -hls_time 5 -hls_list_size 0 -f flv rtmp://localhost/adaptive/$name_hi;
                        #exec ffmpeg -re -i rtmp://localhost/live/$name 
                        #    -c:v libx264 -vf scale=-2:240 -r 20 -g 40 -keyint_min 40 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 400k -maxrate 700k -bufsize 1400k -c:a aac -strict -2 -b:a 96k -f flv rtmp://localhost/adaptive/$name_low  
                        #    -c:v libx264 -vf scale=-2:480 -r 30 -g 60 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 1200k -maxrate 2100k -bufsize 4200k -c:a aac -strict -2 -b:a 128k -f flv rtmp://localhost/adaptive/$name_mid  
                        #    -c:v libx264 -vf scale=-2:720 -r 30 -g 60 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 2400k -maxrate 3000k -bufsize 6000k -c:a aac -strict -2 -b:a 128k -f flv rtmp://localhost/adaptive/$name_hi;

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

                        ### Record Audio Separately ( For podcast )
                        #recorder audio {
                        #    record audio;
                        #    record_path /var/www/tmp;
                        #    record_max_size 1024M;
                        #    record_suffix -%d-%b-%y-%T.mp3;
                        #}
                }

                #application adaptive {
                #    live on; 
                #    hls on; 
                #    hls_fragment 2s;
                #    hls_path /HLS/live;
                #    hls_nested on;
                #    hls_playlist_length 10m;
                #    allow play all;
                #    allow publish 127.0.0.1;
                #    deny publish all;

                #    hls_variant _hi BANDWIDTH=264000,RESOLUTION=1280x720; # this is for line 34 only, do not uncomment it
                #    hls_variant _low BANDWIDTH=900000;
                #    hls_variant _mid BANDWIDTH=2400000;
                #    hls_variant _hi  BANDWIDTH=3500000;
                #}
        }
}
http {
        include       mime.types;
        default_type  application/octet-stream;
        server {
                listen 8443 ssl;
                listen [::]:8443 ssl;
                ssl_certificate /etc/letsencrypt/live/mhktube.com/fullchain.pem;
                ssl_certificate_key /etc/letsencrypt/live/mhktube.com/privkey.pem;
                listen 8080;
                server_name localhost;
                #creates the http-location for our full-resolution (desktop) HLS stream - "http://my-ip/live/my-stream-key/index.m3u8"      
                location /live {
                        expires 60;
                        add_header 'Cache-Control' 'public';

                        location ~ \.m3u8$ {
                            expires -1;
                            # 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';
                        }

                        # 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 {
                        # replace this with the IP of your AVideo site
                        allow 10.10.10.200;
                        deny all;
                        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;
                }   

                #location ~ \.php$ {
                #       include /etc/nginx/snippets/fastcgi-php.conf;
                #       fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
                #}

        }
milehighkaraoke commented 5 months ago

Any ideas @DanielnetoDotCom

DanielnetoDotCom commented 5 months ago

Check if there are videos here

/var/www/tmp

check the avideo logs and the nginx logs when you start and when you finish a livestream

milehighkaraoke commented 5 months ago

there is one .flv in the /var/www/tmp the videos do post in the encoder and they do show as encoding and then completed as i would expect. the videos just never appear in recent videos or my videos. I am guessing it has already deleted encoded videos. i have one error from tonight's broadcast although i had absolutely no live stream broadcasting issues, live users and everything worked as expected except the DVR [19-Apr-2024 20:42:40 America/Denver] AVideoLog::SECURITY: NGINX ON Publish denied {"error":true,"liveTransmitionHistory_id":0} SCRIPT_NAME: /plugin/Live/on_publish.php this error seems like it would cause live not to broadcast but i did not see any issues

DanielnetoDotCom commented 5 months ago

if you are not publishing your error is not on the send recorder, it is your nginx,conf

please make clear what is your error

milehighkaraoke commented 5 months ago

nginx logs are empty with only a bind error from when i started the already running server

milehighkaraoke commented 5 months ago

i gave you the config did you see anything wrong

                    #exec ffmpeg -re -i rtmp://localhost/live/$name -c:v libx264 -preset veryfast -c:a copy -f hls -hls_time 5 -hls_list_size 0 -f flv rtmp://localhost/adaptive/$name_hi;
                    #exec ffmpeg -re -i rtmp://localhost/live/$name 
                    #    -c:v libx264 -vf scale=-2:240 -r 20 -g 40 -keyint_min 40 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 400k -maxrate 700k -bufsize 1400k -c:a aac -strict -2 -b:a 96k -f flv rtmp://localhost/adaptive/$name_low  
                    #    -c:v libx264 -vf scale=-2:480 -r 30 -g 60 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 1200k -maxrate 2100k -bufsize 4200k -c:a aac -strict -2 -b:a 128k -f flv rtmp://localhost/adaptive/$name_mid  
                    #    -c:v libx264 -vf scale=-2:720 -r 30 -g 60 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 2400k -maxrate 3000k -bufsize 6000k -c:a aac -strict -2 -b:a 128k -f flv rtmp://localhost/adaptive/$name_hi;

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

                    ### Record Audio Separately ( For podcast )
                    #recorder audio {
                    #    record audio;
                    #    record_path /var/www/tmp;
                    #    record_max_size 1024M;
                    #    record_suffix -%d-%b-%y-%T.mp3;
                    #}
            }

            #application adaptive {
            #    live on; 
            #    hls on; 
            #    hls_fragment 2s;
            #    hls_path /HLS/live;
            #    hls_nested on;
            #    hls_playlist_length 10m;
            #    allow play all;
            #    allow publish 127.0.0.1;
            #    deny publish all;

            #    hls_variant _hi BANDWIDTH=264000,RESOLUTION=1280x720; # this is for line 34 only, do not uncomment it
            #    hls_variant _low BANDWIDTH=900000;
            #    hls_variant _mid BANDWIDTH=2400000;
            #    hls_variant _hi  BANDWIDTH=3500000;
            #}
    }

} http { include mime.types; default_type application/octet-stream; server { listen 8443 ssl; listen [::]:8443 ssl; ssl_certificate /etc/letsencrypt/live/mhktube.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/mhktube.com/privkey.pem; listen 8080; server_name localhost;

creates the http-location for our full-resolution (desktop) HLS stream - "http://my-ip/live/my-stream-key/index.m3u8"

            location /live {
                    expires 60;
                    add_header 'Cache-Control' 'public';

                    location ~ \.m3u8$ {
                        expires -1;
                        # 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';
                    }

                    # 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 {
                    # replace this with the IP of your AVideo site
                    allow 10.10.10.200;
                    deny all;
                    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;
            }   

            #location ~ \.php$ {
            #       include /etc/nginx/snippets/fastcgi-php.conf;
            #       fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
            #}

    }
DanielnetoDotCom commented 5 months ago

you need to check your avideo and nginx logs, provide more info, not just one line of the log

milehighkaraoke commented 5 months ago

log AVideo.odt

milehighkaraoke commented 5 months ago

encoder log.odt

milehighkaraoke commented 5 months ago

tried live and nginx gives this nginx log.odt

milehighkaraoke commented 5 months ago

hopefully that helps... i also deleted that single .flv in the temp and no new tmp file was made from the last live test @DanielnetoDotCom

milehighkaraoke commented 5 months ago

the live videos are never making it to the encoder..... @DanielnetoDotCom i watched encoder after live and there was noting in que

milehighkaraoke commented 5 months ago

@DanielnetoDotCom I have to get this back up and functioning by tonight. What is the verdict I gave you every log available. My people are getting ready to drop my platform and that would be devastating

milehighkaraoke commented 5 months ago

I paid extra for send live to encoder plug in so I do expect a level of professionalism with working solutions as a resolution.

DanielnetoDotCom commented 5 months ago

I paid extra for send live to encoder plug in so I do expect a level of professionalism with working solutions as a resolution.

the plugin requires some knowledge to configure, I always do my best to help you, but I cannot teach or guarantee you will be able to configure by yourself

DanielnetoDotCom commented 5 months ago

I can see this

2024/04/19 00:52:03 [info] 3775#0: *58 notify: record_done recorder=video path='/var/www/tmp/66220b4c1f0c7.flv' url='10.10.10.200/plugin/Live/on_record_done.php', client: 10.10.10.244, server: 0.0.0.0:1935

but in your avideo.log there is no record of the on_record_done

even if you do not download the file, there must be some record in the avideo.log

so I suspect your nginx could never reach the 10.10.10.200/plugin/Live/on_record_done.php

  1. check your apache access.log
  2. from your live server try this
curl -i http://10.10.10.200/plugin/Live/on_record_done.php
milehighkaraoke commented 5 months ago

20240422_170638

milehighkaraoke commented 5 months ago

This plug in has been configured by me 3 years now and I never had this issue

milehighkaraoke commented 5 months ago

It serves both of us positively if we can come up with a solution to this.Because I am not the only one who is suffering from this. If I see this issue and I know the answer I can help the person fix it rather than them bothering you and let you deal with the real code.

DanielnetoDotCom commented 5 months ago

image

milehighkaraoke commented 5 months ago

Empty 20240422_173529

DanielnetoDotCom commented 5 months ago

Sorry even more weird, no access logs on apache?

sorry, but I have no clue what you did wrong

milehighkaraoke commented 5 months ago

here is the apache.site log apache.mhktubelog.odt

milehighkaraoke commented 5 months ago

Anything worthwhile in that Apache log?

DanielnetoDotCom commented 5 months ago

I fount the issue but I do not knwo what you have done

2024/04/22 06:56:03 [error] 4247#0: *18 access forbidden by rule, client: 127.0.0.1, server: localhost, request: "GET /control/record/start?app=live&name=66220b4c1f0c7&rec=video HTTP/1.1", host: "localhost:8080"
2024/04/22 06:56:08 [error] 4247#0: *19 access forbidden by rule, client: 127.0.0.1, server: localhost, request: "GET /control/record/start?app=live&name=66220b4c1f0c7&rec=video HTTP/1.1", host: "localhost:8080"

access forbidden by rule

I am not sure what rule is that, but you could not start the live-stream

alternatively you can force to record all lives by default

in your nginx.conf remove the manual from the line ´record all manual;´

will be like below

                recorder video {
                    record all;
                    record_path /var/www/tmp;
                    record_notify on;
                    record_max_size 4048M; 
                   # record_suffix -%d-%b-%y-%T.flv;
                }
milehighkaraoke commented 5 months ago

The fix!!!!! Wipe disc clean. Reinstall all code in root from Sudo -I