1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

add transcoding params to config

This commit is contained in:
winlin 2013-11-30 16:23:01 +08:00
parent 57064237d0
commit a086e2bbfa
3 changed files with 132 additions and 2 deletions

View file

@ -15,7 +15,129 @@ vhost __defaultVhost__ {
hls_path ./objs/nginx/html;
hls_fragment 5;
hls_window 30;
forward 127.0.0.1:1936;
#forward 127.0.0.1:1936;
transcode {
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
engine fd{
vcodec libx264;
vbitrate 300;
vfps 20;
vwidth 480;
vheight 320;
vthreads 2;
vprofile baseline;
vpreset superfast;
vparams {}
acodec libaacplus;
abitrate 30;
asample_rate 22050;
achannels 2;
aparams {}
output rtmp://[vhost]:[port]/[app]/[stream]_fast;
}
}
}
# transcode all app and stream of vhost
vhost all.transcode.vhost.com {
transcode {
# the ffmpeg
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
# all matched stream will transcoded to the following stream.
# the transcode set name(ie. hd) is optional and not used.
engine super{
# video encoder name
vcodec libx264;
# video bitrate, in kbps
vbitrate 1500;
# video framerate.
vfps 25;
# video width, must be even numbers.
vwidth 1280;
# video height, must be even numbers.
vheight 720;
# the max threads for ffmpeg to used.
vthreads 12;
# x264 profile, @see x264 -help, can be:
# high,main,baseline
vprofile main;
# x264 preset, @see x264 -help, can be:
# ultrafast,superfast,veryfast,faster,fast
# medium,slow,slower,veryslow,placebo
vpreset medium;
# other x264 or ffmpeg video params
vparams {
}
# audio encoder name
acodec libaacplus;
# audio bitrate, in kbps. [16, 72] for libaacplus.
abitrate 70;
# audio sample rate. for flv/rtmp, it must be:
# 44100,22050,11025,5512
asample_rate 44100;
# audio channel, 1 for mono, 2 for stereo.
achannels 2;
# other ffmpeg audio params
aparams {
}
# output stream. variables:
# [vhost] the input stream vhost.
# [port] the intput stream port.
# [app] the input stream app.
# [stream] the input stream name.
output rtmp://[vhost]:[port]/[app]/[stream]_super;
}
engine hd{
vcodec libx264;
vbitrate 1200;
vfps 25;
vwidth 1024;
vheight 576;
vthreads 6;
vprofile main;
vpreset medium;
vparams {}
acodec libaacplus;
abitrate 70;
asample_rate 44100;
achannels 2;
aparams {}
output rtmp://[vhost]:[port]/[app]/[stream]_hd;
}
engine sd{
vcodec libx264;
vbitrate 800;
vfps 25;
vwidth 720;
vheight 480;
vthreads 4;
vprofile main;
vpreset fast;
vparams {}
acodec libaacplus;
abitrate 60;
asample_rate 44100;
achannels 2;
aparams {}
output rtmp://[vhost]:[port]/[app]/[stream]_sd;
}
engine fast{
vcodec libx264;
vbitrate 300;
vfps 20;
vwidth 480;
vheight 320;
vthreads 2;
vprofile baseline;
vpreset superfast;
vparams {}
acodec libaacplus;
abitrate 30;
asample_rate 22050;
achannels 2;
aparams {}
output rtmp://[vhost]:[port]/[app]/[stream]_fast;
}
}
}
# the vhost which forward publish streams.
vhost forward.vhost.com {
@ -109,3 +231,4 @@ pithy_print {
forwarder 3000;
}