mirror of
				https://github.com/ossrs/srs.git
				synced 2025-03-09 15:49:59 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			153 lines
		
	
	
	
		
			4.3 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			153 lines
		
	
	
	
		
			4.3 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
# the config for srs demo
 | 
						|
# @see https://github.com/winlinvip/simple-rtmp-server/wiki/SampleDemo
 | 
						|
# @see full.conf for detail config.
 | 
						|
 | 
						|
listen              1935;
 | 
						|
daemon              on;
 | 
						|
srs_log_tank        file;
 | 
						|
srs_log_file        ./objs/demo.log;
 | 
						|
pid                 ./objs/srs.demo.pid;
 | 
						|
 | 
						|
chunk_size          60000;
 | 
						|
max_connections     2000;
 | 
						|
 | 
						|
vhost __defaultVhost__ {
 | 
						|
    enabled         on;
 | 
						|
    gop_cache       on;
 | 
						|
}
 | 
						|
 | 
						|
vhost bandcheck.srs.com {
 | 
						|
    enabled         on;
 | 
						|
    chunk_size      65000;
 | 
						|
    bandcheck {
 | 
						|
        enabled         on;
 | 
						|
        key             "35c9b402c12a7246868752e2878f7e0e";
 | 
						|
        interval        30;
 | 
						|
        limit_kbps      4000;
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
vhost demo.srs.com {
 | 
						|
    chunk_size      60000;
 | 
						|
    enabled         on;
 | 
						|
    gop_cache       on;
 | 
						|
    queue_length    30;
 | 
						|
    forward         127.0.0.1:19350;
 | 
						|
    bandcheck {
 | 
						|
        enabled         off;
 | 
						|
    }
 | 
						|
    hls {
 | 
						|
        enabled         on;
 | 
						|
        hls_path        ./objs/nginx/html;
 | 
						|
        hls_fragment    5;
 | 
						|
        hls_window      30;
 | 
						|
    }
 | 
						|
    http_hooks {
 | 
						|
        enabled         on;
 | 
						|
        on_connect      http://127.0.0.1:8085/api/v1/clients;
 | 
						|
        on_close        http://127.0.0.1:8085/api/v1/clients;
 | 
						|
        on_publish      http://127.0.0.1:8085/api/v1/streams;
 | 
						|
        on_unpublish    http://127.0.0.1:8085/api/v1/streams;
 | 
						|
        on_play         http://127.0.0.1:8085/api/v1/sessions;
 | 
						|
        on_stop         http://127.0.0.1:8085/api/v1/sessions;
 | 
						|
    }
 | 
						|
    transcode {
 | 
						|
        enabled         on;
 | 
						|
        ffmpeg          ./objs/ffmpeg/bin/ffmpeg;
 | 
						|
        engine ld {
 | 
						|
            enabled         on;
 | 
						|
            vfilter {
 | 
						|
                vf                  'drawtext=text=SimpleRtmpServer(SRS):x=10:y=10:fontsize=30:fontcolor=#cccccc:fontfile=./doc/FreeSerifBold.ttf';
 | 
						|
            }
 | 
						|
            vcodec          libx264;
 | 
						|
            vbitrate        300;
 | 
						|
            vfps            20;
 | 
						|
            vwidth          768;
 | 
						|
            vheight         320;
 | 
						|
            vthreads        1;
 | 
						|
            vprofile        baseline;
 | 
						|
            vpreset         superfast;
 | 
						|
            vparams {
 | 
						|
            }
 | 
						|
            acodec          libaacplus;
 | 
						|
            abitrate        45;
 | 
						|
            asample_rate    44100;
 | 
						|
            achannels       2;
 | 
						|
            aparams {
 | 
						|
            }
 | 
						|
            output          rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
 | 
						|
        }
 | 
						|
        engine sd {
 | 
						|
            enabled         on;
 | 
						|
            vfilter {
 | 
						|
                vf                  'split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2';
 | 
						|
            }
 | 
						|
            vcodec          libx264;
 | 
						|
            vbitrate        500;
 | 
						|
            vfps            20;
 | 
						|
            vwidth          768;
 | 
						|
            vheight         320;
 | 
						|
            vthreads        1;
 | 
						|
            vprofile        main;
 | 
						|
            vpreset         fast;
 | 
						|
            vparams {
 | 
						|
            }
 | 
						|
            acodec          libaacplus;
 | 
						|
            abitrate        40;
 | 
						|
            asample_rate    44100;
 | 
						|
            achannels       2;
 | 
						|
            aparams {
 | 
						|
            }
 | 
						|
            output          rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
vhost players {
 | 
						|
    enabled         on;
 | 
						|
    gop_cache       on;
 | 
						|
    transcode {
 | 
						|
        enabled         on;
 | 
						|
        ffmpeg          ./objs/ffmpeg/bin/ffmpeg;
 | 
						|
        engine hls {
 | 
						|
            enabled         on;
 | 
						|
            vfilter {
 | 
						|
                vf                  'drawtext=text=SRS(SimpleRtmpServer):x=10:y=10:fontcolor=#cccccc:fontfile=./doc/FreeSerifBold.ttf';
 | 
						|
            }
 | 
						|
            vcodec          libx264;
 | 
						|
            vbitrate        300;
 | 
						|
            vfps            20;
 | 
						|
            vwidth          768;
 | 
						|
            vheight         320;
 | 
						|
            vthreads        1;
 | 
						|
            vprofile        baseline;
 | 
						|
            vpreset         superfast;
 | 
						|
            vparams {
 | 
						|
                g           100;
 | 
						|
            }
 | 
						|
            acodec          libaacplus;
 | 
						|
            abitrate        30;
 | 
						|
            asample_rate    44100;
 | 
						|
            achannels       2;
 | 
						|
            aparams {
 | 
						|
            }
 | 
						|
            output          rtmp://127.0.0.1:[port]/[app]?vhost=players_pub/[stream];
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
vhost players_pub {
 | 
						|
    hls {
 | 
						|
        enabled         on;
 | 
						|
        hls_path        ./objs/nginx/html;
 | 
						|
        hls_fragment    5;
 | 
						|
        hls_window      30;
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
vhost players_pub_rtmp {
 | 
						|
    gop_cache       off;
 | 
						|
    hls {
 | 
						|
        enabled         off;
 | 
						|
    }
 | 
						|
}
 |