Using NGINX Open Source for Video Streaming and Storage

Поделиться
HTML-код
  • Опубликовано: 14 дек 2024

Комментарии • 121

  • @williamheckman4597
    @williamheckman4597 4 года назад +8

    Best Tutorial yet on how to set up a basic NGINX+RTMP server!

  • @jeremyrhoades1641
    @jeremyrhoades1641 3 года назад

    For those confused, look into the blog link provided. I needed info from both the blog and this video to get it to work.

  • @ErnestGWilsonII
    @ErnestGWilsonII 4 года назад +29

    First, thumbs up and thank you for making and sharing this! BIG QUESTION: Can you PLEASE do a fully UDP solution for streaming live video INCLUDING UDP to the web browser? Maybe like QUIC protocol or HTTP3 with UDP or some ultra-modern full UDP implementation end-to-end?

    • @fernandobaruch7529
      @fernandobaruch7529 3 года назад +1

      For UDP you don't need a streaming server, you can publish your content as UDP traffic, is broadcast multicast, the streaming servers are for TCP traffic is unicast.

  • @pnw4x447
    @pnw4x447 4 года назад +6

    Thanks for this, but there are some confusing bits that need better explanation. For example: ruclips.net/video/Js1OlvRNsdI/видео.html, you say "I already have the config already on this machine, I just need to copy it in place". Well unfortunately, we don't have the config file already on our machines to copy in place, and the examples given on the blog post do not match the config that you've used. In fact, the blog post doesn't say what to do with the variables offered at all. Also on the blog post, it states "In the demo, James combines HLS and DASH in a single configuration, as many directives are the same for both protocols.", but give two separate config examples for HLS -or- DASH. So which are we supposed to do, copy just the HLS one, or the DASH one, or type out the variables exactly as you have? Where do the other parameters come from that are shown in the config file you "already have on your machine" that precede the RTMP parameters (worker_processes, pid, events, worker_connections, etc)? It is not explained whether we should take an existing config file from somewhere, and add the parameters given by you (or the blog, which, again, are different), or if we should create a new config file with only the parameters offered in the (two different) examples on the blog, and save that to usr/local/nginx/conf.
    What I've tried is taking the nginx.conf file that already existed in the usr/local/nginx/conf directory, and added the new rtmp and html variable, and that didn't work. I get [emerg] "http" directive is duplicate in /usr/local/nginx/conf/nginx.conf:134. I then modify that file to remove the first http block, run sudo /usr/local/sbin/nginx -t, and get "command not found". I don't even know why that path is referenced because nothing exists in /usr/local/sbin.
    Furthermore, do you realize that your command line is covered up by the RUclips player controls and timeline bar, so we cannot actually see what it is you're typing?
    In any case, I cannot get this to work. The instructions between the blog and this video seem so convoluted to me as to wonder how anyone has actually found a way to get this working, or maybe I'm just the stupidest person on the planet. Just so frustrated...please help!

    • @outcast341
      @outcast341 4 года назад

      Here is the config I used: gist.github.com/outcast/13289bd872b06700089d9fe1a94441ce

    • @ArmendKrasniqi
      @ArmendKrasniqi 3 года назад +1

      i have the same situation! What did you do? did you resolved it?

    • @kumartatsat868
      @kumartatsat868 3 года назад

      1. You can combine both directives together as James did in this video. It worked for me
      2. It's not /usr/local/sbin/nginx -t, its /usr/local/nginx/sbin/nginx -t. Please be careful
      3. just don't move the mouse for a bit, and the youtube player seekbar will autohide (I'm sure you're aware of this, but that's the least you can do from your side)

    • @manualidadesvarias883
      @manualidadesvarias883 Год назад

      i am also a noob and i do not have the config file already on our machines to copy in place,

    • @manualidadesvarias883
      @manualidadesvarias883 Год назад

      pls hlp

  • @SansUser-ec4be
    @SansUser-ec4be Год назад +1

    can i acess the videos in streaming outside of my wifi ip house?

    • @samuelhalder8472
      @samuelhalder8472 4 месяца назад +1

      If you stream on the local network then NO.
      if you stream on the internet YES.

    • @samuelhalder8472
      @samuelhalder8472 4 месяца назад +1

      If you stream on the local network then NO.
      if you stream on the internet YES.

  • @bazi801
    @bazi801 3 года назад +1

    Hey, It's dumb question but how to run linux machine inside atom editor like in video?

  • @Lordblanca
    @Lordblanca 4 года назад +6

    Great love this tutorial. Can you please make a video on how to stream to a web page. http and https. with video.js or any other html 5 player. and also how to stream to multiple locations at the same time. Thank You So Much.

    • @pepperandrino466
      @pepperandrino466 4 года назад +1

      as for how to stream to multiple locations at once, here is an example of multiple server settings for nginx.conf:
      rtmp {
      server {
      listen 1935;
      max_streams 1024;
      chunk_size 2048;
      application live {
      live on;
      wait_key on;
      wait_video on;
      sync 10ms;
      push rtmp://serveraddress1/streamkey1;
      push rtmp://serveraddress2/streamkey2;
      hls on;
      hls_path temp/hls;
      hls_fragment 2s;
      }
      }
      }
      just fill in your rtmp servers and stream keys and you should be good to go.
      i might replace "wait" and "sync" with "interleave" after watching this video... and i'm not sure i have the optimal settings for hls fragments.... it's worth looking up what the optimizations do to set up your stuff to your liking. :)

  • @itsjustrobby
    @itsjustrobby 3 года назад

    I have NGINX set up with NOLBS scene switcher, I've got everything working with being able to stream into the one designated RTMP address, Is there a way to create an additional RTMP address to stream into so I can add an additional camera?

  • @thaydanhhieu
    @thaydanhhieu 3 года назад

    Thanks

  • @peykens
    @peykens 3 года назад +1

    Ìm looping for a way to monitor this workflow in production setup. Something like real time stats on input/output, errors, usage, … Then we can build alarming on top of that. Has anyone experience with that ?

  • @clouddancer9
    @clouddancer9 4 года назад

    So followed the install on the site for nginx and got the at to work. Wanted to install the rtmp module that when nothing made sense or work.
    Followed the steps for centOS and it appear to install all the pre from yum. did the build with the the auto and make and make install and that seem to work. Problem is that went test the rtmp says uknown directive. Only talks for possible answer was needed to be compile with preq. which is what we did based on your install steps. Any ideas??

  • @googleppe
    @googleppe 2 года назад

    hello again, how to add watermark using your performant stream settings? I cant use the complex-filtering option beacuse it cant be used with the copy option. Thank you in advance.

  • @RuanMighailPienaar
    @RuanMighailPienaar 4 года назад +1

    I am having an issue when running 'make' eval of ngx_rtmp fails
    ../nginx-rtmp-module/ngx_rtmp_eval.c: In function ‘ngx_rtmp_eval’: && ../nginx-rtmp-module/ngx_rtmp_eval.c:160:17: error: this statement may fall through [-Werror=implicit-fallthrough=]

    • @pepperandrino466
      @pepperandrino466 4 года назад +2

      i just had the same problem and got it to compile properly by adding --with-cc-opt="-Wimplicit-fallthrough=0" to the end of the configure command. from github issue #1283 on arut's rtmp module repository. :D
      end result:
      ./auto/configure --add-module=..//nginx-rtmp-module --with-cc-opt="-Wimplicit-fallthrough=0"

    • @ubhornet126
      @ubhornet126 4 года назад +1

      @@pepperandrino466 thank you super man

  • @AshokElectronicsVideoMAX
    @AshokElectronicsVideoMAX 3 месяца назад

    Thanks Sir very helpful

  • @giuseppesetteducatijasango429
    @giuseppesetteducatijasango429 3 года назад

    You can add a "follow" guide to protect the streams, like lock the hls stream to a specific domain and geo ip lock.. power without control is nothing :)

  • @timrobertson8242
    @timrobertson8242 4 года назад

    I missed build for the rtmp module, which I assume is another configure make, otherwise how does the nginx make know the rtmp.git is in 1 directory up and over? I'll watch again, just in case I missed it. Besides this point, This was exactly what I needed to understand the pieces involved! Thanks! (edit) My question is answered in the blog:
    ./auto/configure --add-module=../nginx-rtmp-module

  • @basspig
    @basspig 2 года назад

    I've been trying to get nginx to work properly since April 2018 and I have only gotten as far as a frozen video frame while the audio plays on.
    I have OBS streaming to nginx and OBS shows a green status. The HLS folder is filling up with stream files. The Stream playlist file will play in VLC. But the viewer.html won't load the media, and when I access it from the public IP, it will load the media but only plays for one or two frames the freezes while the audio plays on. I have asked Doug Johnson about this and have spend months on his discord channel asking for help from various members. We have combed over the logs, fixed permission problems and cleared the log of most every error. nginx runs error free now, but the video will not play.
    I've been pounding my head against this wall for more than four years now, but no one can seem to make it work.
    Ironically, back in 2005, I used to stream video effortlessly with Windows Media Encoder 9 on a laptop computer. It's absurd that in 2022, I can't stream video anymore. And I've got gigabit fiber connection now, as opposed to 128K I had in 2005!

  • @samirberisa907
    @samirberisa907 3 года назад

    where do you store the desired video i want to stream and where would I install ngix and the server? Thanks

  • @mtdrip9523
    @mtdrip9523 3 года назад +1

    how many clients would it be able to support ? - lets assume we have enough bandwith

  • @RapiBurrito
    @RapiBurrito 4 года назад +2

    You guys rock! I'm starting to fall in love with nginx. If I could ask for an improvement I would be to get better lighting/white balance or warm up the face am a bit. As it is it works, but whenever you do a face close up it starts looking really crummy. Thanks again for the video

    • @pepperandrino466
      @pepperandrino466 4 года назад +1

      it sounds like you have the bitrate/resolution set too low in OBS or whatever you are using to broadcast your stream. as far as i know, nginx only acts as an intermediary to your streaming content, it does not have any options relating to your recording device quality.

  • @seematches2553
    @seematches2553 3 года назад

    hi nice and great tutorial but can you exactly explain what you were saying in the minute 6:40

  • @chrisdamonsworld
    @chrisdamonsworld 4 года назад

    Very good Instruction

  • @mz1651
    @mz1651 3 года назад

    questions:
    1. what are those three playback urls? can you please post here?
    2. when playback RTMP, you playback the source rtmp going to Nginx server or the rtmp coming out from Nginx?
    3. Is it possible to stream RTMP in and RTMP out?
    4. Is it possible for Nginx to hot reload? -- when the stream source or configuration is changed, Nginx can load the changes in the nginx.conf automatically without stopping and restarting Nginx, and no streaming interruption? is that possible?
    thanks

  • @wajdiyoussef576
    @wajdiyoussef576 4 года назад

    thank you for making and sharing this but Many TV channel broadcasts are intended for only one time zone, and if we speak about Russia, it is often only the Moscow time zone.
    If you want to distribute the same channel to users in Germany or in the USA, you will face a problem: people have an early morning, but they are already watching evening broadcasts.
    how to make delay stream playback for a few hours, so that people in a different time zone watch the «Good morning» broadcast in the morning, and not late at night. :)

  • @vladostema
    @vladostema 2 года назад

    How you use sudo and all this commands in windows

  • @ScottMontoya
    @ScottMontoya 3 года назад +1

    Hey can I hire you to configure this on my machine?

  • @inspite69
    @inspite69 3 года назад +1

    Great tutorial! Thanks Seth Rogen!

  • @magicyvan
    @magicyvan 4 года назад

    I don't understand. Is it a way to create our own "youtube platform" on our vps ? Is it the solution if we don't need live streaming ? thanks

  • @llevato
    @llevato 4 года назад

    Logré ir paso a paso pero no transmite. Podrías ayudarme tengo una VM con Ubuntu 18 en Google Cloud me da error en sudo /usr/local/sbin/nginx

  • @msaz3027
    @msaz3027 4 года назад +1

    So there is no way to use NGINX Open Source for VOD?

  • @vasu767
    @vasu767 2 года назад

    how to reduce delay in multiple output and sync all?

  • @vkeychaudhari
    @vkeychaudhari 3 года назад

    How to streaming live desktop screen using ffmpeg ?

  • @haifa6004
    @haifa6004 3 года назад

    HI, how can i increase the available disk space to Nginx, because i need to increase client_max_body_size more than 100M. Thanks

  • @miguelalejandrosaucedovale5360
    @miguelalejandrosaucedovale5360 2 года назад

    Hi, Does anyone here know how to record the live stream? i'm already broadcasting but i need to record the session.

  • @kindersurprise5164
    @kindersurprise5164 4 года назад +1

    right what i looking for, thanks for the useful information!

  • @Lordblanca
    @Lordblanca 4 года назад +1

    What would be the configuration for https: What else is needed Thank you

    • @kSavvy
      @kSavvy 4 года назад +1

      its been a while, so I am sure you found out, but this guy: ruclips.net/video/Y-9kVF6bWr4/видео.html goes through "lets encrypt" and "cert bot" at the end to get that going.

  • @LAGOONMOB
    @LAGOONMOB Год назад

    Useful tutorial! A question: would this be a good starting solution for a real project? I mean to create a RUclips-like platform

  • @samansamadi1656
    @samansamadi1656 3 месяца назад

    Thanks for sharing❤❤

  • @antena.vushtrri
    @antena.vushtrri 3 года назад

    please help me doing it .... im not good at it ....can you set up one for me pleae

  • @PhongsakornW
    @PhongsakornW 3 года назад

    can add some logo by url to RTMP And Show logo on Stream playback?

  • @rezang5026
    @rezang5026 2 года назад

    does this work on the Free nginx version..?

  • @dmitryponyatov2158
    @dmitryponyatov2158 3 года назад

    what free plugins can turn it into a SOHO-class Security Video Control System server?
    UI with time-based rewind, movement tracking, static fragments cutoff

  • @IgorLjevak
    @IgorLjevak 3 года назад

    do i need to use linux to install?

  • @asifmomin4923
    @asifmomin4923 3 года назад

    Hi,
    Can we configure IP cameras with Nginix for live streaming?

  • @shivangpatel
    @shivangpatel 4 года назад +1

    Can I make this kind of production media server in KUBERNETES ? Or I want to ask that, Is is good idea or not for media servers ?

    • @outcast341
      @outcast341 4 года назад +2

      You can do that easily in kubernetes, I don't currently have a walk through of that. But it should easy enough to pass the configuration to the pod if you are familiar with the process.

  • @np13_
    @np13_ 3 года назад

    You saved my life. Thank you so much

  • @jefftaylor9882
    @jefftaylor9882 4 года назад

    I followed the instructions very closely and tried twice but each time at the copy step it tells me that it is not able to write the file no such file or directory exists, but all of the files are there. I am using Ubuntu 20.04 and the latest from Nginx. Has something changed ?

    • @kumartatsat868
      @kumartatsat868 3 года назад

      James had the configuration file on his local machine, so he directly copied the config file. Do you ACTUALLY have the config file on YOUR machine?

  • @johnlpz2806
    @johnlpz2806 4 года назад

    hi. Can i do this in windows? i downloaded the Nginx windows, I can get the nginx to start and view the HTML but once I add the code for RTMP. nginx will not run. thanks

    • @ahmedhassan7030
      @ahmedhassan7030 3 года назад +1

      That is because the default nginx does not have the RTMP module for windows either I guess. try one with RTMP module

    • @johnlpz2806
      @johnlpz2806 3 года назад

      @@ahmedhassan7030 yes, i got it to work.

  • @gantzff
    @gantzff 2 года назад

    thank you very much!!!!!!!!!! for this tutorial!!!!

  • @nassan8472
    @nassan8472 4 года назад

    Great Tutorial, if possible could you please share the config file for ingest (master)and worker node (Streaming Servers), i am trying to setup in K8s. Thanks

  • @manoliskokkinakis8862
    @manoliskokkinakis8862 4 года назад

    On a Debian 8 if you use "sudo apt-get install nginx" instead of "git clone" is there any difference?

    • @ahmedhassan7030
      @ahmedhassan7030 3 года назад

      The default nginx usually doesn't have the RTMP module I guess. you can try it

    • @kumartatsat868
      @kumartatsat868 3 года назад

      @@ahmedhassan7030 what if we download the libnginx-mod-rtmp package? It's in the repository.

  • @flavatech5938
    @flavatech5938 3 года назад

    please can someone tell me what the ./configure command is & what is does ? is it a pre installed command from Ubuntu ? Everytime i run the ./configure XXXXXX command i get an error "no such file or directory. PLease, please help !

    • @ahmedhassan7030
      @ahmedhassan7030 3 года назад

      make sure the configure script is there in the same directory that you are running it. ./configure means you calling for a file name configure. according to the video, that is inside auto I guess

  • @alphiuswambua9512
    @alphiuswambua9512 4 года назад

    How do I test this using html like video.js

  • @ashupednekar6989
    @ashupednekar6989 4 года назад

    Does nginx support rtsp (udp) ?

  • @omfgbunder2008
    @omfgbunder2008 2 года назад +1

    Shouldn't these videos be more synchronized since they're coming from the same ingest?

  • @jebadi25
    @jebadi25 4 года назад

    Hola, alguien sabe porque tengo este error, cuando ejecuto el comando "make"
    ../nginx-rtmp-module/ngx_rtmp_eval.c: In function ‘ngx_rtmp_eval’:
    ../nginx-rtmp-module/ngx_rtmp_eval.c:160:17: error: this statement may fall through [-Werror=implicit-fallthrough=]
    160 | switch (c) {
    | ^~~~~~
    ../nginx-rtmp-module/ngx_rtmp_eval.c:170:13: note: here
    170 | case ESCAPE:
    | ^~~~
    cc1: all warnings being treated as errors
    make[1]: *** [objs/Makefile:1339: objs/addon/nginx-rtmp-module/ngx_rtmp_eval.o] Error 1
    make[1]: Leaving directory '/home/jerry/nginx/nginx'
    make: *** [Makefile:8: build] Error 2

  • @stefanislupu
    @stefanislupu 3 года назад

    NGINX Video Streaming supports two IP inputs

  • @andrewalvarez1480
    @andrewalvarez1480 4 года назад

    Hi, Awesome tutorial, I have my NGINX server deployed in GCP, but how do I get my Ingest IP address? is it the same External IP address?

    • @andrewalvarez1480
      @andrewalvarez1480 4 года назад

      also, how does NGINX transcode to HLS/DASH? does it make a call to ffmpeg under the hood? how does that step happen?

    • @outcast341
      @outcast341 4 года назад

      Andrew Alvarez I believe it would be the same as you external address. There is no transcoding. Nginx just changes the protocol for the video.

  • @YTimo
    @YTimo 4 года назад +1

    How to streame on Twicth with it

    • @pepperandrino466
      @pepperandrino466 4 года назад +2

      add a push option to the Twitch rtmp server of your choice with your stream key into the nginx.conf file under the "server {" options - e.g. :
      push rtmp://twitchserveraddress/streamkey;
      save config file, turn on/run nginx, then put rtmp://localhost:1935/live into OBS as the stream URL under Custom Streaming Server. you can put whatever you want as the stream key in OBS, or leave it blank, it doesn't matter here. :D

  • @alirezamirhabibi8039
    @alirezamirhabibi8039 4 года назад

    Informative, thanks a lot.

  • @Sharun_joseph
    @Sharun_joseph 4 года назад

    can you plz do a video on streaming from obs to the server and fetch the embed code to put on a web page.

    • @eniolasonowo8945
      @eniolasonowo8945 4 года назад

      Hi, have u done it, ill like to embed on a webpage also

  • @davidbenini8144
    @davidbenini8144 4 года назад +1

    on centOS this is wrong " sudo yum groupinstall pcre-dev pcre-devel zlib-devel openssl-devel" not groupinstall, just install and pcre-dev not exist

    • @outcast341
      @outcast341 4 года назад +1

      You are correct. Looks like a typo. the correct line should be "sudo yum install pcre-devel zlib-devel openssl-devel". I will get the blog posted corrected.

  • @truesightgrabber
    @truesightgrabber 4 года назад +1

    How to setup stream key most Streaming software required, like OBS ?

    • @pepperandrino466
      @pepperandrino466 4 года назад +2

      add a push option to the rtmp server with your stream key into the nginx.conf file under the "server {" options - e.g. "push rtmp://serveraddress/streamkey;" - without quotes, save config file, turn on/run nginx, then put rtmp://localhost:1935/live into OBS as the stream URL under Custom Streaming Server. you can put whatever you want as the stream key in OBS, or leave it blank, it doesn't matter here. :D
      -quoted from my previous response. not sure how youtube works. you might get a notification. ;)

  • @Automagskb
    @Automagskb 4 года назад

    Hi it was great video , i subscribed your channel in first look, Can you help me over a point that how can i make changes in any config files of nginx like if i have created an rtmp.conf file and you know the basic application of this to push any live video stream to any cdn , i just wanted to make a web page that can allow me /user to fill whatever user wants in that web page and the same url can also get updated in that particular rtmp.conf file.
    Can you share any idea or any other brilliant guys who are reading my comments here ??

  • @AmxCsifier
    @AmxCsifier 4 года назад

    Scary topic made friendly!

  • @googleppe
    @googleppe 2 года назад

    Ciao, thank you for this very comprensive tutorial. I got my server up in few minutes.

  • @keshavanand6575
    @keshavanand6575 4 года назад +1

    can you guys make a video on how to setup an ott platform with multiple videos without encoding

  • @CGRB
    @CGRB 4 года назад

    Thank you

  • @MelvinVega
    @MelvinVega 4 года назад

    Love it.. Thanks

  • @alesilva4079
    @alesilva4079 3 года назад

    cool, but this is video on demand not "live" streaming, right ?

    • @alex-west
      @alex-west 3 года назад

      Can work with both! It depends on what you use as input and as output

  • @avmediaworks2050
    @avmediaworks2050 4 года назад

    auto conf... rtmp module instalation [-Werror=implicit-fallthrough=]
    160 | switch (c)

    • @thebiscuittin
      @thebiscuittin 4 года назад

      Use this flag with the configure command -with-cc-opt="-Wimplicit-fallthrough=0"

  • @christophefreijanes535
    @christophefreijanes535 4 года назад

    Does It's same install & configuration for Centos ?

  • @bangkokinternationalshoppi5230
    @bangkokinternationalshoppi5230 4 года назад

    very good

  • @Ton_DayTrader
    @Ton_DayTrader 4 года назад

    How to stream https

  • @AntiWanted
    @AntiWanted 4 года назад

    Nice

  • @taf8903
    @taf8903 4 года назад

    Leon Lush + Linux

  • @eugenefedorov3498
    @eugenefedorov3498 3 года назад

    After i did make install i dont see folder "nginx" in my "/etc/" so there is not way to configurate.

  • @webmaster2270
    @webmaster2270 3 года назад

    when "sudo cp .....", no such file

  • @clouddancer9
    @clouddancer9 4 года назад

    found a solution and it working on CentOS 7

  • @bravowaqas
    @bravowaqas 2 года назад

    The video not clear..

  • @pixel9music
    @pixel9music 11 месяцев назад

    Hi Tony Stark

  • @moodsmoods12345
    @moodsmoods12345 4 года назад

    without gui it is really hard the controls.

  • @balckeagle2024
    @balckeagle2024 4 года назад

    He is more scary and worried like me i present my projects hahaha

  • @maksadbek
    @maksadbek 3 года назад

    Heck, this stupid squirrel killed the butterfly

  • @djrockhog9995
    @djrockhog9995 2 года назад

    Sucks You Cant Do This On Windows Just Only On Linux Which I Thick Is Stupid Its Should Be Cross Platform

  • @solodios420
    @solodios420 3 года назад

    nginx not fond

  • @PixelShaderPl
    @PixelShaderPl 3 года назад

    8:47
    sudo cp ~/nginx.conf /usr/local/nginx/conf cp: cannot stat '/home/pixel/nginx.conf': No such file or directory
    sudo /usr/local/nginx/sbin/nginx -t
    nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful