We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
看之前的分享,尝试用下面的方法获取图片加完滤镜后的结果,是可以获取到UIImage的 ` gpuSourceImage->Render(); unsigned char* res = gpuSourceImage->captureAProcessedFrameData(beauty_face_filter_); int imageWidth = gpuSourceImage->getRotatedFramebufferWidth(); int imageHeight = gpuSourceImage->getRotatedFramebufferHeight();
// make data provider with data. CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, res, imageWidthimageHeight4, NULL);
// prep the ingredients int bitsPerComponent = 8; int bitsPerPixel = 32; int bytesPerRow = 4 * imageWidth; CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB(); CGBitmapInfo bitmapInfo = kCGBitmapByteOrderDefault; CGColorRenderingIntent renderingIntent = kCGRenderingIntentDefault;
// make the cgimage CGImageRef imageRef = CGImageCreate(imageWidth, imageHeight, bitsPerComponent, bitsPerPixel, bytesPerRow, colorSpaceRef, bitmapInfo, provider, NULL, NO, renderingIntent);
// then make the uiimage from that UIImage *image = [UIImage imageWithCGImage:imageRef];`
基于上面的思路,对实时视频实现捕获图像,SourceRawDataInput也可以调用captureAProcessedFrameData这个方法,于是用下面的方法尝试捕获图像,但是直接崩溃在第一行,崩溃信息是“Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)” ` unsigned char* res = gpuPixelRawInput->captureAProcessedFrameData(beauty_face_filter_); int imageWidth = gpuPixelRawInput->getRotatedFramebufferWidth(); int imageHeight = gpuPixelRawInput->getRotatedFramebufferHeight();
友友们,怎么实现捕获图像和录制视频呢
The text was updated successfully, but these errors were encountered:
No branches or pull requests
看之前的分享,尝试用下面的方法获取图片加完滤镜后的结果,是可以获取到UIImage的
` gpuSourceImage->Render();
unsigned char* res = gpuSourceImage->captureAProcessedFrameData(beauty_face_filter_);
int imageWidth = gpuSourceImage->getRotatedFramebufferWidth();
int imageHeight = gpuSourceImage->getRotatedFramebufferHeight();
// make data provider with data.
CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, res, imageWidthimageHeight4, NULL);
// prep the ingredients
int bitsPerComponent = 8;
int bitsPerPixel = 32;
int bytesPerRow = 4 * imageWidth;
CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB();
CGBitmapInfo bitmapInfo = kCGBitmapByteOrderDefault;
CGColorRenderingIntent renderingIntent = kCGRenderingIntentDefault;
// make the cgimage
CGImageRef imageRef = CGImageCreate(imageWidth, imageHeight, bitsPerComponent, bitsPerPixel, bytesPerRow, colorSpaceRef, bitmapInfo, provider, NULL, NO, renderingIntent);
// then make the uiimage from that
UIImage *image = [UIImage imageWithCGImage:imageRef];`
基于上面的思路,对实时视频实现捕获图像,SourceRawDataInput也可以调用captureAProcessedFrameData这个方法,于是用下面的方法尝试捕获图像,但是直接崩溃在第一行,崩溃信息是“Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)”
` unsigned char* res = gpuPixelRawInput->captureAProcessedFrameData(beauty_face_filter_);
int imageWidth = gpuPixelRawInput->getRotatedFramebufferWidth();
int imageHeight = gpuPixelRawInput->getRotatedFramebufferHeight();
// make data provider with data.
CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, res, imageWidthimageHeight4, NULL);
// prep the ingredients
int bitsPerComponent = 8;
int bitsPerPixel = 32;
int bytesPerRow = 4 * imageWidth;
CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB();
CGBitmapInfo bitmapInfo = kCGBitmapByteOrderDefault;
CGColorRenderingIntent renderingIntent = kCGRenderingIntentDefault;
// make the cgimage
CGImageRef imageRef = CGImageCreate(imageWidth, imageHeight, bitsPerComponent, bitsPerPixel, bytesPerRow, colorSpaceRef, bitmapInfo, provider, NULL, NO, renderingIntent);
// then make the uiimage from that
UIImage *image = [UIImage imageWithCGImage:imageRef];`
友友们,怎么实现捕获图像和录制视频呢
The text was updated successfully, but these errors were encountered: