<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Nginx%3A_HLS_dari_RTMP</id>
	<title>Nginx: HLS dari RTMP - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Nginx%3A_HLS_dari_RTMP"/>
	<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Nginx:_HLS_dari_RTMP&amp;action=history"/>
	<updated>2026-04-21T04:44:13Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://lms.onnocenter.or.id/wiki/index.php?title=Nginx:_HLS_dari_RTMP&amp;diff=40966&amp;oldid=prev</id>
		<title>Onnowpurbo: New page: Sumber: http://www.helping-squad.com/nginx-rtmp-hls-or-dash-streaming/  We already looked at using our nginx-rtmp server to transcode our streams or to deliver them to more than one locati...</title>
		<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Nginx:_HLS_dari_RTMP&amp;diff=40966&amp;oldid=prev"/>
		<updated>2014-08-24T01:49:55Z</updated>

		<summary type="html">&lt;p&gt;New page: Sumber: http://www.helping-squad.com/nginx-rtmp-hls-or-dash-streaming/  We already looked at using our nginx-rtmp server to transcode our streams or to deliver them to more than one locati...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Sumber: http://www.helping-squad.com/nginx-rtmp-hls-or-dash-streaming/&lt;br /&gt;
&lt;br /&gt;
We already looked at using our nginx-rtmp server to transcode our streams or to deliver them to more than one location. But another very nice feature, especially for mobile devices is the option to offer streams using HLS or Mpeg-Dash.&lt;br /&gt;
&lt;br /&gt;
    Dash explanation&lt;br /&gt;
    HLS explanation&lt;br /&gt;
&lt;br /&gt;
In nginx-rtmp, both features are actually quite easy to use, but they depend on a few factors:&lt;br /&gt;
&lt;br /&gt;
    both HLS and DASH need their own temp folder which we define in our settings soon&lt;br /&gt;
    your input stream should use the baseline H264 profile for Iphones etc.&lt;br /&gt;
&lt;br /&gt;
In the nginx config we have to change our http section as well as our application, both in the nginx.conf:&lt;br /&gt;
&lt;br /&gt;
http {&lt;br /&gt;
&lt;br /&gt;
    server {&lt;br /&gt;
&lt;br /&gt;
        listen      8080;&lt;br /&gt;
&lt;br /&gt;
        location /hls {&lt;br /&gt;
            # Serve HLS fragments&lt;br /&gt;
            types {&lt;br /&gt;
                application/vnd.apple.mpegurl m3u8;&lt;br /&gt;
                video/mp2t ts;&lt;br /&gt;
            }&lt;br /&gt;
            root /tmp;&lt;br /&gt;
            add_header Cache-Control no-cache;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        location /dash {&lt;br /&gt;
            # Serve DASH fragments&lt;br /&gt;
            root /tmp;&lt;br /&gt;
            add_header Cache-Control no-cache;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
So we need a folder tmp/dash and tmp/hls in our root folder for nginx. And in the rtmp section:&lt;br /&gt;
&lt;br /&gt;
rtmp {&lt;br /&gt;
&lt;br /&gt;
    server {&lt;br /&gt;
&lt;br /&gt;
        listen 1935;&lt;br /&gt;
        chunk_size 4000;&lt;br /&gt;
&lt;br /&gt;
        application hls {&lt;br /&gt;
            live on;&lt;br /&gt;
            hls on;&lt;br /&gt;
            hls_path /tmp/hls;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # MPEG-DASH is similar to HLS&lt;br /&gt;
&lt;br /&gt;
        application dash {&lt;br /&gt;
            live on;&lt;br /&gt;
            dash on;&lt;br /&gt;
            dash_path /tmp/dash;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
That is pretty much all we need. In his example configuration arut also shows us a simple ffmpeg configuration to stream a movie to either of the applications:&lt;br /&gt;
&lt;br /&gt;
        # ffmpeg -loglevel verbose -re -i movie.avi  -vcodec libx264&lt;br /&gt;
        #    -vprofile baseline -acodec libmp3lame -ar 44100 -ac 1&lt;br /&gt;
        #    -f flv rtmp://localhost:1935/hls/movie&lt;br /&gt;
&lt;br /&gt;
Now you are ready to go and test the stream on your mobile. There are different ways to playback the stream so you will probably want to google the best solution for your system (Android/iOS/WP). &lt;br /&gt;
&lt;br /&gt;
Default playlist address in this setup is:&lt;br /&gt;
&lt;br /&gt;
    http://server.ip/hls/StreamKey.m3u8 &lt;br /&gt;
&lt;br /&gt;
The StreamKey in our example ffmpeg commandline was “movie”. Remember, the rtmp address is always rtmp://ip/ApplicationName/StreamKey. If you have questions, as always, post them below!&lt;/div&gt;</summary>
		<author><name>Onnowpurbo</name></author>
	</entry>
</feed>