TareqAlqutami / rtmp-hls-server

a docker file to create a streaming server that supports RTMP, HLS and DASH content based on nginx and nginx-rtmp-module.
MIT License
401 stars 192 forks source link

Loss of Video and/or entire stream #21

Open zollymonsta opened 3 years ago

zollymonsta commented 3 years ago

I'd dearly love to get this docker working correctly. However there are a couple of issues.

First, it will randomly drop the video or the entire stream. Looking at the stats, the video is not present. A stop start of the docker plugin resolves. This can happen frequently within an hour

rtmp rtmp2

Secondly, sometimes the stats page shows nothing.. even though the plugin is outputting a stream and I am viewing it on another device.

Another issue is when starting up the docker plugin, the syslog is flooded with these messages (eventually filling up all the log space). These messages continue until the docker plugin is stopped. This could be related to the above issue

Mar 12 15:04:05 Miley kernel: device br0 entered promiscuous mode Mar 12 15:04:12 Miley kernel: tun: unexpected GSO type: 0x0, gso_size 1460, hdr_len 1514 Mar 12 15:04:12 Miley kernel: tun: c8 92 3f 88 49 d4 43 2e de 65 d4 cc f1 3d d6 b8 ..?.I.C..e...=.. Mar 12 15:04:12 Miley kernel: tun: 73 21 37 9b b0 ba 27 4e 46 7b 67 bf 42 52 bf 51 s!7...'NF{g.BR.Q Mar 12 15:04:12 Miley kernel: tun: 99 da 86 ec c1 15 e7 04 85 8b 96 51 4a 41 36 3d ...........QJA6= Mar 12 15:04:12 Miley kernel: tun: a2 22 65 63 1e 6a f4 4b cf 25 70 e8 15 6d b2 e8 ."ec.j.K.%p..m..

Cheers, Grant

schenklklopfer commented 3 years ago

I have the same problem and can't find a solution. Does anyone found anything here?

Issue is basically that the ffmpeg process dies every now and then. Even if ffmpeg runs there are stutters in picture and sound.

TareqAlqutami commented 3 years ago

Can you share more info on your setup. I maybe able to help if I can replicate the issue. Your config, video source, video sink, etc?

schenklklopfer commented 3 years ago

Yes of course.

Server: Intel Core i7-4770, 32 GB DDR3, 250GB SSD, 1Gbit/s syncronous internet uplink
OS: Ubuntu 20.04 LTS

pulled and build the container with no modifications:

git clone https://github.com/TareqAlqutami/rtmp-hls-server  
docker build -t rtmp-hls .
docker run -d -p 1935:1935 -p 8080:8080 rtmp-hls

Demo Movie:
wget http://ftp.halifax.rwth-aachen.de/blender/demo/movies/Sintel.2010.1080p.mkv

Streaming it to nginx:
ffmpeg -re -stream_loop -1 -i Sintel.2010.1080p.mkv -f flv rtmp://localhost:1935/live/test

Using the embedded HLS Player for play in the browser:
http://...:8080/players/hls.html

Also tried it in VLC:
http://...:8080/hls/test.m3u8

Every now and then the ffmpeg process started by the nginx: worker process stops working, and starts up a few seconds later. The stream in the player will stop.
grafik

Even if the ffmpeg process does not die there are stutters in the stream. Even in the source one (http://...:8080/hls/test_src.m3u8), that should be completely unaffected by transcoding effects.

Also tried OBS as a streaming source, configured to exact the settings written down in your README.md.
Same problems here.

There is no bottleneck from CPU, Memory or network. Load average is at about 1,6.

TareqAlqutami commented 3 years ago

@schenklklopfer, I replicated your settings using the same video. I couldn't replicate the ffmpeg/nginx process dying but I noticed few things 1- For the demo video you provided, the test_src.m3u8 and test_src.mpd were not generated in /mnt/hls and /mnt/dash. The HLS player goes to play test_hd720.m3u8 for me. 2- I played hls in two browser tabs and in VLC, I noticed VLC gets the stutters sometimes but not much for the HTML player. 3- I streamed another video and the test_src.m3u8 file was generated and played without issue.

I suggest the following: