mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
add forward sample
This commit is contained in:
parent
5cc1ad6da8
commit
5502344e85
5 changed files with 47 additions and 22 deletions
19
README.md
19
README.md
|
@ -22,11 +22,15 @@ step 2: start srs <br/>
|
|||
<pre>
|
||||
./objs/simple_rtmp_server -c conf/srs.conf
|
||||
</pre>
|
||||
step 3(optional): start nginx for HLS <br/>
|
||||
step 3(optinal): start srs listen at 19350 for forward<br/>
|
||||
<pre>
|
||||
./objs/simple_rtmp_server -c conf/srs.19350.conf
|
||||
</pre>
|
||||
step 4(optional): start nginx for HLS <br/>
|
||||
<pre>
|
||||
sudo ./objs/nginx/sbin/nginx
|
||||
</pre>
|
||||
step 4: publish live stream <br/>
|
||||
step 5: publish live stream <br/>
|
||||
<pre>
|
||||
FMS URL: rtmp://127.0.0.1:1935/live
|
||||
Stream: livestream
|
||||
|
@ -37,18 +41,25 @@ For example, use ffmpeg to publish:
|
|||
sleep 1; \
|
||||
done
|
||||
</pre>
|
||||
step 5: play live stream <br/>
|
||||
step 6: play live stream <br/>
|
||||
<pre>
|
||||
rtmp url: rtmp://127.0.0.1:1935/live/livestream
|
||||
m3u8 url: http://127.0.0.1:80/live/livestream.m3u8
|
||||
</pre>
|
||||
step 6: play live stream auto transcoded<br/>
|
||||
step 7: play live stream auto transcoded<br/>
|
||||
<pre>
|
||||
rtmp url: rtmp://127.0.0.1:1935/live/livestream_ld
|
||||
m3u8 url: http://127.0.0.1:80/live/livestream_ld.m3u8
|
||||
rtmp url: rtmp://127.0.0.1:1935/live/livestream_sd
|
||||
m3u8 url: http://127.0.0.1:80/live/livestream_sd.m3u8
|
||||
</pre>
|
||||
step 8: play live stream auto forwarded, the hls dir change to /forward<br/>
|
||||
<pre>
|
||||
rtmp url: rtmp://127.0.0.1:19350/live/livestream_ld
|
||||
m3u8 url: http://127.0.0.1:80/forward/live/livestream_ld.m3u8
|
||||
rtmp url: rtmp://127.0.0.1:19350/live/livestream_sd
|
||||
m3u8 url: http://127.0.0.1:80/forward/live/livestream_sd.m3u8
|
||||
</pre>
|
||||
|
||||
### System Requirements
|
||||
Supported operating systems and hardware:
|
||||
|
|
|
@ -67,6 +67,9 @@ if [ $SRS_HLS = YES ]; then
|
|||
# nginx default use nobody, so cannot read the ts/m3u8 created by srs.
|
||||
cp ${SRS_OBJS}/nginx/conf/nginx.conf ${SRS_OBJS}/nginx/conf/nginx.conf.bk
|
||||
sed -i "s/^.user nobody;/user `whoami`;/g" ${SRS_OBJS}/nginx/conf/nginx.conf
|
||||
|
||||
# create forward dir
|
||||
mkdir -p ${SRS_OBJS}/nginx/html/forward
|
||||
fi
|
||||
|
||||
if [ $SRS_HLS = YES ]; then
|
||||
|
|
11
trunk/conf/srs.19350.conf
Executable file
11
trunk/conf/srs.19350.conf
Executable file
|
@ -0,0 +1,11 @@
|
|||
listen 19350;
|
||||
chunk_size 65000;
|
||||
vhost __defaultVhost__ {
|
||||
enabled on;
|
||||
gop_cache on;
|
||||
hls on;
|
||||
hls_path ./objs/nginx/html/forward;
|
||||
hls_fragment 5;
|
||||
hls_window 30;
|
||||
}
|
||||
|
|
@ -15,7 +15,7 @@ vhost __defaultVhost__ {
|
|||
hls_path ./objs/nginx/html;
|
||||
hls_fragment 5;
|
||||
hls_window 30;
|
||||
#forward 127.0.0.1:1936;
|
||||
forward 127.0.0.1:19350;
|
||||
transcode {
|
||||
enabled on;
|
||||
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
|
||||
|
@ -28,8 +28,8 @@ vhost __defaultVhost__ {
|
|||
vcodec libx264;
|
||||
vbitrate 300;
|
||||
vfps 20;
|
||||
vwidth 768;
|
||||
vheight 320;
|
||||
vwidth 1152;
|
||||
vheight 480;
|
||||
vthreads 1;
|
||||
vprofile baseline;
|
||||
vpreset superfast;
|
||||
|
@ -51,8 +51,8 @@ vhost __defaultVhost__ {
|
|||
vcodec libx264;
|
||||
vbitrate 500;
|
||||
vfps 20;
|
||||
vwidth 768;
|
||||
vheight 320;
|
||||
vwidth 1152;
|
||||
vheight 480;
|
||||
vthreads 1;
|
||||
vprofile main;
|
||||
vpreset fast;
|
||||
|
@ -81,8 +81,8 @@ vhost mirror.transcode.vhost.com {
|
|||
vcodec libx264;
|
||||
vbitrate 300;
|
||||
vfps 20;
|
||||
vwidth 480;
|
||||
vheight 320;
|
||||
vwidth 1152;
|
||||
vheight 480;
|
||||
vthreads 2;
|
||||
vprofile baseline;
|
||||
vpreset superfast;
|
||||
|
@ -111,8 +111,8 @@ vhost drawtext.transcode.vhost.com {
|
|||
vcodec libx264;
|
||||
vbitrate 300;
|
||||
vfps 20;
|
||||
vwidth 480;
|
||||
vheight 320;
|
||||
vwidth 1152;
|
||||
vheight 480;
|
||||
vthreads 2;
|
||||
vprofile baseline;
|
||||
vpreset superfast;
|
||||
|
@ -141,8 +141,8 @@ vhost crop.transcode.vhost.com {
|
|||
vcodec libx264;
|
||||
vbitrate 300;
|
||||
vfps 20;
|
||||
vwidth 480;
|
||||
vheight 320;
|
||||
vwidth 1152;
|
||||
vheight 480;
|
||||
vthreads 2;
|
||||
vprofile baseline;
|
||||
vpreset superfast;
|
||||
|
@ -171,8 +171,8 @@ vhost logo.transcode.vhost.com {
|
|||
vcodec libx264;
|
||||
vbitrate 300;
|
||||
vfps 20;
|
||||
vwidth 480;
|
||||
vheight 320;
|
||||
vwidth 1152;
|
||||
vheight 480;
|
||||
vthreads 2;
|
||||
vprofile baseline;
|
||||
vpreset superfast;
|
||||
|
@ -220,7 +220,7 @@ vhost all.transcode.vhost.com {
|
|||
# video framerate.
|
||||
vfps 25;
|
||||
# video width, must be even numbers.
|
||||
vwidth 1280;
|
||||
vwidth 1728;
|
||||
# video height, must be even numbers.
|
||||
vheight 720;
|
||||
# the max threads for ffmpeg to used.
|
||||
|
@ -268,7 +268,7 @@ vhost all.transcode.vhost.com {
|
|||
vcodec libx264;
|
||||
vbitrate 1200;
|
||||
vfps 25;
|
||||
vwidth 1024;
|
||||
vwidth 1382;
|
||||
vheight 576;
|
||||
vthreads 6;
|
||||
vprofile main;
|
||||
|
@ -288,7 +288,7 @@ vhost all.transcode.vhost.com {
|
|||
vcodec libx264;
|
||||
vbitrate 800;
|
||||
vfps 25;
|
||||
vwidth 720;
|
||||
vwidth 1152;
|
||||
vheight 480;
|
||||
vthreads 4;
|
||||
vprofile main;
|
||||
|
@ -308,7 +308,7 @@ vhost all.transcode.vhost.com {
|
|||
vcodec libx264;
|
||||
vbitrate 300;
|
||||
vfps 20;
|
||||
vwidth 480;
|
||||
vwidth 768;
|
||||
vheight 320;
|
||||
vthreads 2;
|
||||
vprofile baseline;
|
||||
|
@ -335,7 +335,7 @@ vhost ffempty.transcode.vhost.com {
|
|||
vcodec libx264;
|
||||
vbitrate 300;
|
||||
vfps 20;
|
||||
vwidth 480;
|
||||
vwidth 768;
|
||||
vheight 320;
|
||||
vthreads 2;
|
||||
vprofile baseline;
|
||||
|
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue