WWBN / AVideo

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

hlsplugin rejecting obs #8339

Open skittles-fivem opened 1 year ago

skittles-fivem commented 1 year ago

Describe the bug after installing hlsplugin all keys and streams gets rejected not sure if i missed something tried at least 3 times along with rollbacks to see if it would happen again before posting this To Reproduce Steps to reproduce the behavior: upload and install videohls turn on adaptive rate on live plugin turn on hls plugin update /usr/local/nginx/conf/nginx.conf from https://github.com/WWBN/AVideo/wiki/Adaptive-Bitrates-on-Livestream restart whole system obs rejects all keys for everyone but sees accepted attempts

Error Logs

aa

Screenshots

Capture

Desktop (please complete the following information):

CONF FILE user www-data;
worker_processes 1; error_log logs/error.log debug; events { worker_connections 1024; } rtmp { server { listen 1935; chunk_size 4000; application live { live on; on_publish http://localhost/avideo/plugin/Live/on_publish.php; on_publish_done http://localhost/avideo/plugin/Live/on_publish_done.php; on_play http://localhost/avideo/plugin/Live/on_play.php; on_record_done http://localhost/avideo/plugin/Live/on_record_done.php; exec ffmpeg -i rtmp://localhost/live/$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 flv rtmp://localhost/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 flv rtmp://localhost/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 flv rtmp://localhost/adaptive/$name_hi; }

            application adaptive {
                live on; 
                hls on; 

                hls_path /HLS/live;
                hls_nested on;

                allow play all;
                allow publish 127.0.0.1;
                deny publish all;

                hls_variant _low BANDWIDTH=400000;
                hls_variant _mid BANDWIDTH=2100000;
                hls_variant _hi  BANDWIDTH=4200000;
            }
    }
}
http {
        include       mime.types;
        default_type  application/octet-stream;
        server {
                #listen 8443 ssl;
                #listen [::]:8443 ssl;
                #include /usr/local/nginx/snippets/self-signed.conf;
                #include /usr/local/nginx/snippets/ssl-params.conf;
                listen 8080;
                server_name localhost skittles.live www.skittles.live;
                #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 127.0.0.1;
                        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;
                #}

listen 8443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/skittles.live/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/skittles.live/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 1 year ago

Thank you for the detailed description of the issue you're facing. Let me clarify a few things:

  1. VideoHLS Plugin: The VideoHLS plugin is designed specifically for Video On Demand (VOD) and not for live streaming. Therefore, the issues you're facing with the live stream are not directly related to the HLS plugin installation.

  2. Error Logs: From the screenshot of the error logs you shared, it seems the issue is related to the socket. To resolve this, please ensure you have installed the php-zip and php-sqlite3 extensions. You can typically install these with:

    sudo apt-get install php-zip php-sqlite3

    After installing, restart your web server for the changes to take effect and restart the socket.

  3. Live Streaming: For adaptive live streaming, make sure you have selected the "Adaptive mode" option in the Live plugin parameters. This is crucial for the adaptive bitrate streaming to work correctly.

image

skittles-fivem commented 1 year ago

for #2 i have zip and sqlite3 installed but it never sees it and i think this is rolled all the way back when you first installed it

bonmk
skittles-fivem commented 1 year ago

got the phpzip installed it was looking for php8.1-zip instead of php-zip

DanielnetoDotCom commented 1 year ago

but is it working now?

skittles-fivem commented 1 year ago

Yes but I took off the adaptive live and since the update the YouTube downloader just says permission denied from writing to cache but I’ll get by for awhile

DanielnetoDotCom commented 1 year ago

I'm sorry for any confusion, but I'm not sure how the adaptive live relates to the YouTube downloader issue. As far as I understand, they are separate functionalities and shouldn't impact each other.

skittles-fivem commented 1 year ago

I'm sorry for any confusion, but I'm not sure how the adaptive live relates to the YouTube downloader issue. As far as I understand, they are separate functionalities and shouldn't impact each other.

i meant update the whole site the hls works fine for encoder i only updated since it was a 6 versions old from 2022 and now i get this

hls
DanielnetoDotCom commented 1 year ago

you need to check if the folder /var/www/.cache exists.

  1. Checking if the folder exists:

    ls /var/www/.cache

    If you receive an error saying the directory doesn't exist, you'll need to create it.

  2. Creating the folder:

    mkdir /var/www/.cache

After the directory is in place, it's crucial to set the correct permissions.

  1. Changing the folder permissions:
    chmod -R 777 /var/www/.cache

By running the above command, you're ensuring that the folder has the right permissions for all operations.


stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.