mirror of
https://github.com/arut/nginx-rtmp-module.git
synced 2025-08-06 15:00:18 +08:00
fixed code blocks
This commit is contained in:
76
index.html
76
index.html
@ -70,7 +70,7 @@ make
|
|||||||
make install
|
make install
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h2>Example nginx.conf</h2>
|
<h2>Examples of nginx.conf</h2>
|
||||||
|
|
||||||
<h3>Simple Live Streaming</h3>
|
<h3>Simple Live Streaming</h3>
|
||||||
|
|
||||||
@ -98,73 +98,59 @@ rtmp {
|
|||||||
|
|
||||||
<h3>Transcoding</h3>
|
<h3>Transcoding</h3>
|
||||||
<pre>
|
<pre>
|
||||||
application big {
|
application big {
|
||||||
live on;
|
live on;
|
||||||
|
exec /usr/bin/ffmpeg -re -i rtmp://localhost:1935/$app/$name -vcodec flv -acodec copy -s 32x32 -f flv rtmp://localhost:1935/small/${name};
|
||||||
|
}
|
||||||
|
|
||||||
# On every pusblished stream run this command (ffmpeg)
|
application small {
|
||||||
# with substitutions: $app/${app}, $name/${name} for application & stream name.
|
live on;
|
||||||
#
|
# Video with reduced resolution comes here from ffmpeg
|
||||||
# This ffmpeg call receives stream from this application &
|
}
|
||||||
# reduces the resolution down to 32x32. The stream is the published to
|
|
||||||
# 'small' application (see below) under the same name.
|
|
||||||
#
|
|
||||||
# ffmpeg can do anything with the stream like video/audio
|
|
||||||
# transcoding, resizing, altering container/codec params etc
|
|
||||||
#
|
|
||||||
# Multiple exec lines can be specified.
|
|
||||||
|
|
||||||
exec /usr/bin/ffmpeg -re -i rtmp://localhost:1935/$app/$name -vcodec flv -acodec copy -s 32x32 -f flv rtmp://localhost:1935/small/${name};
|
|
||||||
}
|
|
||||||
|
|
||||||
application small {
|
|
||||||
live on;
|
|
||||||
# Video with reduced resolution comes here from ffmpeg
|
|
||||||
}
|
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Pushing stream</h3>
|
<h3>Pushing stream</h3>
|
||||||
<pre>
|
<pre>
|
||||||
application mypush {
|
application mypush {
|
||||||
live on;
|
live on;
|
||||||
|
|
||||||
# Every stream published here
|
# Every stream published here
|
||||||
# is automatically pushed to
|
# is automatically pushed to
|
||||||
# these two machines
|
# these two machines
|
||||||
push rtmp1.example.com;
|
push rtmp1.example.com;
|
||||||
push rtmp2.example.com:1934;
|
push rtmp2.example.com:1934;
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Pulling stream</h3>
|
<h3>Pulling stream</h3>
|
||||||
<pre>
|
<pre>
|
||||||
application mypull {
|
application mypull {
|
||||||
live on;
|
live on;
|
||||||
|
|
||||||
# Pull all streams from remote machine
|
# Pull all streams from remote machine
|
||||||
# and play locally
|
# and play locally
|
||||||
pull rtmp://rtmp3.example.com pageUrl=www.example.com/index.html;
|
pull rtmp://rtmp3.example.com pageUrl=www.example.com/index.html;
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Video on demand</h3>
|
<h3>Video on demand</h3>
|
||||||
<pre>
|
<pre>
|
||||||
application vod {
|
application vod {
|
||||||
play /var/flvs;
|
play /var/flvs;
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>HLS (HTTP Live Streaming)</h3>
|
<h3>HLS (HTTP Live Streaming)</h3>
|
||||||
<pre>
|
<pre>
|
||||||
application hls {
|
application hls {
|
||||||
hls on;
|
hls on;
|
||||||
hls_path /tmp/app;
|
hls_path /tmp/app;
|
||||||
hls_fragment 5s;
|
hls_fragment 5s;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
<h2>>Donation:</h2>
|
<h2>Donation:</h2>
|
||||||
|
|
||||||
<h3>PayPal</h3>
|
<h3>PayPal</h3>
|
||||||
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
||||||
|
Reference in New Issue
Block a user