Media could not be loaded, either because the server or network failed or the format is not supported ERROR while I'm trying to stream my cam with OBS

that html/js example actually works with hls video

what should I do ? I should change this :

Code:
http-streaming

with this ?

Code:
http://ziomario.ns0.it:8080/hls/test.m3u8

so it becomes :

Code:
<script src="https://unpkg.com/@videojs/http://ziomario.ns0.it:8080/hls/test.m3u8@0.9.0/dist/videojs-http-streaming.js"></script>
 
change this line with your video source
<source src="https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8" type="application/x-mpegURL">
the rest works unchanged

also make sure the webpage and the video come from the same port / site so you don't have to mess with cross origin

---> also make sure the webpage and the video come from the same port / site so you don't have to mess with cross origin

explain to me what I should do to fix this error. at the moment it does not work :

Screenshot_2022-01-16_12-44-39.png
 
this is the nginx.conf file :

Code:
load_module /usr/local/libexec/nginx/ngx_stream_module.so;
load_module /usr/local/libexec/nginx/ngx_rtmp_module.so;

#user nobody
worker_processes  1;
events {
    worker_connections  1024;
}

# RTMP configuration
rtmp {
    server {
        listen 1935; # Listen on standard RTMP port
        chunk_size 4000;

        application live {
            live on;
            # Turn on HLS
            hls on;
            hls_path /mnt/hls/;
            hls_fragment 3;
            hls_playlist_length 60;
            # disable consuming the stream from nginx as rtmp
            deny play all;
        }
    }
}

http {
    sendfile off;
    tcp_nopush on;
    aio on;
    directio 512;
    default_type application/octet-stream;

    # ZioMario Player
    server {
        listen       80;
        server_name  ziomario;
   
    location / {
    root    /usr/local/www/stream;
    #root /usr/local/www/apache24/data;
    index    index.html index.htm;
    }
    }


    server {
        listen 80;

        location / {
            # 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/dash+xml mpd;
                application/vnd.apple.mpegurl m3u8;
                video/mp2t ts;
            }

            root /mnt;
        }
    }
}

do u see some error inside it ? the video files are inside /mnt/hls :

Code:
marietto:/usr/local/etc/nginx # ls /mnt/hls

test-208.ts     test-211.ts     test-214.ts     test-217.ts     test-220.ts     test-223.ts     test.m3u8
test-209.ts     test-212.ts     test-215.ts     test-218.ts     test-221.ts     test-224.ts
test-210.ts     test-213.ts     test-216.ts     test-219.ts     test-222.ts     test-225.ts
 
this is the reason :

Code:
info: [rtmp stream: 'simple_stream'] Connecting to RTMP URL rtmp://ziomario.ns0.it/live...
info: [rtmp stream: 'simple_stream'] Connection to rtmp://ziomario.ns0.it/live successful
info: ==== Streaming Start ===============================================
error: v4l2-input: /dev/video0: select timed out
error: v4l2-input: /dev/video0: failed to log status
error: v4l2-input: /dev/video0: select timed out
error: v4l2-input: /dev/video0: failed to log status

What does usbconfig() say about your device? Are you sure there is enough USB capacity to run the desired resolution? Are you running the latest version of webcamd()?
 
Back
Top