{"action":"created","issue":{"url":"https://api.github.com/repos/QuickBlox/quickblox-ios-sdk/issues/404","repository_url":"https://api.github.com/repos/QuickBlox/quickblox-ios-sdk","labels_url":"https://api.github.com/repos/QuickBlox/quickblox-ios-sdk/issues/404/labels{/name}","comments_url":"https://api.github.com/repos/QuickBlox/quickblox-ios-sdk/issues/404/comments","events_url":"https://api.github.com/repos/QuickBlox/quickblox-ios-sdk/issues/404/events","html_url":"https://github.com/QuickBlox/quickblox-ios-sdk/issues/404","id":149623924,"number":404,"title":"Anyway to get the pixelbuffer for the video chat as it's being captured via an extended QBRTCVideoCapture class?","user":{"login":"astanton","id":3637526,"avatar_url":"https://avatars.githubusercontent.com/u/3637526?v=3","gravatar_id":"","url":"https://api.github.com/users/astanton","html_url":"https://github.com/astanton","followers_url":"https://api.github.com/users/astanton/followers","following_url":"https://api.github.com/users/astanton/following{/other_user}","gists_url":"https://api.github.com/users/astanton/gists{/gist_id}","starred_url":"https://api.github.com/users/astanton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astanton/subscriptions","organizations_url":"https://api.github.com/users/astanton/orgs","repos_url":"https://api.github.com/users/astanton/repos","events_url":"https://api.github.com/users/astanton/events{/privacy}","received_events_url":"https://api.github.com/users/astanton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2016-04-20T01:02:18Z","updated_at":"2016-04-21T11:18:51Z","closed_at":null,"body":"I'm currently looking at the video chat sample app.  \r\n\r\nMy use case is that I need to get the video stream from the client before it is sent to the receiver and I want to do some stuff to the pixel buffer before it is being sent over, such as changing it to black/white and things like that.\r\n\r\nSo far what I have been trying to do is take a look at the screen sharing and how that is done, and trying to write a class that extends `QBRTCVideoCapture` similar to `QBRTCScreeCapture` class in the sample video chat app.\r\n\r\nI see that in the `SharingViewController` the `self.session.localMediaStream.videoTrack.videoCapture` is set to an instance of the `QBRTCScreenCapture` class, so that is what I am looking at and trying to do something in there.\r\n\r\nI see that the `sendPixelBuffer` method is being called every 12 frames (5 times per 60fps).  And I see that it creates a pixelbuffer that is sent to the videoframe that is sent to the super function\r\n\r\nWhat I tried to do was extend that class by the `AVCaptureVideoDataOutputSampleBufferDelegate` delegate, and I have then set up my own camera capture and I have the `- ( void ) captureOutput (AVCaptureOutput * ) captureOutput didOutputSampleBuffer: ( CMSampleBufferRef ) sampleBuffer fromConnection: ( AVCaptureConnection * ) connection`delegate implemented, and I am creating a pixelBuffer from that of the current image that is being captured.\r\n\r\nI have verified that my image is correct by saving it to my phone and I see it's getting a black/white image.\r\n\r\nSo once I have the pixel buffer, I'm setting it to a member variable that is then being sent into the videoFrame in the `sendPixelBuffer` function.  \r\n\r\nNow this is KIND of working, in that I have seen a few frames being streamed over to the other phone, but at a VERY slow/unnaceptable frame rate, and then it crashes down in the `[super sendVideoFrame:videoFrame];` call in a `CVPixelBufferUnlockBaseAddress(self.currentPixelBufferRef, 0)` call.  \r\n\r\nSo I am wondering if there is an easier way to do this, rather than trying to create my own class and video feed like this, and if I do have to do it this way, what exactly am I doing wrong?  \r\n\r\nThe frame rate on the default videoCapture object that is used for the normal video chat in the app is VERY smooth and performant, but like I said when I tried it this way, it was VERY choppy for the 4-5 frames that worked (I'm talking like 1FPS) before it crashes.\r\n\r\nAny ideas?"},"comment":{"url":"https://api.github.com/repos/QuickBlox/quickblox-ios-sdk/issues/comments/212865218","html_url":"https://github.com/QuickBlox/quickblox-ios-sdk/issues/404#issuecomment-212865218","issue_url":"https://api.github.com/repos/QuickBlox/quickblox-ios-sdk/issues/404","id":212865218,"user":{"login":"astanton","id":3637526,"avatar_url":"https://avatars.githubusercontent.com/u/3637526?v=3","gravatar_id":"","url":"https://api.github.com/users/astanton","html_url":"https://github.com/astanton","followers_url":"https://api.github.com/users/astanton/followers","following_url":"https://api.github.com/users/astanton/following{/other_user}","gists_url":"https://api.github.com/users/astanton/gists{/gist_id}","starred_url":"https://api.github.com/users/astanton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astanton/subscriptions","organizations_url":"https://api.github.com/users/astanton/orgs","repos_url":"https://api.github.com/users/astanton/repos","events_url":"https://api.github.com/users/astanton/events{/privacy}","received_events_url":"https://api.github.com/users/astanton/received_events","type":"User","site_admin":false},"created_at":"2016-04-21T11:18:51Z","updated_at":"2016-04-21T11:18:51Z","body":"Even when I just use the \"normal\" video call on the sample application (not using my custom capture class), with `[QBRTCConfig mediaStreamConfiguration].videoCodec = QBRTCVideoCodecH264;` being called in the AppDelegate, the report is reporting `VPS`. \r\n\r\nI just downloaded a clean version of the sample video chat as well, and put the `[QBRTCConfig mediaStreamConfiguration].videoCodec = QBRTCVideoCodecH264;` call in the `CallViewController.m` at the initialization method, then turned on reporting, and it is still reporting VPS.\r\n\r\n@Pro100Andrey okay I will give that a try now and report back."}}