直接用zego的SDK吧,web、iOS、Android都可以支持。有現(xiàn)成的demo和SDK試用
成都網(wǎng)絡(luò)公司-成都網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián)10年經(jīng)驗(yàn)成就非凡,專業(yè)從事成都做網(wǎng)站、網(wǎng)站設(shè)計(jì),成都網(wǎng)頁設(shè)計(jì),成都網(wǎng)頁制作,軟文發(fā)稿,一元廣告等。10年來已成功提供全面的成都網(wǎng)站建設(shè)方案,打造行業(yè)特色的成都網(wǎng)站建設(shè)案例,建站熱線:13518219792,我們期待您的來電!
下載一個(gè)安裝版本的red5.執(zhí)行exe文件將red5安裝為系統(tǒng)服務(wù).自己設(shè)置是否開機(jī)啟動(dòng) 或是自己在服務(wù)里啟動(dòng) 就不會(huì)有dos窗口
這個(gè)是linux嗎?
有點(diǎn)看不懂··
猜2中方法:
添加commons-logging-1.1.1.jar
或者是:在red5的web.xml注釋有l(wèi)og4J的配置
//運(yùn)行以下程序即可
public?class?ImageInit?{
BufferedImage?image;
private?int?iw,?ih;
private?int[]?pixels;
public?ImageInit(BufferedImage?image)?{
this.image?=?image;
iw?=?image.getWidth();
ih?=?image.getHeight();
pixels?=?new?int[iw?*?ih];
}
public?BufferedImage?changeGrey()?{
PixelGrabber?pg?=?new?PixelGrabber(image.getSource(),?0,?0,?iw,?ih,
pixels,?0,?iw);
try?{
pg.grabPixels();
}?catch?(InterruptedException?e)?{
e.printStackTrace();
}
//?設(shè)定二值化的域值,默認(rèn)值為100
int?grey?=?100;
//?對(duì)圖像進(jìn)行二值化處理,Alpha值保持不變
ColorModel?cm?=?ColorModel.getRGBdefault();
for?(int?i?=?0;?i??iw?*?ih;?i++)?{
int?red,?green,?blue;
int?alpha?=?cm.getAlpha(pixels[i]);
if?(cm.getRed(pixels[i])??grey)?{
red?=?255;
}?else?{
red?=?0;
}
if?(cm.getGreen(pixels[i])??grey)?{
green?=?255;
}?else?{
green?=?0;
}
if?(cm.getBlue(pixels[i])??grey)?{
blue?=?255;
}?else?{
blue?=?0;
}
pixels[i]?=?alpha??24?|?red??16?|?green??8?|?blue;?//?通過移位重新構(gòu)成某一點(diǎn)像素的RGB值
}
//?將數(shù)組中的象素產(chǎn)生一個(gè)圖像
Image?tempImg?=?Toolkit.getDefaultToolkit().createImage(
new?MemoryImageSource(iw,?ih,?pixels,?0,?iw));
image?=?new?BufferedImage(tempImg.getWidth(null),
tempImg.getHeight(null),?BufferedImage.TYPE_INT_BGR);
image.createGraphics().drawImage(tempImg,?0,?0,?null);
return?image;
}
public?BufferedImage?getMedian()?{
PixelGrabber?pg?=?new?PixelGrabber(image.getSource(),?0,?0,?iw,?ih,
pixels,?0,?iw);
try?{
pg.grabPixels();
}?catch?(InterruptedException?e)?{
e.printStackTrace();
}
//?對(duì)圖像進(jìn)行中值濾波,Alpha值保持不變
ColorModel?cm?=?ColorModel.getRGBdefault();
for?(int?i?=?1;?i??ih?-?1;?i++)?{
for?(int?j?=?1;?j??iw?-?1;?j++)?{
int?red,?green,?blue;
int?alpha?=?cm.getAlpha(pixels[i?*?iw?+?j]);
//?int?red2?=?cm.getRed(pixels[(i?-?1)?*?iw?+?j]);
int?red4?=?cm.getRed(pixels[i?*?iw?+?j?-?1]);
int?red5?=?cm.getRed(pixels[i?*?iw?+?j]);
int?red6?=?cm.getRed(pixels[i?*?iw?+?j?+?1]);
//?int?red8?=?cm.getRed(pixels[(i?+?1)?*?iw?+?j]);
//?水平方向進(jìn)行中值濾波
if?(red4?=?red5)?{
if?(red5?=?red6)?{
red?=?red5;
}?else?{
if?(red4?=?red6)?{
red?=?red6;
}?else?{
red?=?red4;
}
}
}?else?{
if?(red4??red6)?{
red?=?red4;
}?else?{
if?(red5??red6)?{
red?=?red6;
}?else?{
red?=?red5;
}
}
}
int?green4?=?cm.getGreen(pixels[i?*?iw?+?j?-?1]);
int?green5?=?cm.getGreen(pixels[i?*?iw?+?j]);
int?green6?=?cm.getGreen(pixels[i?*?iw?+?j?+?1]);
//?水平方向進(jìn)行中值濾波
if?(green4?=?green5)?{
if?(green5?=?green6)?{
green?=?green5;
}?else?{
if?(green4?=?green6)?{
green?=?green6;
}?else?{
green?=?green4;
}
}
}?else?{
if?(green4??green6)?{
green?=?green4;
}?else?{
if?(green5??green6)?{
green?=?green6;
}?else?{
green?=?green5;
}
}
}
//?int?blue2?=?cm.getBlue(pixels[(i?-?1)?*?iw?+?j]);
int?blue4?=?cm.getBlue(pixels[i?*?iw?+?j?-?1]);
int?blue5?=?cm.getBlue(pixels[i?*?iw?+?j]);
int?blue6?=?cm.getBlue(pixels[i?*?iw?+?j?+?1]);
//?int?blue8?=?cm.getBlue(pixels[(i?+?1)?*?iw?+?j]);
//?水平方向進(jìn)行中值濾波
if?(blue4?=?blue5)?{
if?(blue5?=?blue6)?{
blue?=?blue5;
}?else?{
if?(blue4?=?blue6)?{
blue?=?blue6;
}?else?{
blue?=?blue4;
}
}
}?else?{
if?(blue4??blue6)?{
blue?=?blue4;
}?else?{
if?(blue5??blue6)?{
blue?=?blue6;
}?else?{
blue?=?blue5;
}
}
}
pixels[i?*?iw?+?j]?=?alpha??24?|?red??16?|?green??8
|?blue;
}
}
//?將數(shù)組中的象素產(chǎn)生一個(gè)圖像
Image?tempImg?=?Toolkit.getDefaultToolkit().createImage(
new?MemoryImageSource(iw,?ih,?pixels,?0,?iw));
image?=?new?BufferedImage(tempImg.getWidth(null),
tempImg.getHeight(null),?BufferedImage.TYPE_INT_BGR);
image.createGraphics().drawImage(tempImg,?0,?0,?null);
return?image;
}
public?BufferedImage?getGrey()?{
ColorConvertOp?ccp?=?new?ColorConvertOp(
ColorSpace.getInstance(ColorSpace.CS_GRAY),?null);
return?image?=?ccp.filter(image,?null);
}
//?Brighten?using?a?linear?formula?that?increases?all?color?values
public?BufferedImage?getBrighten()?{
RescaleOp?rop?=?new?RescaleOp(1.25f,?0,?null);
return?image?=?rop.filter(image,?null);
}
//?Blur?by?"convolving"?the?image?with?a?matrix
public?BufferedImage?getBlur()?{
float[]?data?=?{?.1111f,?.1111f,?.1111f,?.1111f,?.1111f,?.1111f,
.1111f,?.1111f,?.1111f,?};
ConvolveOp?cop?=?new?ConvolveOp(new?Kernel(3,?3,?data));
return?image?=?cop.filter(image,?null);
}
//?Sharpen?by?using?a?different?matrix
public?BufferedImage?getSharpen()?{
float[]?data?=?{?0.0f,?-0.75f,?0.0f,?-0.75f,?4.0f,?-0.75f,?0.0f,
-0.75f,?0.0f?};
ConvolveOp?cop?=?new?ConvolveOp(new?Kernel(3,?3,?data));
return?image?=?cop.filter(image,?null);
}
//?11)?Rotate?the?image?180?degrees?about?its?center?point
public?BufferedImage?getRotate()?{
AffineTransformOp?atop?=?new?AffineTransformOp(
AffineTransform.getRotateInstance(Math.PI,
image.getWidth()?/?2,?image.getHeight()?/?2),
AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
return?image?=?atop.filter(image,?null);
}
public?BufferedImage?getProcessedImg()?{
return?image;
}
public?static?void?main(String[]?args)?throws?IOException?{
String?filePath="F:/k7qp5.png";
FileInputStream?fin?=?new?FileInputStream(filePath);
BufferedImage?bi?=?ImageIO.read(fin);
ImageInit?flt?=?new?ImageInit(bi);
flt.changeGrey();
flt.getGrey();
flt.getBrighten();
bi?=?flt.getProcessedImg();
String?pname?=?filePath.substring(0,?filePath.lastIndexOf("."));
File?file?=?new?File(pname?+?".jpg");
ImageIO.write(bi,?"jpg",?file);
}
}