Closed JoshWho closed 4 years ago
I just test it on my side and works.
to test it on your side we will need a live stream available.
also you can check your log files from the streamer and encoder
I been dealing with this for almost 3 weeks now. You tested this on my site?
Hi Daniel, I can confirm that there is not thumbnails in the live streamings When the live start, apperas a gray thumbnail "on air" like the screenshot of joshwho, and if I refresh the page, appear a black thumbnail.
Here my logs... but... 1970??
NGINX Error ========================================================================================
/usr/local/nginx/logs/error.log---------------------------------------------------------
2019/11/01 17:45:37 [info] 8048#0: *4 deleteStream, client: 192.166.150.6, server: 0.0.0.0:1935
2019/11/01 17:46:04 [info] 8048#0: *53 client connected '192.166.150.6'
2019/11/01 17:46:04 [info] 8048#0: *53 connect: app='live' args='p=78f6520b4ecee62b24eb474a3fe3ce4a' flashver='FMLE/3.0 (compatible; Lavf57.83' swf_url='' tc_url='rtmp://live.mytube.com:1935/live?p=78f6520b4ecee62b24eb474a3fe3ce4a' page_url='' acodecs=0 vcodecs=0 object_encoding=0, client: 192.166.150.6, server: 0.0.0.0:1935
2019/11/01 17:46:04 [info] 8048#0: *53 createStream, client: 192.166.150.6, server: 0.0.0.0:1935
2019/11/01 17:46:04 [info] 8048#0: *53 publish: name='5db8aa478d954' args='' type=live silent=0, client: 192.166.150.6, server: 0.0.0.0:1935
2019/11/01 17:46:04 [info] 8048#0: *53 notify: publish 'live.mytube.com/plugin/Live/on_publish.php', client: 192.166.150.6, server: 0.0.0.0:1935
2019/11/01 18:14:18 [info] 8048#0: *221 client 192.168.0.2 closed keepalive connection
2019/11/01 18:14:18 [info] 8048#0: *223 client 192.168.0.2 closed keepalive connection
2019/11/01 18:14:18 [info] 8048#0: *224 client 192.168.0.2 closed keepalive connection
2019/11/01 18:14:18 [info] 8048#0: *225 client 192.168.0.2 closed keepalive connection
NGNX Access ========================================================================================
/usr/local/nginx/logs/access.log--------------------------------------------------------
192.168.0.2 - - [01/Nov/2019:18:18:59 +0100] "GET /stat HTTP/1.0" 200 1356 "-" "-"
192.168.0.2 - - [01/Nov/2019:18:19:10 +0100] "GET /stat HTTP/1.0" 200 1356 "-" "-"
192.168.0.2 - - [01/Nov/2019:18:19:20 +0100] "GET /stat HTTP/1.0" 200 1356 "-" "-"
192.168.0.2 - - [01/Nov/2019:18:19:32 +0100] "GET /stat HTTP/1.0" 200 1356 "-" "-"
192.168.0.2 - - [01/Nov/2019:18:19:43 +0100] "GET /stat HTTP/1.0" 200 1356 "-" "-"
192.168.0.2 - - [01/Nov/2019:18:19:54 +0100] "GET /stat HTTP/1.0" 200 1355 "-" "-"
192.168.0.2 - - [01/Nov/2019:18:20:04 +0100] "GET /stat HTTP/1.0" 200 1355 "-" "-"
192.168.0.2 - - [01/Nov/2019:18:20:16 +0100] "GET /stat HTTP/1.0" 200 1356 "-" "-"
192.168.0.2 - - [01/Nov/2019:18:20:26 +0100] "GET /stat HTTP/1.0" 200 1356 "-" "-"
192.168.0.2 - - [01/Nov/2019:18:20:37 +0100] "GET /stat HTTP/1.0" 200 1356 "-" "-"
STREAMER ========================================================================================
/var/www/html/mytube.com/YouPHPTube/videos/youphptube.log----------------------------
[01-Nov-2019 17:50:19 Europe/Berlin] Warning: The plugin [User_Location::getStart] takes 0.062 seconds to complete.
[01-Nov-2019 17:50:19 Europe/Berlin] /var/www/html/mytube.com/YouPHPTube/view/index.php
[01-Nov-2019 17:59:09 Europe/Berlin] Warning: The plugin [User_Location::getStart] takes 0.0617 seconds to complete.
[01-Nov-2019 17:59:09 Europe/Berlin] /var/www/html/mytube.com/YouPHPTube/view/index.php
[01-Nov-2019 18:14:18 Europe/Berlin] Image Expired in 01/01/1970 01:00:00 NOW is 01/11/2019 18:14:18
[01-Nov-2019 18:14:18 Europe/Berlin] New Image will Expired in 01/11/2019 18:16:18 NOW is 01/11/2019 18:14:18
[01-Nov-2019 18:14:18 Europe/Berlin] Cached Good until 01/11/2019 18:16:18 NOW is 01/11/2019 18:14:18
[01-Nov-2019 18:14:18 Europe/Berlin] Image Expired in 01/01/1970 01:00:00 NOW is 01/11/2019 18:14:18
[01-Nov-2019 18:14:18 Europe/Berlin] New Image will Expired in 01/11/2019 18:16:18 NOW is 01/11/2019 18:14:18
[01-Nov-2019 18:14:18 Europe/Berlin] Cached Good until 01/11/2019 18:16:18 NOW is 01/11/2019 18:14:18
ENCODER ========================================================================================
/var/www/html/mytube.com/YouPHPTube-Encoder/videos/youphptube.log-------------------
[01-Nov-2019 17:45:42 Europe/Berlin] {"error":false,"file":"\/var\/www\/html\/mytube.com\/YouPHPTube-Encoder\/videos\/294_tmpFile.mp4","target":"https:\/\/mytube.com\/objects\/youPHPTubeEncoderReceiveImage.json.php","postFields":6,"response_raw":"{\"error\":false,\"video_id\":500}","response":{"error":false,"video_id":500}}
[01-Nov-2019 17:45:42 Europe/Berlin] run:runMultiResolution
[01-Nov-2019 17:45:42 Europe/Berlin] YouPHPTube-Encoder Start Encoder [HD /var/www/html/mytube.com/YouPHPTube-Encoder/videos/294_tmpFile.mp4 /var/www/html/mytube.com/YouPHPTube-Encoder/videos/294_tmpFile_converted_HD.mp4]
[01-Nov-2019 17:45:43 Europe/Berlin] YouPHPTube-Encoder Start Encoder [SD /var/www/html/mytube.com/YouPHPTube-Encoder/videos/294_tmpFile.mp4 /var/www/html/mytube.com/YouPHPTube-Encoder/videos/294_tmpFile_converted_SD.mp4]
[01-Nov-2019 17:46:08 Europe/Berlin] getImage Destination get Image from https://mytube.com:444/live/5db8aa478d954/index.m3u8 jpg: /tmp/aca6c58000d4731881b09af9495037e5.jpg
[01-Nov-2019 17:47:20 Europe/Berlin] SD /var/www/html/mytube.com/YouPHPTube-Encoder/videos/294_tmpFile.mp4 /var/www/html/mytube.com/YouPHPTube-Encoder/videos/294_tmpFile_converted_SD.mp4 --- [] --- (7, /var/www/html/mytube.com/YouPHPTube-Encoder/videos/294_tmpFile.mp4, /var/www/html/mytube.com/YouPHPTube-Encoder/videos/294_tmpFile_converted_SD.mp4, 294)
[01-Nov-2019 18:14:17 Europe/Berlin] getImage Destination get Image from https://mytube.com:444/live/5db8aa478d954/index.m3u8 jpg: /tmp/aca6c58000d4731881b09af9495037e5.jpg
[01-Nov-2019 18:14:17 Europe/Berlin] getImage Destination get Image from https://mytube.com:444/live/5db8aa478d954/index.m3u8 jpg: /tmp/aca6c58000d4731881b09af9495037e5.jpg
[01-Nov-2019 18:14:18 Europe/Berlin] Exec get Image: ffmpeg -i https://mytube.com:444/live/5db8aa478d954/index.m3u8 -f image2 -s 400x225 -vframes 1 -y /tmp/aca6c58000d4731881b09af9495037e5.jpg &> /dev/null &
[01-Nov-2019 18:14:18 Europe/Berlin] Exec get Image: ffmpeg -i https://mytube.com:444/live/5db8aa478d954/index.m3u8 -f image2 -s 400x225 -vframes 1 -y /tmp/aca6c58000d4731881b09af9495037e5.jpg &> /dev/null &
root@s1:~#
what do you get if you manually run this
ffmpeg -i https://mytube.com:444/live/5db8aa478d954/index.m3u8 -f image2 -s 400x225 -vframes 1 -y /tmp/aca6c58000d4731881b09af9495037e5.jpg
I get weird pages when looking for the image sometimes just shows a Source file showing Adobe Photoshop.
root@s1:/var/www/html/mytube.com/YouPHPTube-Encoder/videos# ffmpeg -i https://mytube.com:444/live/5db8aa478d954/index.m3u8 -f image2 -s 400x225 -vframes 1 -y /tmp/aca6c58000d4731881b09af9495037e5.jpg
ffmpeg version 4.1.4-1+rpt1~deb10u1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8 (Raspbian 8.3.0-6+rpi1)
configuration: --prefix=/usr --extra-version='1+rpt1~deb10u1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --arch=arm --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
[hls,applehttp @ 0x1b831d0] Opening 'https://mytube.com:444/live/5db8aa478d954/590.ts' for reading
[hls,applehttp @ 0x1b831d0] Opening 'https://mytube.com:444/live/5db8aa478d954/591.ts' for reading
Input #0, hls,applehttp, from 'https://mytube.com:444/live/5db8aa478d954/index.m3u8':
Duration: N/A, start: 6032.909689, bitrate: N/A
Program 0
Metadata:
variant_bitrate : 0
Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 620x360 [SAR 1:1 DAR 31:18], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
Metadata:
variant_bitrate : 0
Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 22050 Hz, stereo, fltp
Metadata:
variant_bitrate : 0
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x23bdec0] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/tmp/aca6c58000d4731881b09af9495037e5.jpg':
Metadata:
encoder : Lavf58.20.100
Stream #0:0: Video: mjpeg, yuvj420p(pc), 400x225 [SAR 31:32 DAR 31:18], q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc
Metadata:
variant_bitrate : 0
encoder : Lavc58.35.100 mjpeg
Side data:
cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 1 fps=0.0 q=5.0 Lsize=N/A time=00:00:00.04 bitrate=N/A dup=1 drop=1 speed=1.01x
video:14kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
root@s1:/var/www/html/mytube.com/YouPHPTube-Encoder/videos#
and Now pressing F5 in the browser the thumbnail is visible
In the previous logthere is: Image Expired in 01/01/1970 01:00:00 NOW is 01/11/2019 18:14:18
Now run manually ffmpeg the thumbnail is visible... there are relations with the wrong date above?
The expired image is the exact issue. Good find. Any idea how to fix that @DanielnetoDotCom ?
This is what I see when trying to view the thumb for the live stream locally not through my domain.
Hi @JoshWho
what URL are you seeing this output?
looks like the header is wrong
the live domain
but can you please put a sample URL here?
It was this one but it is not showing that right now.
https://live.joshwhotv.com/plugin/Live/getImage.php?u=axetruth&format=gif https://live.joshwhotv.com/plugin/Live/getImage.php?u=axetruth&format=jpg
I fixed the Issue by increasing my V bitrate in the Nginx Now thumbnails are working again.
Hi Josh, what is "V bitrate"?
In /usr/local/nginx/conf/nginx.conf
-c:a aac -strict -2 -b:a 64k -c:v libx264 -vf scale=-2:480 -g 48 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 900k -maxrate 1000k -bufsize 3800k -b:a 64k -r 20 -f hls -hls_time 6 -hls_list_size 0 -f flv rtmp://localhost/adaptive/$name_low;
Are you shure of path file? I can't found it in my /usr/local/nginx/*
You forgot the conf directory /usr/local/nginx/conf/nginx.conf
This is my exact setup. I use the HLS but disabled the High and SD stream.
` worker_processes auto; error_log logs/error.log debug; events { worker_connections 1024; } rtmp { server { listen 1935;
chunk_size 4096;
drop_idle_publisher 10s;
idle_streams off;
#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 60s;
#hls_fragment 1s;
hls_fragment 15s;
on_publish http://localhost/YouPHPTube/plugin/Live/on_publish.php;
on_play http://localhost/YouPHPTube/plugin/Live/on_play.php;
on_record_done http://localhost/YouPHPTube/plugin/Live/on_record_done.php;
exec ffmpeg -i rtmp://localhost/live/$name
-c:a aac -strict -2 -b:a 64k -c:v libx264 -vf scale=-2:480 -g 48 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 900k -maxrate 1000k -bufsize 3800k -b:a 64k -r 20 -f hls -hls_time 6 -hls_list_size 0 -f flv rtmp://localhost/adaptive/$name_low;
recorder video{
record all;
record_path /var/www/tmp;
record_notify on;
#will produce files of the form yourUserKey-24-Apr-13-18:23:38.flv
record_suffix -%d-%b-%y-%T.flv;
}
}
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=260000;
#hls_variant _sd BANDWIDTH=466200000;
#hls_variant _hi BANDWIDTH=666200000;
}
}
}
http {
include mime.types;
default_type application/octet-stream;
server {
listen 8080;
server_name localhost redacted.com redacted.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/redacted.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/redacted.com/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
} } `
Yes, but I search in all folder for some file containing wath your are sayng
this is my nginx conf
root@s1:/usr/local/nginx# cat conf/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.mytube.com/plugin/Live/on_publish.php;
on_play http://mytube.com/plugin/Live/on_play.php;
on_record_done http://mytube.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 {
server_name s1.mytube.com;
rewrite ^ https://mytube.com$request_uri? permanent;
}
server {
listen 8080;
server_name localhost mytube.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/mytube.com-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/mytube.com-0001/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
}
}
root@s1:/usr/local/nginx#
You do not use HLS I see.
I have a /HLS folder an during the lives some .ts files are created. But I don't use the VideoHLS plugin
It is HLS for Live. It was an addon put out a few months ago. https://github.com/YouPHPTube/YouPHPTube/wiki/Adaptive-Bitrates-on-Livestream
Ok I see, but it's not strictly necessary for lives. I can do lives from my phone at 640x480 and works greats, a parte the thumbnail, of course
I found out the other day certain devices will not play the stream if it doesn't have the HLS protocol in it.
I never had the thumbnail issue when using the standard Live Stream so not sure what else would be causing that issue for you.
@DanielnetoDotCom I have some bugs for you about the youphptune app. Where I can open them? I don't see a projet here.
Have you a forum for the paying or not free programs?
regards MaX
Just click New Issue at the top and post away
I never had the thumbnail issue when using the standard Live Stream so not sure what else would be causing that issue for you.
Ok, thx, I think that in my case its the time stamp of 1970.... I thing that I can create a workaround, wrinting a script that monitorizin the log and then It found a file created in 1970, just touch it in ordeer to change the date.. I hate to think about it
I found the problem for me:
An "obscure" option in the paramaters of Live Plugin :D Disabling thi option the thumbnail will be visible again
It just shows the Live Thumbnail and stays that way for hours.