Questions tagged [cmsamplebuffer]

106 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
0 answers

Screen Share stopped due to (null) in iPAD

I am using Replay Kit 2 (Broadcast Upload Extension) for screen sharing in my application. It works fine on iPhone but error comes after few seconds as it crosses memory limit 50 MB when i run it on iPAD. The issue is because of resolution which…
1
vote
1 answer

AVAssetWriter rotate buffer for video orientation

I'm working on a live recording app in Swift using AVFoundation and I have an issue with the video orientation. I use AVAssetWriter and not AVCaptureMovieFileOutput because I need to record in square format (correct me if I'm wrong). I tried to use…
1
vote
1 answer

Generating Float32 Array (Float32 PCM data) using CMSampleBuffer

I get the callbacks from camera with for audio with data in the format of CMSampleBuffer but I am unable to convert this data to PCM data. I followed the docs provided by Apple copyPCMData, UnsafeMutablePointer, AudioBufferList but all I get is 0.0…
1
vote
0 answers

Audio Missing when Adding Text on pixelBuffer

I am trying to add text overlay on video, When recording in iPhone 5s or lower devices in High quality and writing text on that then after 1 or 2 seconds audio goes missing, But this doesn't happen on larger devices like iPhone 6/6s. If i remove…
Dhiru201
  • 11
  • 1
  • 4
1
vote
1 answer

Saving a screen recording with RPScreenRecorder start capture

I am attempting to use RPScreenRecorder.shared().startCapture to save a screen recording to firebase. I know how to save videos from AVCapture but cant figure out how to process The CMSampleBuffer to create a file to save to firebase. Please help I…
lawndogg
  • 127
  • 1
  • 14
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

Convert audio CMSampleBuffer to MTLBuffer

What is the most efficient way to convert audio CMSampleBuffer buffers to MTLBuffer buffers? I would also like to efficiently as possible convert MTLBuffer buffers back to CMSampleBuffer buffers. Do I need to first convert audio CMSampleBuffer to…
Jeshua Lacock
  • 5,730
  • 1
  • 28
  • 58
1
vote
0 answers

Cannot append pixel buffer into AVAssetWriterInputPixelBufferAdaptor randomly

I'm using AVAssetWriter and AVAssetWriterInputPixelBufferAdaptor to add mask image into CMSampleBuffer which recorded from AVCaptureSession, but sometimes I got this error when try to append processed pixelBuffer to…
Tai Le
  • 8,530
  • 5
  • 41
  • 34
1
vote
1 answer

Convert CVPixelBufferRef sample from 4:3 to 16:9

I try to convert 4:3 frame to 16:9 frame in the video capture pipeline. And converted frame would need further processing. Therefore I need to keep covered frame as CVImageBufferRef. I looked at this stack overflow thread, and borrow some idea from…
user454083
  • 1,337
  • 3
  • 16
  • 31
1
vote
2 answers

CMSampleBuffer from AVCaptureVideoDataOutput unexpectedly found nil

I am trying to convert the frames that I'm getting from AVCaptureVideoDataOutput delegate (as CMSampleBuffer) to UIImage. However I'm getting a fatal error: unexpectedly found nil while unwrapping an Optional value Can someone tell me what is…
Lightsout
  • 3,454
  • 2
  • 36
  • 65
1
vote
1 answer

CMBlockBuffer ownership in CMSampleBuffer

I'm writing code to decompress a native annex-B H.264 stream, and I'm going through the process of parsing the stream, creating a CMVideoFormatDescription from the SPS/PPS NALUs, and wrapping the other NALUs I extract from the stream in…
Jim B.
  • 4,512
  • 3
  • 25
  • 53
1
vote
0 answers

macOS - How to add text to CMSampleBuffer in Swift?

I'm new to macOS development. I was trying to put some attributed text on my video frame by frame, but don't know how to deal with the CMSampleBuffer. Googled some article but doesn't get anything, should I convert it to something else like image,…
Rice
  • 11
  • 4
1
vote
0 answers

AVCaptureSession pixel format conversation

The documentation states that the first element in the AVCaptureVideoDataOutput.availableVideoCVPixelFormatTypes array is the most efficient pixel format to use (i. e. it means no further conversion work). I'm planning to use Metal in order to…
Roi Mulia
  • 5,626
  • 11
  • 54
  • 105
1
vote
1 answer

what methods of SampleBuffer do I must use for measurement of frame rate?

I work with AvFoundation. I need to measure accurately frame rate from ios camera. Algoritm: Frame rate = 1/(time(f2)-time(f1)) = __ (frame per second); Where time(f2) – it's time when come second frame, and (f1) – it's time of first frame. How…
Andrew Kachalin
  • 229
  • 2
  • 13