Create a Live Stream with Nginx and FFmpeg using HLS RTMP and Docker Compose

Поділитися
Вставка
  • Опубліковано 23 січ 2025

КОМЕНТАРІ • 50

  • @mr_tpk
    @mr_tpk 7 місяців тому +1

    Thank you for sharing this wonderful tutorial. With your guidance I was able to implement a live streaming app in Python. Thanks a lot dude. Keep up the good work.

  • @sebastiannietor9724
    @sebastiannietor9724 5 днів тому

    If i want to record the streaming as you mentioned, Where would it be stored?

  • @gardnerjp1
    @gardnerjp1 7 днів тому

    Cool tutorial - is there a github repo for the project?

  • @scratchguy5851
    @scratchguy5851 5 місяців тому +1

    Hello, I'm getting an error like this whenever I start. Is there any fix for this?
    ! ffmpeg Warning pull access denied for ffmpeg-i, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
    ! nginx Warning pull access denied for nginx-i, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

    • @WittCode
      @WittCode  5 місяців тому

      Looks like you're trying to pull an image called ffmpeg-i from an online repo. ffmpeg-i is what I called the image. The actual image is just called ffmpeg

    • @scratchguy5851
      @scratchguy5851 5 місяців тому

      @@WittCode Ok but I ran into another problem, it says The system cannot find the file specified.
      ffmpeg:
      image: ffmpeg
      container_name: ${FFMPEG_HOST}
      build:
      context: ./ffmpeg
      dockerfile: Dockerfile
      env_file: .env
      depends_on:
      - nginx

    • @WittCode
      @WittCode  5 місяців тому

      @@scratchguy5851 The issue is in the message. It can't find the file

    • @scratchguy5851
      @scratchguy5851 5 місяців тому

      @@WittCode Thank you sir, I reinstalled Docker and it fixed all the errors

    • @WittCode
      @WittCode  5 місяців тому +1

      @@scratchguy5851 Interesting! But hey if it works it works!

  • @GMNNATBR
    @GMNNATBR 6 місяців тому +1

    to change the video file to an RTMP camera input?

    • @WittCode
      @WittCode  5 місяців тому

      Sounds like a future video idea!

    • @hugo-abdou
      @hugo-abdou 4 місяці тому

      ​@@WittCode yes please wee nead to know how to stream directly from the webcam to server then to the viewers like Facebook lives or youtube

    • @xluzka
      @xluzka 3 місяці тому +1

      @@hugo-abdou Did u get it?

    • @hugo-abdou
      @hugo-abdou Місяць тому

      ​@@xluzka not yet 😢

  • @mrmelo9510
    @mrmelo9510 2 місяці тому

    How would you stream a "playlist" of MP4 files in a folder to play sequentially?

    • @WittCode
      @WittCode  2 місяці тому

      There are a few ways! You could spin up an application server in Node, Python, etc. to handle the streams. Nginx also might have a library to play things sequentially

  • @shaun7611
    @shaun7611 2 місяці тому

    is the nginx-proxy-manger in truenas scale the same on what you used?

    • @WittCode
      @WittCode  2 місяці тому +1

      I'm not actually sure what truenas scale is? I just used the official docker nginx image

  • @andresgomez4030
    @andresgomez4030 24 дні тому

    would it be possible to embed this into a grafana dashboard?

    • @shashanoid
      @shashanoid 19 днів тому

      I believe if you can add s then yea?

  • @danliciousxs4415
    @danliciousxs4415 4 місяці тому

    Hey, I wanted to ask how I can use an RTMP link as the input instead of a video file?

    • @WittCode
      @WittCode  4 місяці тому

      I don't know off the top of my head but I would suggest checking the ffmpeg docs. You probably just have to change the command to stream from a link as opposed to a file.

  • @terfy
    @terfy 4 місяці тому

    so.. this is a live stream.. what about if you just want to serve a youtube like service, on-demand videos ?.. and how many dockers should I create then ? one for each video ?

    • @WittCode
      @WittCode  3 місяці тому

      That's a fully loaded question! I wouldn't spin up a container per video though. You would just have multiple streams at once. You containerize each process not each video!

  • @vkeychaudhari
    @vkeychaudhari 3 місяці тому

    Can I stream a live screen share with sound?

  • @Ayoubz73
    @Ayoubz73 4 місяці тому

    now how can i host this live thats i want to stream the live in my host web site how can or is possible

    • @WittCode
      @WittCode  4 місяці тому

      That's the beauty of Docker! You can just get a cheap VPS, spin this up there, and change the locations to that server.

  • @hedonismbot3274
    @hedonismbot3274 Місяць тому

    So if I want to stram via obs to a single friend in 1080p+ i can with this right ? Total noob here. Thanks good video.

  • @shaun7611
    @shaun7611 2 місяці тому

    Was this a re-upload? You mention flash, which doesn't work any more?

    • @WittCode
      @WittCode  2 місяці тому

      No it wasn't. What did I say about flash? I can't remember

    • @shaun7611
      @shaun7611 2 місяці тому

      @@WittCode hahaha ill watch again and time stamp it

    • @shaun7611
      @shaun7611 2 місяці тому

      @@WittCode 7:38

    • @WittCode
      @WittCode  2 місяці тому

      @@shaun7611 From what I recall flash is different from flash format. That flv is a format while you're thinking of Adobe flash?

  • @romeocaillon2506
    @romeocaillon2506 4 місяці тому

    Thank you for the video and the comprehensive blog. I've deployed this code on a vps server, but unfortunately I can't get it to work.
    I have
    The media could not be loaded, either because the server or network failed or because the format is not supported.
    Maybe someone else also had this error and managed to solve it.

    • @WittCode
      @WittCode  4 місяці тому

      Hey there thanks for watching! Are there any more logs than just that? Check the logs in each of the containers. Also what is the video format you are using?

  • @matthewdraevich4214
    @matthewdraevich4214 4 місяці тому

    great tutorial.
    I do have a question if possible :)
    So, you stream the video file live. But how is it possible to stream live while allowing viewers to rewind? For example, UA-cam offers the ability to watch a live stream from an earlier timestamp.
    As I can guess, it somehow related to your backend implementation rather than to NGINX configuration. So, an ingester will stream its video using RTMP, then our backend will assemble it to a video file and then forward the stream to NGINX/CDN over HLS/DASH?
    Hope the question is clear.

    • @WittCode
      @WittCode  4 місяці тому

      Yeah I think that could actually be implemented through the HTML Video element. You could use the currentTime attribute or something along those lines?

  • @SunHouse-APTO61
    @SunHouse-APTO61 5 місяців тому

    Good video, do you have the repository with all the files you used?

    • @WittCode
      @WittCode  5 місяців тому

      hey there! yup my blog site in the description should contain everything!

  • @thiagocosme242
    @thiagocosme242 7 місяців тому

    Good job, i need code with python

  • @weekipi5813
    @weekipi5813 2 місяці тому

    how is this a live streaming.. this is streaming a file, it's not a live streaming

    • @WittCode
      @WittCode  2 місяці тому

      If you want to be that specific fair enough. If you want to real live streaming just change the input

    • @PbaTv7
      @PbaTv7 День тому

      ​@@WittCode how