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

support audio transcode only, speex/mp3 to aac

This commit is contained in:
winlin 2013-12-06 14:35:03 +08:00
parent 2d592d177d
commit 3b09f9bea9
3 changed files with 224 additions and 130 deletions

View file

@ -15,6 +15,7 @@ log_dir ./objs/logs;
# default: 2000
max_connections 2000;
# vhost list, the __defaultVhost__ is the default vhost
# for example, user use ip to access the stream: rtmp://192.168.1.2/live/livestream.
# for which cannot identify the required vhost.
# for default demo.
vhost __defaultVhost__ {
@ -44,7 +45,7 @@ vhost __defaultVhost__ {
vparams {
}
acodec libaacplus;
abitrate 30;
abitrate 45;
asample_rate 44100;
achannels 2;
aparams {
@ -90,7 +91,7 @@ vhost dev {
enabled on;
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
engine dev {
enabled on;
enabled off;
vfilter {
}
vcodec libx264;
@ -104,7 +105,18 @@ vhost dev {
vparams {
}
acodec libaacplus;
abitrate 30;
abitrate 45;
asample_rate 44100;
achannels 2;
aparams {
}
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
}
engine dev_acodec {
enabled on;
vcodec copy;
acodec libaacplus;
abitrate 45;
asample_rate 44100;
achannels 2;
aparams {
@ -134,7 +146,7 @@ vhost mirror.transcode.vhost.com {
vparams {
}
acodec libaacplus;
abitrate 30;
abitrate 45;
asample_rate 44100;
achannels 2;
aparams {
@ -164,7 +176,7 @@ vhost drawtext.transcode.vhost.com {
vparams {
}
acodec libaacplus;
abitrate 30;
abitrate 45;
asample_rate 44100;
achannels 2;
aparams {
@ -194,7 +206,7 @@ vhost crop.transcode.vhost.com {
vparams {
}
acodec libaacplus;
abitrate 30;
abitrate 45;
asample_rate 44100;
achannels 2;
aparams {
@ -224,7 +236,7 @@ vhost logo.transcode.vhost.com {
vparams {
}
acodec libaacplus;
abitrate 30;
abitrate 45;
asample_rate 44100;
achannels 2;
aparams {
@ -233,6 +245,40 @@ vhost logo.transcode.vhost.com {
}
}
}
# audio transcode only.
# for example, FMLE publish audio codec in mp3, and donot support HLS output,
# we can transcode the audio to aac and copy video to the new stream with HLS.
vhost audio.transcode.vhost.com {
transcode {
enabled on;
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
engine acodec {
enabled on;
vcodec copy;
acodec libaacplus;
abitrate 45;
asample_rate 44100;
achannels 2;
aparams {
}
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
}
}
}
# ffmpeg-copy(forward implements by ffmpeg).
# copy the video and audio to a new stream.
vhost copy.transcode.vhost.com {
transcode {
enabled on;
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
engine copy {
enabled on;
vcodec copy;
acodec copy;
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
}
}
}
# transcode all app and stream of vhost
vhost all.transcode.vhost.com {
# the streaming transcode configs.
@ -258,7 +304,9 @@ vhost all.transcode.vhost.com {
# for filters, @see: http://ffmpeg.org/ffmpeg-filters.html
filter_complex 'overlay=10:10';
}
# video encoder name
# video encoder name. can be:
# libx264: use h.264(libx264) video encoder.
# copy: donot encoder the video stream, copy it.
vcodec libx264;
# video bitrate, in kbps
vbitrate 1500;
@ -287,7 +335,9 @@ vhost all.transcode.vhost.com {
bf 3;
refs 10;
}
# audio encoder name
# audio encoder name. can be:
# libaacplus: use aac(libaacplus) audio encoder.
# copy: donot encoder the audio stream, copy it.
acodec libaacplus;
# audio bitrate, in kbps. [16, 72] for libaacplus.
abitrate 70;
@ -362,13 +412,45 @@ vhost all.transcode.vhost.com {
vparams {
}
acodec libaacplus;
abitrate 30;
abitrate 45;
asample_rate 44100;
achannels 2;
aparams {
}
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
}
engine vcopy {
enabled on;
vcodec copy;
acodec libaacplus;
abitrate 45;
asample_rate 44100;
achannels 2;
aparams {
}
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
}
engine acopy {
enabled on;
vcodec libx264;
vbitrate 300;
vfps 20;
vwidth 768;
vheight 320;
vthreads 2;
vprofile baseline;
vpreset superfast;
vparams {
}
acodec copy;
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
}
engine copy {
enabled on;
vcodec copy;
acodec copy;
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
}
}
}
# transcode all stream using the empty ffmpeg demo, donothing.
@ -389,7 +471,7 @@ vhost ffempty.transcode.vhost.com {
vparams {
}
acodec libaacplus;
abitrate 30;
abitrate 45;
asample_rate 44100;
achannels 2;
aparams {