Questions tagged [cvpixelbuffer]
159 questions
1
vote
0 answers
EXC_BAD_ACCESS occurs on H264 encoding CMSampleBuffer
Trying to convert a CMSampleBuffer to H264 encoded data
aQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0);
- (void) encode:(CMSampleBufferRef )sampleBuffer
{
dispatch_sync(aQueue, ^{
self->frameCount++;
…

Aravind G S
- 392
- 3
- 17
1
vote
1 answer
CVPixelBuffer resulting into garbage image on the device, while working as expected on the simulator
I am trying to create an image out of artificially created data and want to use CVPixelBuffer:
private func RGBAImage(width w: Int, height h: Int) -> UIImage? {
let width = w * Int(UIScreen.main.scale)
let height = h *…

barley
- 4,403
- 25
- 28
1
vote
1 answer
Accessing Pixels Outside of the CVPixelBuffer that has been extended with Padding
I am trying to extend a CVPixelBuffer so that accesses to memory that is outside of the buffer does not cause a EXC_BAD_ACCESS error by reinitializing the CVPixelBuffer with padding. However, it doesn't seem to work. Any tips on what I am doing…

btomtom5
- 842
- 8
- 16
1
vote
1 answer
How to change CVPixelBuffer data format
I convert UIImage to CVPixelBuffer for the CoreML, but I want change the RGB pixel, like R/1.5, G/2, B/2.5.
I can read the pixel data by using assumingMemoryBound(to : UInt8.self),but
how can I modify the pixel data in CVPixelBuffer?

wellido
- 45
- 5
1
vote
0 answers
How to convert ARKit captured frame's CVPixelBuffer colorspace to RGB
I want to use coreML with vision for my trained modell, but that only takes images with RGB colorspace. I wonder how could I convert ARFrame CVPixelBuffer from ycbcr to RGB colorspace. I need CVPixelBuffer as a return type. I read that could be…

Samu Andras
- 171
- 1
- 6
1
vote
0 answers
Swift: Convert Grayscale Image to CVPixelBuffer containing disparity
I have a gray scale image of depth data that has been upsampled from its original resolution. I'm stuck as to how I can convert the pixel values of the upscaled depth image (r,g,b) to a float.
Is there a way to convert the level of whiteness of a…

Michael Archer
- 71
- 1
- 6
1
vote
0 answers
How to persist CVPixelBuffer?
I need to extract frames from iOS front-facing camera, convert each of them to CVPixelBuffer and actually store CVPixelBuffer objects on a disk without loosing data.
Is there a way to achieve this?

Natalia Zolotukhina
- 11
- 2
1
vote
1 answer
Cannot get CVPixelBufferRef data from OpenGL with SceneKit
I need to get CVPixelBufferRef from OpenGL context with SceneKit.
Creating renderer
_context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
_renderer = [SCNRenderer rendererWithContext:_context options:nil];
_renderer.delegate =…

Dimitrio
- 151
- 4
- 12
1
vote
1 answer
How do I render a CIImage into a 32-bits-per channel floating-point pixel buffer?
I want to render a CIImage into a pixel buffer of type kCVPixelFormatType_128RGBAFloat. But CIContext.render() fails saying "unsupported format". I tested on the iPhone 7 Plus running iOS 11.
Here's my code:
let context = CIContext()
var buffer:…

Kartick Vaddadi
- 4,818
- 6
- 39
- 55
1
vote
0 answers
GPUImageRawDataInput with Camera Feed
There could be several things wrong with my implementation, but I feel like it’s close.
I'm trying to record the camera feed using GPUImage, as well as set a dynamic overlay that updates 30 (or 60) times per second onto the video while it's…

Mary211534
- 11
- 1
1
vote
0 answers
How to Edit CMPixelBuffer by pixel
I'm an undergraduate student and I'm programming some HumanSeg iPhone app. Now I have to read raw frames from the camera, but I found the codes in official guide aren't clear enough for me to understand.
When I get the frames (in CMPixelBuffer…

AXIHIXA
- 47
- 7
1
vote
0 answers
FBSimulatorControl : Convert CVPixelBufferRef data to jpeg data for streaming
I am developing a CLI in swift and using FBSimulatorControl in it. I want to stream the data obtained from consumeData: delegate method. As per the data obtained in the method is data obtained from CVPixelBufferRef
I logged an issue in the github…

Aravind G S
- 392
- 3
- 17
1
vote
1 answer
How do I convert a CVPixelBuffer / CVImageBuffer to Data?
My camera app captures a photo, enhances it in a certain way, and saves it.
To do so, I get the input image from the camera in the form of a CVPixelBuffer (wrapped in a CMSampleBuffer). I perform some modifications on the pixel buffer, and I then…

Kartick Vaddadi
- 4,818
- 6
- 39
- 55
1
vote
0 answers
What's the most efficient way to check of CVPixelBufferRef has white pixels?
What's the most efficient way to check of CVPixelBufferRef has white pixels?
Below is the code that I'm currently using, but it's not returning an white pixels, when a photo clearly has white pixels.
const int kBytesPerPixel = 4;
…

user1752054
- 372
- 4
- 17
1
vote
1 answer
AVPlayerItemVideoOutput copyPixelBufferForItemTime gives incorrect CVPixelBufferRef on iOS for particular video
Have you met the problem when for the same video copyPixelBufferForItemTime is incorrect on iOS?
I have AVPlayerItemVideoOutput, linked to appropriate AVPlayerItem.
I call copyPixelBufferForItemTime, receive CVPixelBufferRef and then retrieve…

olha
- 2,132
- 1
- 18
- 39