How to encode raw video obtained from startRawRecording?

Description
Hello @jon.zoom ,
I have problems with the quality of the encoded video that I get from the raw video obtained after recording with startRawRecording. Please see image below.
I am not sure if the problem is with the encoding or with how am I saving the raw video.

I’m saving the raw video using the next code:

// Fired after the renderer is subscribed to the user's video stream
- (void)onRawDataReceived:(ZoomSDKYUVRawDataI420 *)data {
    char *bufferData = [data getBuffer];
    unsigned int bufferLen = [data getBufferLen];    
    [nsmdata appendBytes:bufferData length:bufferLen];
    BOOL written = [nsmdata writeToFile:filePath atomically:YES];
}

This is the command that I use to encode the video:

ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 640x360 -framerate 25 -i rawRecording-16778240.yuv -f mp4 rawRecording-16778240.mp4

Which macOS Meeting SDK version
zoom-sdk-macos-5.15.5.20804.

Device:

  • Device: [e.g. Apple MacBook Pro (16-inch, Intel)]
  • OS: [macOS Ventura 13.4.1 ]

@chump Hello Chris!
I saw that you solve the encoding problem with this work around here

Currently I’m saving the file like this, but I have this green bar above. However, the video is ok…ish, see image above.

// Fired after the renderer is subscribed to the user's video stream
- (void)onRawDataReceived:(ZoomSDKYUVRawDataI420 *)data {
    char *bufferData = [data getBuffer];
    unsigned int bufferLen = [data getBufferLen];    
    [nsmdata appendBytes:bufferData length:bufferLen];
    BOOL written = [nsmdata writeToFile:filePath atomically:YES];
}

I am trying to implement your solution with Objective-C in Xcode using the Y,U and V buffers, appending them and writing to the same file, but it is not working… This is what I am trying:

// Fired after the renderer is subscribed to the user's video stream
- (void)onRawDataReceived:(ZoomSDKYUVRawDataI420 *)data {    

         //Get raw data
        char *YbufferData = [data getYBuffer];
        char *UbufferData = [data getUBuffer];
        char *VbufferData = [data getVBuffer];
        
        unsigned int bufferLen = [data getBufferLen];
        
        //Append bytes
        [nsmdataY appendBytes:YbufferData length:bufferLen];
        [nsmdataU appendBytes:UbufferData length:bufferLen];
        [nsmdataV appendBytes:VbufferData length:bufferLen];
        
        //Write to filePath
        BOOL writtenY = [nsmdataY writeToFile:filePath atomically:YES];
        BOOL writtenU = [nsmdataU writeToFile:filePath atomically:YES];
        BOOL writtenV = [nsmdataV writeToFile:filePath atomically:YES];

Could you please give me some advice about how to write the file properly?

Thanks and Regards,
Mauricio

@maltamirano, happy to try to help. Are you trying to build a meeting bot?

1 Like

@amanda-recallai Hello Amanda! I am trying to create an App that can extract the video streams to analyse them with an AI-System to give some feedback in real time to the participants based one the analysis made by the AI-System.
Do you know how can I use Gstreamer to encode in real time the raw video?

I already saw your blog entry about this, but it is not explained:

Thanks and regards,
Mauricio

@maltamirano, happy to help - will need to loop in an engineer on my side to walk you through this.

Feel free to email me at amanda [at] recall.ai and we can set up a time!

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