# ZoomVideoSDKVideoSender.sendVideoFrame not working as expected

**URL:** <https://devforum.zoom.us/t/zoomvideosdkvideosender-sendvideoframe-not-working-as-expected/94340>\
**Category:** iOS\
**Created:** [September 1, 2023, 1:52pm UTC](https://devforum.zoom.us/t/zoomvideosdkvideosender-sendvideoframe-not-working-as-expected/94340 "2023-09-01T13:52:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nfayad](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/nfayad/32/35015_2.png) [@nfayad](https://devforum.zoom.us/u/nfayad)\
**Post date:** [September 1, 2023, 1:52pm UTC](https://devforum.zoom.us/t/zoomvideosdkvideosender-sendvideoframe-not-working-as-expected/94340/1 "2023-09-01T13:52:50Z")

</div>

**Description**  
I am trying to send raw frames using the `sendVideoFrame` function of the `ZoomVideoSDKVideoSender` class. For simplicity I created a side sample app to test this functionality using the [1280 x 720 video file](https://test-videos.co.uk/bigbuckbunny/mp4-h264) referenced in [this post](https://devforum.zoom.us/t/sendvideoframe-does-not-work-as-expected/90163). Specifically, here’s my code for the sending process:

```swift
    func startProcessing() {
        self.assetReader?.startReading()
        
        while self.videoIsPlaying > 0 {
            if let sampleBuffer = self.videoTrackOutput?.copyNextSampleBuffer() {
                // Get the YUV buffer data
                if let imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer) {
                    print(imageBuffer.getFormat())
                    let width = CVPixelBufferGetWidth(imageBuffer)
                    let height = CVPixelBufferGetHeight(imageBuffer)
                    
                    let frameLen = CVPixelBufferGetDataSize(imageBuffer)
                    
                    // Access the YUV data (ensure the memory block is locked for reading)
                    CVPixelBufferLockBaseAddress(imageBuffer, CVPixelBufferLockFlags.readOnly)
                    let rawPointer = CVPixelBufferGetBaseAddress(imageBuffer)
                    
                    // Convert UnsafeMutableRawPointer to UnsafeMutablePointer<CChar>
                    let frameBuffer = rawPointer?.assumingMemoryBound(to: CChar.self)
                    
                    // Send the YUV buffer to the video sender
                    sendVideoFrame(frameBuffer, width, height, frameLen, 0)
                    
                    CVPixelBufferUnlockBaseAddress(imageBuffer, CVPixelBufferLockFlags.readOnly)
                    
       
                }
                CMSampleBufferInvalidate(sampleBuffer)
            } else {
                // End of file or an error occurred
                self.videoIsPlaying = -1
            }
        }
    }

    func sendVideoFrame(_ frameBuffer: UnsafeMutablePointer<CChar>?, _ width: Int, _ height: Int, _ frameLen: Int, _ timestamp: Int64) {
        if let sender = frameSender, let buffer = frameBuffer {
            sender.sendVideoFrame(buffer, width: UInt(width), height: UInt(height), dataLength: UInt(frameLen), rotation: .rotationNone, format: .I420)
            print("Frame sent")
        } else {
            print("Sender is not initialized")
        }
    }

```

and I’m seeing the following logs for each frame when sending:

> Pixel format: YUV420 Bi-Planar (full range)  
> Frame sent

Additionally, I have subscribed each of the 2 participants to the other’s video pipe as follow:  
`other.getVideoPipe()?.subscribe(with: self, resolution: ._720)`

And implemented `ZoomVideoSDKRawDataPipeDelegate` as follows:

```swift
extension ZoomViewController: ZoomVideoSDKRawDataPipeDelegate {
    func onPixelBuffer(_ pixelBuffer: CVPixelBuffer?, rotation: ZoomVideoSDKVideoRawDataRotation) {
        print("Frame received")
    }
    
    func onRawDataFrameReceived(_ rawData: ZoomVideoSDKVideoRawData?) {
        print("Received raw frame ")
    }
}

```

The problem is, with all steps being successful on the first side, up to the `Frame sent` log, nothing is happening on the other side, no frames are received, and neither of the log messages in the implemented delegate is being printed.

**Which iOS Video SDK version?**  
1.8.10

---

<div class="post-metadata">

**Author:** ![wbaroudi](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/wbaroudi/32/30319_2.png) [@wbaroudi](https://devforum.zoom.us/u/wbaroudi)\
**Post date:** [September 5, 2023, 10:49am UTC](https://devforum.zoom.us/t/zoomvideosdkvideosender-sendvideoframe-not-working-as-expected/94340/2 "2023-09-05T10:49:22Z")

</div>

Any solution for this? I’m facing the same issue, tried the sample video too and got nothing

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [October 5, 2023, 8:50pm UTC](https://devforum.zoom.us/t/zoomvideosdkvideosender-sendvideoframe-not-working-as-expected/94340/3 "2023-10-05T20:50:09Z")

</div>

Closed on October 5, 2023, 8:50pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
