Today I'm announcing the first release 0.1.0 of nginx-ts-module. The module provides HLS and MPEG-DASH live streaming capabilities for those who want a lightweight solution based on the HTTP protocol. The stream is published in the MPEG-TS format over HTTP. This makes it possible to use all the power and flexibility of nginx HTTP configurations including SSL, access control, logging, request limiting etc. MPEG-TS is a widely adopted, well known and well documented streaming format.
Currently, the module supports three directives: ts, ts_hls, ts_dash. The first directive enables receiving the MPEG-TS stream. The following two directives enable generating HLS and MPEG-DASH files.
Example:
http {
server {
listen 8000;
location /publish/ {
# This directive sets unlimited request body size
client_max_body_size 0;
ts;
ts_hls path=/var/media/hls segment=10s;
ts_dash path=/var/media/dash segment=10s;
}
location /play/ {
types {
application/x-mpegURL m3u8;
application/dash+xml mpd;
video/MP2T ts;
video/mp4 mp4;
}
alias /var/media/;
}
}
}
To publish a stream, invoke ffmpeg like this:
$ ffmpeg -re -i ~/Movies/sintel.mp4 -bsf:v h264_mp4toannexb
-c copy -f mpegts http://127.0.0.1:8000/publish/sintel
HLS can be played primarily in Safari and mobile devices using the following HTML:
<body>
<video width="640" height="480" controls autoplay
src="http://127.0.0.1:8000/play/hls/sintel/index.m3u8">
</video>
</body>
MPEG-DASH is now supported on most browsers including Chrome, Firefox, Safari. To play the stream, the dash.js player can be used like this:
<script src="http://cdn.dashjs.org/latest/dash.all.min.js"></script>
<body>
<video data-dashjs-player
width="640" height="480" controls autoplay
src="http://127.0.0.1:8000/play/dash/sintel/index.mpd">
</video>
</body>
For more details refer to the README.rst file in the project root.
Great work you have put here, However I was able to use this and also host a test html page but I could not with a php page...
ReplyDeleteHow can I include php page parameters to the nginx, I have tried severally but it failed
Mobdro Premium is a global version with millions of downloads and use every day. Mobdro is the best application for watching TV online watching movies, sports, news and music 2020.
DeleteHi, not sure if this is covered somewhere, what happens when two different cams publish to the same stream?
ReplyDeleteExcellent blog. Amazing work Roman.
ReplyDeleteHi Roman,
ReplyDeleteYour blogs have been very helpful to me as a student.
I need a little help, can you please share and overview on how to authenticate streams based on user session whether they have access to a particular stream pr not.
Thanks in Advance :)
Great work.
ReplyDeleteHow can I limit the concurrent conextion and obtain the stats? AnyA idea?
Thank you very much
hello,
ReplyDeleteIm getting an error when I run the conf:
nginx: [emerg] unknown directive "ts"
Hello Roman,
ReplyDeleteis there a way to publish a video playlist as rtmp stream in a loop? I have added the .m3u8 playlist and the videos (mp4) to my server (/usr/local/nginx/Videos). I can play this video with rtmp://myip/Video/video01.mp4
But when i try rtmp://myip/Video/video.m3u8 he doesnt play the playlist.
My conf:
application video{
live on;
meta copy;
play all:
play /usr/local/nginx/Videos/;
}
I appreciate any help. Greetings from Germany!
Hi Roman,
ReplyDeleteDo you think your module could be used to ingest (receive) an HLS push feed from another origin? I am exploring leveraging nginx for some custom solutions and this would be one of them (replacing RTMP/mp4 on the ingest/upstream side).. this stream would then be exposed for origin-pull duties.
based on ffserver documentation, multiple request (from clients) for the same camera feed, ffserver is able to service them without having one camera feed to one client being opened. Thus my question is whether nginx can do the similar thing? thanks
ReplyDeleteLive streaming is the latest fad on social media so make sure to get live with your audience from time to time.
ReplyDeleteLive streaming would give you a more intimate space with your viewers and encourage them to interact with you more often. It would allow more personal interaction with your audience in real time.
You can also share your live videos later, so that those who have missed out the live streaming can view them again. A tour of your business, a demonstration of your products or an interview with the creators are some of the possible content which can be created with a live video.
Make sure to make the most out of the apps which allows you to go live directly from the blog.
Online TV is very popular, especially Mobdro premium is a great upgrade version for all devices used for free. This is software provided by www.mobdroplus.com with many popular and popular TV channels.
ReplyDeleteHello sir Can you please explain the method of making .m3u8 links I want to make a link of PTV Sports
ReplyDeleteThis is very amazing blog. I love hockey and loved to read this stuff. Thanks for sharing this information. allcelebrityplanet
ReplyDelete
ReplyDeleteGood post thanks for share information.
minecraft optifine
netflix apk mod
ReplyDeletehttps://sites.google.com/view/pobreflix-apk
https://sites.google.com/view/dls2021apkmod
https://sites.google.com/view/futemaxapk