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
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.
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.