Closed maxlinux2000 closed 4 years ago
and what about the encoder logs ?
you're connected from home to a server ? client: 192.168.0.2
, or at your home is the server hosted ? RewriteCond %{SERVER_NAME} =cathotube.com
the encoder don't receive any files y stay quiet. The logs above is a compilation of all logs including the encoder one
ENCODER ========================================================================================
/var/www/html/cathotube.com/YouPHPTube-Encoder/videos/avideo.log-------------------
The streamer and the encoder stay in the same server (192.168.0.2) and there is not other encoder in the network
If someone wants to use my log collector, I put here two scripts. The first will read to reset the logs (delete all of the above, so much care) and the second collects the logs and various information, such as if nginx is running.
Here the ResetLogs.sh script. Install it in /usr/local/bin Please change the path in the 2 variables
#!/bin/bash
YOUPHPTUBE_STREAMER_LOG=/var/www/html/AVideo-Streamer/videos/avideo.log
YOUPHPTUBE_ENCODER_LOG=/var/www/html/AVideo-Encoder/videos/avideo.log
:> /usr/local/nginx/logs/error.log
:> /usr/local/nginx/logs/access.log
:> $YOUPHPTUBE_STREAMER_LOG
:> $YOUPHPTUBE_ENCODER_LOG
Here the GetLogs.sh script. Install it in /usr/local/bin Please change the path in the 2 variables
#!/bin/bash
YOUPHPTUBE_STREAMER_LOG=/var/www/html/AVideo-Streamer/videos/avideo.log
YOUPHPTUBE_ENCODER_LOG=/var/www/html/AVideo-Encoder/videos/avideo.log
clear
echo "
Check if NGINX is Running =========================================================================
"
ps -A | grep nginx
echo "
NGINX Error ========================================================================================
/usr/local/nginx/logs/error.log---------------------------------------------------------
"
tail /usr/local/nginx/logs/error.log
echo "
NGNX Access ========================================================================================
/usr/local/nginx/logs/access.log--------------------------------------------------------
"
tail /usr/local/nginx/logs/access.log
echo "
STREAMER ========================================================================================
$YOUPHPTUBE_STREAMER_LOG <----------------------------
"
tail $YOUPHPTUBE_STREAMER_LOG
echo "
ENCODER ========================================================================================
$YOUPHPTUBE_ENCODER_LOG <-------------------
"
tail $YOUPHPTUBE_ENCODER_LOG
echo "
list files of ========================================================================================
/var/www/tmp/-------------------
"
ls -lash /var/www/tmp/
echo "
list files of ========================================================================================
/HLS-------------------
"
ls -lashR /HLS/
echo "
list files of ========================================================================================
$YOUPHPTUBE_ENCODER_LOG
"
ls -lash $YOUPHPTUBE_ENCODER_LOG
I forget to mention:
SendRecordedToEncoder (SendRecordedToEncoder) UUID: eb6e2808-d876-4488-94cb-2448a6b14e0b Version: @1.0
and the parameters:
@maxlinux2000
I did not see your streamer log
and please paste your nginx.conf too
Hi, here my nginx.conf
root@s1:~# cd /usr/local/nginx/conf/
root@s1:/usr/local/nginx/conf# cat nginx.conf
user www-data;
worker_processes 1;
error_log logs/error.log debug;
events {
worker_connections 1024;
}
rtmp {
server {
listen 1935;
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;
#record all;
#record_path /video_recordings;
#record_unique on;
hls on;
hls_nested on;
hls_path /HLS/live;
#hls_playlist_length 4s;
#hls_fragment 1s;
hls_fragment 10s;
on_publish http://live.cathotube.com/plugin/Live/on_publish.php;
on_play http://cathotube.com/plugin/Live/on_play.php;
on_record_done http://cathotube.com/plugin/Live/on_record_done.php;
recorder video{
record all;
record_path /var/www/tmp;
record_notify on;
record_max_size 2000M;
#will produce files of the form yourUserKey-24-Apr-13-18:23:38.flv
#record_suffix -%d-%b-%y-%T.flv;
record_suffix -%d-%b-%y.flv;
}
}
}
}
http {
include mime.types;
default_type application/octet-stream;
server {
listen 8080;
server_name localhost cathotube.com;
#creates the http-location for our full-resolution (desktop) HLS stream - "http://my-ip/live/my-stream-key/index.m3u8"
location /live {
# 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/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 {
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;
}
listen 444 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/cathotube.com-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/cathotube.com-0001/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
}
}
Now the experiment: I reset all the logs, for exampl the encoder log is empty now
# tail /var/www/html/cathotube.com/YouPHPTube-Encoder/videos/avideo.log
#
Now with ffmpeg I will send a film in streaming Live (I will change the passwd and key asap)
During the streaming the encoder log show:
root@s1:~# tail /var/www/html/cathotube.com/YouPHPTube-Encoder/videos/avideo.log
[14-Feb-2020 10:34:50 Europe/Berlin] Create Gif with Ppallet: ffmpeg -y -t 3 -i https://cathotube.com:444/live/5e26cddbcf78d/index.m3u8 -vf fps=10,scale=320:-1:flags=lanczos,palettegen /tmp/011210adae51bfcd62acb702dc6e07a7palette.png &> /dev/null &
[14-Feb-2020 10:34:50 Europe/Berlin] /var/www/html/cathotube.com/YouPHPTube-Encoder/objects/getImage.php 102Execution time : 1.6467478275299 seconds
[14-Feb-2020 10:36:59 Europe/Berlin] getImage Destination get Image from https://cathotube.com:444/live/5e26cddbcf78d/index.m3u8 jpg: /tmp/011210adae51bfcd62acb702dc6e07a7.jpg
[14-Feb-2020 10:36:59 Europe/Berlin] getImage Destination get Image from https://cathotube.com:444/live/5e26cddbcf78d/index.m3u8 gif: /tmp/011210adae51bfcd62acb702dc6e07a7.gif
[14-Feb-2020 10:37:07 Europe/Berlin] https://cathotube.com/ == https://cathotube.com/
[14-Feb-2020 10:37:07 Europe/Berlin] login.json: Login::run
[14-Feb-2020 10:37:07 Europe/Berlin] Login::run (peliculas, ***, https://cathotube.com/, true)
[14-Feb-2020 10:37:07 Europe/Berlin] Verification Start https://cathotube.com/
[14-Feb-2020 10:37:07 Europe/Berlin] Verification Creating the Cache https://cathotube.com/
[14-Feb-2020 10:37:09 Europe/Berlin] Verification Response (https://search.avideo.com/verify.php?url=https%3A%2F%2Fcathotube.com%2F): {"msg":["Start","https:\/\/cathotube.com\/ Site verified"],"verified":true,"status":"a"}
root@s1:~#
Now I will stop the streaming from ffmpeg
And here the log of encoder
root@s1:~# tail /var/www/html/cathotube.com/YouPHPTube-Encoder/videos/avideo.log
[14-Feb-2020 10:34:50 Europe/Berlin] Create Gif with Ppallet: ffmpeg -y -t 3 -i https://cathotube.com:444/live/5e26cddbcf78d/index.m3u8 -vf fps=10,scale=320:-1:flags=lanczos,palettegen /tmp/011210adae51bfcd62acb702dc6e07a7palette.png &> /dev/null &
[14-Feb-2020 10:34:50 Europe/Berlin] /var/www/html/cathotube.com/YouPHPTube-Encoder/objects/getImage.php 102Execution time : 1.6467478275299 seconds
[14-Feb-2020 10:36:59 Europe/Berlin] getImage Destination get Image from https://cathotube.com:444/live/5e26cddbcf78d/index.m3u8 jpg: /tmp/011210adae51bfcd62acb702dc6e07a7.jpg
[14-Feb-2020 10:36:59 Europe/Berlin] getImage Destination get Image from https://cathotube.com:444/live/5e26cddbcf78d/index.m3u8 gif: /tmp/011210adae51bfcd62acb702dc6e07a7.gif
[14-Feb-2020 10:37:07 Europe/Berlin] https://cathotube.com/ == https://cathotube.com/
[14-Feb-2020 10:37:07 Europe/Berlin] login.json: Login::run
[14-Feb-2020 10:37:07 Europe/Berlin] Login::run (peliculas, ***, https://cathotube.com/, true)
[14-Feb-2020 10:37:07 Europe/Berlin] Verification Start https://cathotube.com/
[14-Feb-2020 10:37:07 Europe/Berlin] Verification Creating the Cache https://cathotube.com/
[14-Feb-2020 10:37:09 Europe/Berlin] Verification Response (https://search.avideo.com/verify.php?url=https%3A%2F%2Fcathotube.com%2F): {"msg":["Start","https:\/\/cathotube.com\/ Site verified"],"verified":true,"status":"a"}
root@s1:~#
and in the encoder interface
but I can find the flv in /var/www/tmp
# ls -lash /var/www/tmp/
total 25M
4.0K drwxrwxrwx 2 root root 4.0K feb 14 10:46 .
4.0K drwxr-xr-x 4 root root 4.0K nov 14 21:53 ..
25M -rw-r--r-- 1 www-data www-data 25M feb 14 10:41 5e26cddbcf78d-14-Feb-20.flv
#
If I comment the redirect rule (http to https) in apache, All system works and the plugn SendRedordtoencoder come back to work. But I need to have it in order to solve another problem.
From
<VirtualHost *:80>
DocumentRoot "/var/www/html/cathotube.com/YouPHPTube"
ServerName cathotube.com
ServerAlias live.cathotube.com, s1.cathotube.com
# Other directives here
RewriteEngine on
RewriteCond %{SERVER_NAME} =cathotube.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/var/www/html/cathotube.com/YouPHPTube-Encoder"
ServerName encoder.cathotube.com
# Other directives here
RewriteEngine on
RewriteCond %{SERVER_NAME} =encoder.cathotube.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:443>
DocumentRoot "/var/www/html/cathotube.com/YouPHPTube-Encoder"
ServerName encoder.cathotube.com
# Other directives here
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/cathotube.com-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/cathotube.com-0001/privkey.pem
</VirtualHost>
to
<VirtualHost *:80>
DocumentRoot "/var/www/html/cathotube.com/YouPHPTube"
ServerName cathotube.com
ServerAlias live.cathotube.com, s1.cathotube.com
# Other directives here
# RewriteEngine on
# RewriteCond %{SERVER_NAME} =cathotube.com
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/var/www/html/cathotube.com/YouPHPTube-Encoder"
ServerName encoder.cathotube.com
# Other directives here
RewriteEngine on
RewriteCond %{SERVER_NAME} =encoder.cathotube.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:443>
DocumentRoot "/var/www/html/cathotube.com/YouPHPTube-Encoder"
ServerName encoder.cathotube.com
# Other directives here
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/cathotube.com-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/cathotube.com-0001/privkey.pem
</VirtualHost>
Hi,
thanks for the info. I do not think that is the problem but change your onpublish to the same domain as your other on* directives removing the live.
on_publish http://cathotube.com/plugin/Live/on_publish.php;
on_play http://cathotube.com/plugin/Live/on_play.php;
on_record_done http://cathotube.com/plugin/Live/on_record_done.php;
but you can not redirect the on_* directives to https.
if you want you can use a separate domain just for the on directives or you can use the IP address and let apache redirect the domain.
on_publish http://192.166.150.7/plugin/Live/on_publish.php;
on_play http://192.166.150.7/plugin/Live/on_play.php;
on_record_done http://192.166.150.7/plugin/Live/on_record_done.php;
That's Works!!! TNX!!
Because my installation of Avideo allowed to connect via http, I added a rule in apache to redirect to the https protocol.
Avideo continues to work correctly everywhere, even when I launch a Live, the Home shows the thumbnail with the e the warning bell signals the event.
The problem is that now Live is not recorded. Apparently the SendRecordedToEncoder plugin did not like the change in apache configuration
I put here the Apache configuration that I modified
I added the rules in the port 80 here:
and here all the logs
I can see a send() failed (32: Broken pipe), client: 192.168.0.2, server: 0.0.0.0:1935
In /var/www/tmp after the test live, there is the .flv file... but the the Encoder don't get any file to process.