Giter Club home page Giter Club logo

Comments (8)

JamiePhonic avatar JamiePhonic commented on July 17, 2024

Hi @jhonyesg

Try using the nginx_ffmpeg.conf config file provided in the conf directory.
Simply rename the existing nginx.conf to something else like nginx_default.conf and then rename nginx_ffmpeg.conf to nginx.conf and restart the container.

Check out the instructions here for more information on how to stream to the server.

from rtmps-hls-server.

jhonyesg avatar jhonyesg commented on July 17, 2024

Best regards.
Indeed, that was the first one I made, but I am sending these 4 signals as an example:

rtmp://51.81.210.198:1935/live/amordiscos
rtmp://51.81.210.198:1935/live/telemusica
rtmp://51.81.210.198:1935/live/melody
rtmp://51.81.210.198:1935/live/telemorisco

but the problem is that when I enable it, of the 4 signals that arrive
nginx.txt
to the server only 1 has the video in the multiple qualities well, but the others are only in audio.

As a discard I checked the consumption in cpu and in the vps that I have it does not exceed 60%, but I enabled the consumption of rtmp and I see that when I try to capture the rtmp and reemit it in the multiple manual qualities, it is not allowed to capture or if it captures if interunpe is not recovered.

from rtmps-hls-server.

JamiePhonic avatar JamiePhonic commented on July 17, 2024

Ah, i see.

I have never tested the server processing more than a single stream.
You should be able to view the streams with VLC using rtmp://{IP}:1935/show/{name}
If using the FFMPEG config, Add _{quality} to the end where quality is one of:

Quality
low
mid
high
hd720
src

For example:
Without FFMPEG: rtmp://51.81.210.198:1935/show/telemorisco
With FFMPEG: rtmp://51.81.210.198:1935/show/telemorisco_mid

You should also be able to get them over HTTP: http://{IP}:8080/hls/{name}.m3u8
For Example: http://51.81.210.198:8080/hls/telemorisco.m3u8

You can use the stats page (http://51.81.210.198:8080/stats/) to see what the server is doing which may help.

from rtmps-hls-server.

jhonyesg avatar jhonyesg commented on July 17, 2024

it is correct what I did was in the config file to enable the option of the resolutions according to the bandwidth, in this case I only wanted to enable 3 qualities

low
_mid
_srs

but when taking with fmmpeg:

ffmpeg -re -i "rtmp://51.81.210.198:1935/live/telemusica" -c copy -f flv -strict experimental rtmp://192.168.0.117:8084/live/telemusica_srs
ffmpeg -re -i "rtmp://192.168.0.117:8084/live/telemusica_srs" -vf scale=1280x720 -c:v libx264 -preset superfast -c:a copy -f flv -strict experimental -b:a 64k rtmp://51.81.210.198:1935/live/telemusica_mid
ffmpeg -re -i "rtmp://192.168.0.117:8084/live/telemusica_srs" -vf scale=250x100 -c:v libx264 -preset superfast -c:a copy -f flv -strict experimental -b:a 64k rtmp://51.81.210.198:1935/live/telemusica_low

it keeps thinking when capturing the rtmp to rebroadcast, then I am blocked, since I thought to allocate a computer to broadcast in the qualities, to solve but with the local or public ip I try with ffmpeg to make the capture and it remains without action or if it does action, it does not allow me the execution of script that take the original rtmp to transcode it in several qualities, example create scrip. sh for each signal quality if I run it sometimes starts well, if I pause it or there is a slight internet outage it does not reconnect to the original rtmp, even though it is running well.

from rtmps-hls-server.

jhonyesg avatar jhonyesg commented on July 17, 2024

Best regards.

Dear sir, I tried to perform this solution:
For Example: http://51.81.210.198:8080/hls/telemorisco.m3u8
but the problem is that when sending the other signals, it starts to blqouear due to the quality change, so it makes it very inefficient.

If you could solve it, it would be very helpful and of course I would acknowledge your support for a coffee.

from rtmps-hls-server.

JamiePhonic avatar JamiePhonic commented on July 17, 2024

Your FFMPEG config should use localhost for the source.
I recommend using the existing config and remove the qualities you dont want:

exec_push  /usr/local/bin/ffmpeg -i rtmp://localhost:1935/$app/$name -async 1 -vsync -1
        -c:v libx264 -c:a aac -b:v 256k  -b:a 64k  -vf "scale=480:trunc(ow/a/2)*2"  -tune zerolatency -preset superfast -crf 23 -f flv rtmp://localhost:1935/show/$name_low
        -c:v libx264 -c:a aac -b:v 768k  -b:a 128k -vf "scale=720:trunc(ow/a/2)*2"  -tune zerolatency -preset superfast -crf 23 -f flv rtmp://localhost:1935/show/$name_mid
        -c copy -f flv rtmp://localhost:1935/show/$name_src;

You can modify the bandwidth requirements for each quality in the config file.
Lines 81 through 85 (Values are in Bits per Second)

      # Instruct clients to adjust resolution according to bandwidth
      hls_variant _src BANDWIDTH=4096000; # Source bitrate, source resolution
      hls_variant _hd720 BANDWIDTH=2048000; # High bitrate, HD 720p resolution
      hls_variant _high BANDWIDTH=1152000; # High bitrate, higher-than-SD resolution
      hls_variant _mid BANDWIDTH=448000; # Medium bitrate, SD resolution
      hls_variant _low BANDWIDTH=288000; # Low bitrate, sub-SD resolution

The video will always buffer slightly when switching quality. Unfortunatley there isnt much i can do about that.

Adding the hls_nested on; directive to the config may help? (try adding it below Line 76)
This toggles HLS nested mode. In this mode a subdirectory of hls_path is created for each stream. Playlist and fragments are created in that subdirectory. Default is off.

from rtmps-hls-server.

jhonyesg avatar jhonyesg commented on July 17, 2024

Dear, thank you in advance for your support, unfortunately it did not work for me.

Although now I have this problem that if I would like to solve root, it happens that I want to capture the RTMP, enable the capture, but when I make multiple connections, using vlc or ffmplay, it keeps thinking and sometimes does not connect, I see that only allowed as 1 or 2 connections in rtmp max.

Do you know what it could be and how to solve it.

from rtmps-hls-server.

JamiePhonic avatar JamiePhonic commented on July 17, 2024

I'm not sure on that one. This container isnt really intended to receive more than 1 stream at any given time.
It's mainly intended to allow you to revieve on stream and forward it on to multiple destinations (youtube and facebook, etc) at once.

from rtmps-hls-server.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.