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

support ffmpeg filter

This commit is contained in:
winlin 2013-12-01 10:54:41 +08:00
parent f85b70966c
commit 9a0d8855d8
8 changed files with 280 additions and 85 deletions

View file

@ -15,13 +15,19 @@ 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 {
enabled on;
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
#ffmpeg ./research/ffempty/ffempty;
engine fast{
enabled on;
vfilter {
vf 'drawtext=text=SRS';
#vf 'crop=in_w-20:in_h-160:10:80';
#i ./doc/ffmpeg-logo.png;
#filter_complex 'overlay=10:10';
}
vcodec libx264;
vbitrate 300;
vfps 20;
@ -37,11 +43,15 @@ vhost __defaultVhost__ {
asample_rate 44100;
achannels 2;
aparams {
profile:a aac_low;
}
output rtmp://[vhost]:[port]/[app]/[stream]_fast;
}
engine sd{
enabled on;
enabled off;
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;
@ -79,6 +89,14 @@ vhost all.transcode.vhost.com {
# whether the engine is enabled
# default: off.
enabled on;
# ffmpeg filters, follows the main input.
vfilter {
# the logo input file.
i ./doc/ffmpeg-logo.png;
# the ffmpeg complex filter.
# for filters, @see: http://ffmpeg.org/ffmpeg-filters.html
filter_complex 'overlay=10:10';
}
# video encoder name
vcodec libx264;
# video bitrate, in kbps
@ -100,6 +118,13 @@ vhost all.transcode.vhost.com {
vpreset medium;
# other x264 or ffmpeg video params
vparams {
# ffmpeg options, @see: http://ffmpeg.org/ffmpeg.html
t 100;
# 264 params, @see: http://ffmpeg.org/ffmpeg-codecs.html#libx264
coder 1;
b_strategy 2;
bf 3;
refs 10;
}
# audio encoder name
acodec libaacplus;
@ -182,12 +207,102 @@ vhost all.transcode.vhost.com {
}
}
}
# the mirror filter of ffmpeg, @see: http://ffmpeg.org/ffmpeg-filters.html#Filtering-Introduction
vhost mirror.transcode.vhost.com {
transcode {
enabled on;
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
engine mirror{
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 300;
vfps 20;
vwidth 480;
vheight 320;
vthreads 2;
vprofile baseline;
vpreset superfast;
vparams {
}
acodec libaacplus;
abitrate 30;
asample_rate 44100;
achannels 2;
aparams {
}
output rtmp://[vhost]:[port]/[app]/[stream]_mirror;
}
}
}
# the logo filter of ffmpeg, @see: http://ffmpeg.org/ffmpeg-filters.html#crop
vhost crop.transcode.vhost.com {
transcode {
enabled on;
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
engine crop{
enabled on;
vfilter {
vf 'crop=in_w-20:in_h-160:10:80';
}
vcodec libx264;
vbitrate 300;
vfps 20;
vwidth 480;
vheight 320;
vthreads 2;
vprofile baseline;
vpreset superfast;
vparams {
}
acodec libaacplus;
abitrate 30;
asample_rate 44100;
achannels 2;
aparams {
}
output rtmp://[vhost]:[port]/[app]/[stream]_crop;
}
}
}
# the crop filter of ffmpeg, @see: http://ffmpeg.org/ffmpeg-filters.html#crop
vhost logo.transcode.vhost.com {
transcode {
enabled on;
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
engine logo{
enabled on;
vfilter {
vf 'crop=200:100:10:10';
}
vcodec libx264;
vbitrate 300;
vfps 20;
vwidth 480;
vheight 320;
vthreads 2;
vprofile baseline;
vpreset superfast;
vparams {
}
acodec libaacplus;
abitrate 30;
asample_rate 44100;
achannels 2;
aparams {
}
output rtmp://[vhost]:[port]/[app]/[stream]_logo;
}
}
}
# transcode all stream using the empty ffmpeg demo, donothing.
vhost ffempty.transcode.vhost.com {
transcode {
enabled on;
ffmpeg ./research/ffempty/ffempty;
engine fd{
engine empty{
enabled on;
vcodec libx264;
vbitrate 300;
@ -205,7 +320,7 @@ vhost ffempty.transcode.vhost.com {
achannels 2;
aparams {
}
output rtmp://[vhost]:[port]/[app]/[stream]_fast;
output rtmp://[vhost]:[port]/[app]/[stream]_empty;
}
}
}