正在显示
2 个修改的文件
包含
22 行增加
和
21 行删除
| @@ -20,7 +20,7 @@ vhost __defaultVhost__ { | @@ -20,7 +20,7 @@ vhost __defaultVhost__ { | ||
| 20 | transcode { | 20 | transcode { |
| 21 | enabled on; | 21 | enabled on; |
| 22 | ffmpeg ./objs/ffmpeg/bin/ffmpeg; | 22 | ffmpeg ./objs/ffmpeg/bin/ffmpeg; |
| 23 | - engine ld{ | 23 | + engine ld { |
| 24 | enabled on; | 24 | enabled on; |
| 25 | vfilter { | 25 | vfilter { |
| 26 | vf 'drawtext=text=SimpleRtmpServer(SRS):x=10:y=10:fontcolor=#cccccc:fontfile=./doc/FreeSerifBold.ttf'; | 26 | vf 'drawtext=text=SimpleRtmpServer(SRS):x=10:y=10:fontcolor=#cccccc:fontfile=./doc/FreeSerifBold.ttf'; |
| @@ -43,7 +43,7 @@ vhost __defaultVhost__ { | @@ -43,7 +43,7 @@ vhost __defaultVhost__ { | ||
| 43 | } | 43 | } |
| 44 | output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine]; | 44 | output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine]; |
| 45 | } | 45 | } |
| 46 | - engine sd{ | 46 | + engine sd { |
| 47 | enabled on; | 47 | enabled on; |
| 48 | vfilter { | 48 | vfilter { |
| 49 | vf 'split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2'; | 49 | vf 'split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2'; |
| @@ -76,11 +76,11 @@ vhost dev { | @@ -76,11 +76,11 @@ vhost dev { | ||
| 76 | hls_path ./objs/nginx/html; | 76 | hls_path ./objs/nginx/html; |
| 77 | hls_fragment 5; | 77 | hls_fragment 5; |
| 78 | hls_window 30; | 78 | hls_window 30; |
| 79 | - forward 127.0.0.1:19350?vhost=dev; | 79 | + forward 127.0.0.1:19350; |
| 80 | transcode { | 80 | transcode { |
| 81 | enabled on; | 81 | enabled on; |
| 82 | ffmpeg ./objs/ffmpeg/bin/ffmpeg; | 82 | ffmpeg ./objs/ffmpeg/bin/ffmpeg; |
| 83 | - engine dev{ | 83 | + engine dev { |
| 84 | enabled on; | 84 | enabled on; |
| 85 | vfilter { | 85 | vfilter { |
| 86 | } | 86 | } |
| @@ -109,7 +109,7 @@ vhost mirror.transcode.vhost.com { | @@ -109,7 +109,7 @@ vhost mirror.transcode.vhost.com { | ||
| 109 | transcode { | 109 | transcode { |
| 110 | enabled on; | 110 | enabled on; |
| 111 | ffmpeg ./objs/ffmpeg/bin/ffmpeg; | 111 | ffmpeg ./objs/ffmpeg/bin/ffmpeg; |
| 112 | - engine mirror{ | 112 | + engine mirror { |
| 113 | enabled on; | 113 | enabled on; |
| 114 | vfilter { | 114 | vfilter { |
| 115 | vf 'split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2'; | 115 | vf 'split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2'; |
| @@ -139,7 +139,7 @@ vhost drawtext.transcode.vhost.com { | @@ -139,7 +139,7 @@ vhost drawtext.transcode.vhost.com { | ||
| 139 | transcode { | 139 | transcode { |
| 140 | enabled on; | 140 | enabled on; |
| 141 | ffmpeg ./objs/ffmpeg/bin/ffmpeg; | 141 | ffmpeg ./objs/ffmpeg/bin/ffmpeg; |
| 142 | - engine drawtext{ | 142 | + engine drawtext { |
| 143 | enabled on; | 143 | enabled on; |
| 144 | vfilter { | 144 | vfilter { |
| 145 | vf 'drawtext=text=SimpleRtmpServer(SRS):x=10:y=10:fontcolor=#cccccc:fontfile=./doc/FreeSerifBold.ttf'; | 145 | vf 'drawtext=text=SimpleRtmpServer(SRS):x=10:y=10:fontcolor=#cccccc:fontfile=./doc/FreeSerifBold.ttf'; |
| @@ -169,7 +169,7 @@ vhost crop.transcode.vhost.com { | @@ -169,7 +169,7 @@ vhost crop.transcode.vhost.com { | ||
| 169 | transcode { | 169 | transcode { |
| 170 | enabled on; | 170 | enabled on; |
| 171 | ffmpeg ./objs/ffmpeg/bin/ffmpeg; | 171 | ffmpeg ./objs/ffmpeg/bin/ffmpeg; |
| 172 | - engine crop{ | 172 | + engine crop { |
| 173 | enabled on; | 173 | enabled on; |
| 174 | vfilter { | 174 | vfilter { |
| 175 | vf 'crop=in_w-20:in_h-160:10:80'; | 175 | vf 'crop=in_w-20:in_h-160:10:80'; |
| @@ -199,7 +199,7 @@ vhost logo.transcode.vhost.com { | @@ -199,7 +199,7 @@ vhost logo.transcode.vhost.com { | ||
| 199 | transcode { | 199 | transcode { |
| 200 | enabled on; | 200 | enabled on; |
| 201 | ffmpeg ./objs/ffmpeg/bin/ffmpeg; | 201 | ffmpeg ./objs/ffmpeg/bin/ffmpeg; |
| 202 | - engine logo{ | 202 | + engine logo { |
| 203 | enabled on; | 203 | enabled on; |
| 204 | vfilter { | 204 | vfilter { |
| 205 | vf 'crop=200:100:10:10'; | 205 | vf 'crop=200:100:10:10'; |
| @@ -237,7 +237,7 @@ vhost all.transcode.vhost.com { | @@ -237,7 +237,7 @@ vhost all.transcode.vhost.com { | ||
| 237 | # the transcode engine for matched stream. | 237 | # the transcode engine for matched stream. |
| 238 | # all matched stream will transcoded to the following stream. | 238 | # all matched stream will transcoded to the following stream. |
| 239 | # the transcode set name(ie. hd) is optional and not used. | 239 | # the transcode set name(ie. hd) is optional and not used. |
| 240 | - engine ffsuper{ | 240 | + engine ffsuper { |
| 241 | # whether the engine is enabled | 241 | # whether the engine is enabled |
| 242 | # default: off. | 242 | # default: off. |
| 243 | enabled on; | 243 | enabled on; |
| @@ -300,7 +300,7 @@ vhost all.transcode.vhost.com { | @@ -300,7 +300,7 @@ vhost all.transcode.vhost.com { | ||
| 300 | # [engine] the tanscode engine name. | 300 | # [engine] the tanscode engine name. |
| 301 | output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine]; | 301 | output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine]; |
| 302 | } | 302 | } |
| 303 | - engine ffhd{ | 303 | + engine ffhd { |
| 304 | enabled on; | 304 | enabled on; |
| 305 | vcodec libx264; | 305 | vcodec libx264; |
| 306 | vbitrate 1200; | 306 | vbitrate 1200; |
| @@ -318,9 +318,9 @@ vhost all.transcode.vhost.com { | @@ -318,9 +318,9 @@ vhost all.transcode.vhost.com { | ||
| 318 | achannels 2; | 318 | achannels 2; |
| 319 | aparams { | 319 | aparams { |
| 320 | } | 320 | } |
| 321 | - output rtmp://[vhost]:[port]/[app]/[stream]_ffhd; | 321 | + output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine]; |
| 322 | } | 322 | } |
| 323 | - engine ffsd{ | 323 | + engine ffsd { |
| 324 | enabled on; | 324 | enabled on; |
| 325 | vcodec libx264; | 325 | vcodec libx264; |
| 326 | vbitrate 800; | 326 | vbitrate 800; |
| @@ -338,9 +338,9 @@ vhost all.transcode.vhost.com { | @@ -338,9 +338,9 @@ vhost all.transcode.vhost.com { | ||
| 338 | achannels 2; | 338 | achannels 2; |
| 339 | aparams { | 339 | aparams { |
| 340 | } | 340 | } |
| 341 | - output rtmp://[vhost]:[port]/[app]/[stream]_ffsd; | 341 | + output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine]; |
| 342 | } | 342 | } |
| 343 | - engine fffast{ | 343 | + engine fffast { |
| 344 | enabled on; | 344 | enabled on; |
| 345 | vcodec libx264; | 345 | vcodec libx264; |
| 346 | vbitrate 300; | 346 | vbitrate 300; |
| @@ -358,7 +358,7 @@ vhost all.transcode.vhost.com { | @@ -358,7 +358,7 @@ vhost all.transcode.vhost.com { | ||
| 358 | achannels 2; | 358 | achannels 2; |
| 359 | aparams { | 359 | aparams { |
| 360 | } | 360 | } |
| 361 | - output rtmp://[vhost]:[port]/[app]/[stream]_fffast; | 361 | + output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine]; |
| 362 | } | 362 | } |
| 363 | } | 363 | } |
| 364 | } | 364 | } |
| @@ -367,7 +367,7 @@ vhost ffempty.transcode.vhost.com { | @@ -367,7 +367,7 @@ vhost ffempty.transcode.vhost.com { | ||
| 367 | transcode { | 367 | transcode { |
| 368 | enabled on; | 368 | enabled on; |
| 369 | ffmpeg ./research/ffempty/ffempty; | 369 | ffmpeg ./research/ffempty/ffempty; |
| 370 | - engine empty{ | 370 | + engine empty { |
| 371 | enabled on; | 371 | enabled on; |
| 372 | vcodec libx264; | 372 | vcodec libx264; |
| 373 | vbitrate 300; | 373 | vbitrate 300; |
| @@ -385,7 +385,7 @@ vhost ffempty.transcode.vhost.com { | @@ -385,7 +385,7 @@ vhost ffempty.transcode.vhost.com { | ||
| 385 | achannels 2; | 385 | achannels 2; |
| 386 | aparams { | 386 | aparams { |
| 387 | } | 387 | } |
| 388 | - output rtmp://[vhost]:[port]/[app]/[stream]_empty; | 388 | + output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine]; |
| 389 | } | 389 | } |
| 390 | } | 390 | } |
| 391 | } | 391 | } |
| @@ -396,7 +396,7 @@ vhost app.transcode.vhost.com { | @@ -396,7 +396,7 @@ vhost app.transcode.vhost.com { | ||
| 396 | transcode live { | 396 | transcode live { |
| 397 | enabled on; | 397 | enabled on; |
| 398 | ffmpeg ./objs/ffmpeg/bin/ffmpeg; | 398 | ffmpeg ./objs/ffmpeg/bin/ffmpeg; |
| 399 | - engine fd{ | 399 | + engine { |
| 400 | enabled off; | 400 | enabled off; |
| 401 | } | 401 | } |
| 402 | } | 402 | } |
| @@ -408,13 +408,13 @@ vhost stream.transcode.vhost.com { | @@ -408,13 +408,13 @@ vhost stream.transcode.vhost.com { | ||
| 408 | transcode live/livestream { | 408 | transcode live/livestream { |
| 409 | enabled on; | 409 | enabled on; |
| 410 | ffmpeg ./objs/ffmpeg/bin/ffmpeg; | 410 | ffmpeg ./objs/ffmpeg/bin/ffmpeg; |
| 411 | - engine fd{ | 411 | + engine { |
| 412 | enabled off; | 412 | enabled off; |
| 413 | } | 413 | } |
| 414 | } | 414 | } |
| 415 | } | 415 | } |
| 416 | # the vhost which forward publish streams. | 416 | # the vhost which forward publish streams. |
| 417 | -vhost forward.vhost.com { | 417 | +vhost same.vhost.forward.vhost.com { |
| 418 | # forward all publish stream to the specified server. | 418 | # forward all publish stream to the specified server. |
| 419 | # this used to split/forward the current stream for cluster active-standby, | 419 | # this used to split/forward the current stream for cluster active-standby, |
| 420 | # active-active for cdn to build high available fault tolerance system. | 420 | # active-active for cdn to build high available fault tolerance system. |
| @@ -425,7 +425,7 @@ vhost forward.vhost.com { | @@ -425,7 +425,7 @@ vhost forward.vhost.com { | ||
| 425 | forward 127.0.0.1:1936 127.0.0.1:1937; | 425 | forward 127.0.0.1:1936 127.0.0.1:1937; |
| 426 | } | 426 | } |
| 427 | # the vhost which forward publish streams to other vhosts. | 427 | # the vhost which forward publish streams to other vhosts. |
| 428 | -vhost forward1.vhost.com { | 428 | +vhost change.vhost.forward.vhost.com { |
| 429 | forward 127.0.0.1:1936?vhost=forward2.vhost.com 127.0.0.1:1937?vhost=forward3.vhost.com; | 429 | forward 127.0.0.1:1936?vhost=forward2.vhost.com 127.0.0.1:1937?vhost=forward3.vhost.com; |
| 430 | } | 430 | } |
| 431 | # the vhost disabled. | 431 | # the vhost disabled. |
trunk/src/core/srs_core.cpp
100644 → 100755
| @@ -92,6 +92,7 @@ void srs_vhost_resolve(std::string& vhost, std::string& app) | @@ -92,6 +92,7 @@ void srs_vhost_resolve(std::string& vhost, std::string& app) | ||
| 92 | { | 92 | { |
| 93 | app = srs_replace(app, "...", "?"); | 93 | app = srs_replace(app, "...", "?"); |
| 94 | 94 | ||
| 95 | + size_t pos = 0; | ||
| 95 | if ((pos = app.find("?")) == std::string::npos) { | 96 | if ((pos = app.find("?")) == std::string::npos) { |
| 96 | return; | 97 | return; |
| 97 | } | 98 | } |
-
请 注册 或 登录 后发表评论