Setup a simple Video on Demand Server with nginx-rtmp


Checkout: | |

You may also like...

16 Responses

  1. Phong Dao says:

    Thank you so much!!
    I have a problem. I have a video storage in other server and I have link to download or view this video on browser. So may I can rtmp stream this video as VOD?

  2. Natzo says:

    Hi, is there a way to store the jwplayer locally instead of using the cloud hosting address in html file?

  3. HappyChild says:

    Also just a file in root is not working. in Mobile.
    at script,
    rtmp://myDNS/vod/ABC.mp4 is not woking in Mobile.

    i see the same error message. “Error loading player: No playable sources found”

  4. HappyChild says:

    hi. i could’t see video in my smartphone, base browser and opera browser. the error message is
    “Error loading player. No playable sources found”
    But At myPC browser, I.E or Chrome, playing the streaming has no problem.

    I used this script in my website board. in below.


    flashplayer: “/jwplayer/jwplayer.flash.swf”,
    file: “rtmp://myDNS/vod/mp4:sub/ABC720.mp4”,
    height: 406,
    width: 720

    In nginx.conf , application section , named vod.
    so, At above script,
    rtmp://myDNS/vod/sub/ABC.mp4 is not working.
    rtmp://myDNS/vod//sub/ABC.mp4 is not worikg.
    of courese, using port or not, no problem. i did not used port 1935 . i guess the port 1935 is default like FTP port 21, web port 80.

    anyway just rtmp://myDNS/vod/mp4:sub/ABC.mp4 is working.

    but at smartphone it did not played

  5. Miguel Granados says:

    Hi, excuse me, do you have founded a way to play a vod stream from a file in a subfolder?

    My rtmp application works fine if the mp4 is on the root. But if it’s on subfolder it’s not loading. I have founded some articles about this but even when i have tried to play with “folder//subfolder” or “folder:subfolder” it’s not working.

    I’m trying to play the rtmp stream with jwplayer.

    It’s working with the file on root:

    But i have another file in gravity/gravity.mp4 and it does not play.
    I’ve tried: rtmp://

    But no one works.

    It could be great if you know what to do about this.

    Thanks in advance.

    • RobinJack0r says:

      hey I updated the post a bit to make it clearer:
      rtmp:// (for nginx)
      rtmp:// (for jwplayer)
      “rtmp:// app=vod playpath=gravity/gravity.mp4” (for ffplay/ffmpeg)
      hope that helps :)

  6. happyChild says:

    Thanks a lot!!. But I have a problem as above. NginX does not recognize vod’s path/path/path. just vod/ , only root. why?
    I have F:\vod\2014\abc.mp4.
    in .conf , application vod; , play F:\vod,
    rtmp://ipaddr/vod/2014/abc.mp4 dose not working, vod//2014/abc.mp4 also not working. .

    my nginx-rtmp version is
    Is there any solution for file path?

  7. rl says:

    Hi, very good guide, I tried it myself but I’m only getting “Error loading stream: ID not found on server”. According to jwplayer the rtmp server connection was successful but it fails to return the requested stream.

    in nginx log it says at that time:
    2014/08/12 13:32:08 [info] 228#10040: *76 client connected ‘’
    2014/08/12 13:32:08 [info] 228#10040: *76 connect: app=’vid’ args=” flashver=’WIN 14,0,0,145′ swf_url=’http://localhost:8777/jwplayer/jwplayer.flash.swf’ tc_url=’rtmp://dev02:1935/vid/’ page_url=’http://localhost:8777/rtmp.html’ acodecs=3575 vcodecs=252 object_encoding=0, client:, server:
    2014/08/12 13:32:08 [info] 228#10040: *76 createStream, client:, server:
    2014/08/12 13:32:08 [info] 228#10040: *76 play: name=’mp4:preview.mp4′ args=” start=0 duration=0 reset=0 silent=0, client:, server:
    2014/08/12 13:32:08 [info] 228#10040: *76 play: play name=’mp4:preview.mp4′ timestamp=0, client:, server:
    2014/08/12 13:32:08 [info] 228#10040: *76 disconnect, client:, server:
    2014/08/12 13:32:08 [info] 228#10040: *76 deleteStream, client:, server:

    any ideas how to solve that?

  8. Boyd Badten says:

    Thanks for the links. I remember seeing some of those while researching for creating the edge repeater.

    It’s interesting to note the pricing levels that were set by (commercial version). I did check them out but it would cost me in the same range as buying another Wowza license so it doesn’t make sense for me since I’m very experienced with Wowza and it handles my traffic loads fine. I guess they know what they are doing. My goals with nginx are to meet some needs which don’t justify spending $1500 (Wowza raised their prices….)

    I’ll just have to dive into learning how to use FFMPEG.

    You probably can tell that my use of OBS, XSplit, nginx, Wowza, JWPlayer, etc. is not for gaming—it’s for my job with a non-profit company who does a lot of live streaming and VOD of educational and inspirational materials. All these tools work great for us and I’m just very grateful now to have another way to deploy HLS streaming at such a low cost (with nginx).

    You probably already know about these guys, but I’m having great success with Digital Ocean for super low cost, fast to deploy cloud servers:

    I have no vested interest in them. I just like their service. I have both Wowza and nginx servers running on cloud servers with them and they work great and they are *cheap, cheap, cheap*.

    Thanks again for your help Robin.

  9. Boyd Badten says:

    Thanks Robin–I appreciate your site very much. I have used your help instructions to set up two streaming servers–a live HLS streaming server and an HLS streaming repeater, using nginx. I use Wowza and JW Player extensively also. We have two Wowza servers for vod and live streaming. I’ve used Red5 for some limited applications also. I’m amazed now at how powerful and valuable this nginx rtmp module is. I needed an HLS edge repeater recently and I really didn’t wish to spend $1500 for another Wowza license. Well, with the help of your site and other examples I found on the web I now have a functioning HLS edge repeater and I’m only paying $10/mo for the Ubuntu cloud server to host it…..great solution for me.

    Regarding your comment above about combining various example codes to make a VOD HLS server–do you think it would involve an exec ffmp to get do this? I have seen the examples but I have not played with ffmp yet with nginx. Or else I guess one could figure out a way to create folders of HLS pre-fragmented pieces along with playlists. Perhaps you could meditate on it and see what you think is the most efficient way to host a modest number of VOD HLS videos from a store of h264 encoded MP4’s….

    Thanks again for your very helpful site!!!

Leave a Reply

Your email address will not be published. Required fields are marked *