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

ziomario

Daemon

Reaction score: 138
Messages: 1,083

Hello.

I would like to stream the content of my webcam on my personal web server,located on the same PC that I use everyday. To do that I've used FreeBSD 13p6 ; obs 27.1.3 and nginx vers. 1.20.2

Below you can see all the commands that I have issued and I've also attached a list of screenshots,to explain better what happens. Infact it does not work : when I open the http address I'm not able to see my face. So,something is not working great. (I'm running apache on port 80) ;

on the router opened these ports : 443;80;4000;1935;8080;81 tcp/udp

Code:
gedit /etc/rc.conf

webcamd_0_flags="-N Generic-USB2-0-PC-CAMERA -S 20100331010203 -M 0"

killall webcamd
service webcamd start
obs

The video tutorial that I've watched :

https://www.youtube.com/watch?v=fW2kLd6INyQ&t=145s

commands taken from the video tutorial,modified by me :

cd /usr/ports/www/nginx
make install clean
(enable RTMP)
mkdir /mnt/hls
chown www:www /mnt/hls
mkdir /usr/local/www/stream
service nginx start

gedit /usr/local/etc/nginx/nginx.conf

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;

# GTV Player
server {
listen       81;
server_name  ziomario;

location / {
root    /usr/local/www/stream;
#root /usr/local/www/apache24/data;
index    index.html index.htm;
}
}


server {
listen 81;

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/;
}
}
}


gedit /usr/local/www/stream/index.html


<html>
<head>
<title>ZioMario Player</title>
<link href="https://vjs.zencdn.net/7.5.6/video-js.css" rel="stylesheet">

<!-- If you'd like to support IE8 (for Video.js versions prior to v7) -->
<script src="https://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"></script>
</head>

<body>
<video id='my-video' class='video-js vjs-big-play-centered' controls preload='auto'
width='1440'
height='900'
poster='gtv-poster.png' data-setup='{}'>
<source src='http://ziomario.ns0.it:8080/hls/test.m3u8'
type='application/x-mpegURL'>
<p class='vjs-no-js'>
To view this video please enable JavaScript, and consider upgrading to
a web browser that
<a href='https://videojs.com/html5-video-support/'
target='_blank'>supports HTML5 video</a>
</p>
</video>

<script src='https://vjs.zencdn.net/7.5.6/video.js'></script>
</body>
</html>

nano /etc/rc.conf

nginx_enable="YES"


on OBS :


Streaming Service: Custom
Server: rtmp://ziomario.ns0.it/live
Stream Key: test


error : The media could not be loaded, either because the server or network failed or because the format is not supported.

Screenshots :

https://ibb.co/cwFzCz2
https://ibb.co/LrjsY23
https://ibb.co/DrzrnJ2
https://ibb.co/9wXV0wS
https://ibb.co/Sx41cFJ
https://ibb.co/H7mjFCv
https://ibb.co/300wT1k
https://ibb.co/zFBNTRJ

Can u understand where is the error ? very thanks.
 

covacat

Daemon

Reaction score: 788
Messages: 1,446

afaik hls is only supported on safari and android/chrome
i tried some plugins from chrome desktop but they suck
 
OP
ziomario

ziomario

Daemon

Reaction score: 138
Messages: 1,083

So you want us all to watch your appointment with Eva? At what time is it?

I'll use skipe, but if that doesn't work (Infact I don't understand why,but sometime Skipe for Windows closes its process), I'm preparing plan B. You won't be able to see anything because mine and your different time zones.
 
OP
ziomario

ziomario

Daemon

Reaction score: 138
Messages: 1,083

afaik hls is only supported on safari and android/chrome
i tried some plugins from chrome desktop but they suck

can u give a look at video tutorial that I've posted ? because it worked like a charm for him.
 

eternal_noob

Daemon

Reaction score: 1,243
Messages: 1,513

You won't be able to see anything because mine and your different time zones.
Is that your only sEcUrItY mEaSuRe? :eek:

Dude... Talk to her in person. This is the best advice you can get.
If you can't, for whatever reason, use Skype on Windows, but please, for the sake of the holy kernel, don't use a public stream.
 
OP
ziomario

ziomario

Daemon

Reaction score: 138
Messages: 1,083

but no,it isn't. I don't talk about my security measurements,because if I do that,they will be not security measurements anymore. The most effective security measurement is not technological,but psychological. At least in our cultural timeframe. I can't talk with her in person. Her room is not secure because Omicron is very dangerous. In the recent past someone blame me for being selfish because I didn't get vaccinated. Well, the vaccine is not the only measure of defense. There is another one,even more powerful, it's to stay away physically from risks and dangers. So,no I'm not selfish. I'm differently protected.
 

covacat

Daemon

Reaction score: 788
Messages: 1,446

i suppose that video.js will play hls on other browsers
but if the .ts files are created then it should work with your phone without that video.js
i use a similiar setup for security cameras but i just create the hls stuff with ffmpeg from the nvr rtsp stream
 
OP
ziomario

ziomario

Daemon

Reaction score: 138
Messages: 1,083

maybe it works on Chromium,but there is some wrong setting on my configuration :

Screenshot_2022-01-15_20-58-10.png
 
OP
ziomario

ziomario

Daemon

Reaction score: 138
Messages: 1,083

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
 
OP
ziomario

ziomario

Daemon

Reaction score: 138
Messages: 1,083

So,its better if I stay ignorant ? The ignorance as a good security measurement ? Think carefully at this.
 

eternal_noob

Daemon

Reaction score: 1,243
Messages: 1,513

I want to help you. That's why i don't tell you how you can livestream your appointment with your psycho doc.
 
OP
ziomario

ziomario

Daemon

Reaction score: 138
Messages: 1,083

You aren't helping me and you aren't helping yourself,too. If I'm not able to fix this error I will use skype for sure,so : 1) I will stay ignorant 2)
you are losing the chance to watch Eva,in this way. Not a good move. This made me laugh,because psychological usually wins over technological.
 

Geezer

Aspiring Daemon

Reaction score: 603
Messages: 924

If you are going to all this effort to see your therapist, then you need to see a therapist.

I am sure that when you eventually do get through to her, going via Mars and Venus, she will say to you, "Ziomario, keep it simple!"

And are you aware that your local ISP has probably blocked port 80, even if you do have port forwarding on your modem.
 

covacat

Daemon

Reaction score: 788
Messages: 1,446

this worked for me with hls
 
OP
ziomario

ziomario

Daemon

Reaction score: 138
Messages: 1,083

If you are going to all this effort to see your therapist, then you need to see a therapist.

I am sure that when you eventually do get through to her, going via Mars and Venus, she will say to you, "Ziomario, keep it simple!"

And are you aware that your local ISP has probably blocked port 80, even if you do have port forwarding on your modem.

I do all this effort because I like to solve problems and I like to enjoy myself with the achieved goal. What it seems to me is that you are too tired to do this. How many reasons did u find for me to see a therapist ? I've lost the number. My port 80 works good because apache says "it works!" ; anyway I've disabled apache and I left enabled only the nginx parameter to "yes" on rc.conf.
 
Top