# Windows Meeting SDK, Video RawData Recording Frames Saved on Disk but file is not Playable

**URL:** <https://devforum.zoom.us/t/windows-meeting-sdk-video-rawdata-recording-frames-saved-on-disk-but-file-is-not-playable/73541>\
**Category:** Windows\
**Tags:** meeting-sdk\
**Created:** [August 3, 2022, 6:39pm UTC](https://devforum.zoom.us/t/windows-meeting-sdk-video-rawdata-recording-frames-saved-on-disk-but-file-is-not-playable/73541 "2022-08-03T18:39:49Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [August 3, 2022, 6:39pm UTC](https://devforum.zoom.us/t/windows-meeting-sdk-video-rawdata-recording-frames-saved-on-disk-but-file-is-not-playable/73541/1 "2022-08-03T18:39:49Z")

</div>

I am able to receive raw frames and successfully saved those to disk. But not able to play the saved file. After applying the below FFmpeg command showing the below error and encoder is also encoding the whole recorded video. That encoded video is playable but that is very odd. Please any suggestion or direction or anything I am implementing wrong here.

**ffmpeg -f rawvideo -pix\_fmt yuv420p -video\_size 640\*360 -framerate 25 -i c234e4b1-4803-42cf-a41e-010417414492-video.yuv -f mp4 output.mp4**

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/0/b/0bd4852f6a4e95793d99f0aa7ac94081ef0138cc.png)

```
virtual void onRawDataFrameReceived(YUVRawDataI420* data) {
	videoFile = fopen(videoFilePath.c_str(), "a+b");

	fwrite(data->GetBuffer(), data->GetBufferLen(), 1, videoFile);

	/*fwrite(data->GetYBuffer(), data->GetStreamHeight() * data->GetStreamWidth(), 1, videoFile);
	fwrite(data->GetYBuffer(), data->GetStreamHeight() * data->GetStreamWidth() / 4, 1, videoFile);
	fwrite(data->GetYBuffer(), data->GetStreamHeight() * data->GetStreamWidth() / 4, 1, videoFile);*/

	fclose(videoFile);
}

```

**Here is a video screenshot:**

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/f/5/f533f1ac0199d19279ca0680ad14353ef8e053fa.jpeg)

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [August 4, 2022, 3:08am UTC](https://devforum.zoom.us/t/windows-meeting-sdk-video-rawdata-recording-frames-saved-on-disk-but-file-is-not-playable/73541/2 "2022-08-04T03:08:51Z")

</div>

Welcome!

Thank you for posting @freelancer.nak! It looks like the issue is related to your FFmpeg command and not Zoom. First, can you share the following details:

1. **Which Windows Meeting SDK version?**

2. What have you tried to resolve this behavior you are seeing with FFmpeg? ( i.e [Stackoverflow thread](https://stackoverflow.com/questions/33564262/ffmpeg-packet-size-2073600-expected-frame-size-4147200))

3. Are you only seeing this FFmpeg error only when encoding a Zoom meeting recorded?

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [August 4, 2022, 8:34am UTC](https://devforum.zoom.us/t/windows-meeting-sdk-video-rawdata-recording-frames-saved-on-disk-but-file-is-not-playable/73541/3 "2022-08-04T08:34:30Z")

</div>

@donte.zoom Thanks for the quick reply.

Below are the details:

**1. zoom-sdk-windows-5.11.1.6653**  
**2. I have done a lot of R&D regarding that and also already tried many answers including the above shared StackOverflow thread.**  
**3. My problem is to play onRawDataFrameReceived saved video.**

As I already asked for any suggestions on how we can save Raw Data to Disk. Or If any fix with my logic then please share that also.

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [August 4, 2022, 9:30am UTC](https://devforum.zoom.us/t/windows-meeting-sdk-video-rawdata-recording-frames-saved-on-disk-but-file-is-not-playable/73541/4 "2022-08-04T09:30:12Z")

</div>

@donte.zoom  
ffmpeg -video\_size 1920x1080 -r 25 -pixel\_format yuv420p -i 4d2cde4f-2d1f-4939-aac1-13687b2cb4f5-video.yuv -vf yadif stockholm\_deInt.yuv

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/f/2/f2acd8e935bc5bab7733c7da7f973b2f1d6acc29.png)

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [August 4, 2022, 10:35pm UTC](https://devforum.zoom.us/t/windows-meeting-sdk-video-rawdata-recording-frames-saved-on-disk-but-file-is-not-playable/73541/5 "2022-08-04T22:35:57Z")

</div>

Thanks for the screenshot @freelancer.nak ! In your testing, have you been able to successfully execute the FFmpeg command without receiving that `Invalid argument ` error? The first thing I’d do is resolve the invalid argument error. This will help isolate whether the source of the behavior you are seeing when attempting to play the video is due to the onRawDataFrameReceived saved video or the FFmpeg command.

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [August 5, 2022, 4:06pm UTC](https://devforum.zoom.us/t/windows-meeting-sdk-video-rawdata-recording-frames-saved-on-disk-but-file-is-not-playable/73541/6 "2022-08-05T16:06:51Z")

</div>

@donte.zoom FFmpeg command is working fine when all the saved raw frames have the same height_width. Invalid argument error only happens when frames are of different height_width in the same saved file, please review the below logs to get some idea.

2022-08-05 21:35:12 =\> MeetingId: 89533431781 Connecting…  
2022-08-05 21:35:18 =\> MeetingId: 89533431781 InMeeting…  
2022-08-05 21:35:18 =\> Recording: Recording Started…  
2022-08-05 21:35:19 =\> Audio Raw Meta: 32000-1  
2022-08-05 21:35:19 =\> RawData ON…  
2022-08-05 21:35:19 =\> Raw Video Resolution: 640_360  
2022-08-05 21:35:21 =\> Raw Video Resolution is Changed from: 640_360 to: 480_270  
2022-08-05 21:35:26 =\> Raw Video Resolution is Changed from: 480_270 to: 640_360  
2022-08-05 21:35:29 =\> Raw Video Resolution is Changed from: 640_360 to: 480_270  
2022-08-05 21:35:34 =\> Raw Video Resolution is Changed from: 480_270 to: 640_360  
2022-08-05 21:36:44 =\> RawData OFF…  
2022-08-05 21:36:44 =\> MeetingId: 89533431781 DisConnecting…  
2022-08-05 21:36:45 =\> MeetingId: 89533431781 MeetingEnded…  
2022-08-05 21:36:45 =\> Recorded Video Resolution: 640_360

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [August 11, 2022, 3:08am UTC](https://devforum.zoom.us/t/windows-meeting-sdk-video-rawdata-recording-frames-saved-on-disk-but-file-is-not-playable/73541/7 "2022-08-11T03:08:50Z")

</div>

@donte.zoom Hi, finally I resolved my issue myself. Sharing solution that may be save others time.

**Ffmpeg Helper Header file:**

extern “C”  
{  
#include \<libswscale/swscale.h\>  
#include \<libavutil/avutil.h\>  
#include \<libavutil/imgutils.h\>  
#include \<libavutil/opt.h\>  
#include \<libavutil/frame.h\>  
#include \<libavutil/mem.h\>  
#include \<libavcodec/avcodec.h\>  
#pragma comment (lib,“avcodec.lib”)  
#pragma comment (lib,“avutil.lib”)  
#pragma comment (lib,“swscale.lib”)  
}

class FFmpegHelper  
{  
public:  
AVFrame\* allocPicture(enum AVPixelFormat pix\_fmt, int width, int height);  
AVFrame\* frameConversion(char\* y, char\* u, char\* v, int srcWidth, int srcHeight);  
};

**Ffmpeg Source File:**

#include “ffmpeg-helper.h”

AVFrame\* FFmpegHelper::allocPicture(enum AVPixelFormat pix\_fmt, int width, int height)  
{  
// Allocate a frame  
AVFrame\* frame = av\_frame\_alloc();

```
if (frame == NULL)
{
	fprintf(stderr, "avcodec_alloc_frame failed");
}

if (av_image_alloc(frame->data, frame->linesize, width, height, pix_fmt, 1) < 0)
{
	fprintf(stderr, "av_image_alloc failed");
}

frame->width = width;
frame->height = height;
frame->format = pix_fmt;

return frame;

```

}

AVFrame\* FFmpegHelper::frameConversion(char\* y, char\* u, char\* v, int srcWidth, int srcHeight)  
{  
SwsContext\* resize;  
int width = 640;  
int height = 360;

```
AVFrame* src = allocPicture(AVPixelFormat::AV_PIX_FMT_YUV420P, srcWidth, srcHeight);
AVFrame* dst = allocPicture(AVPixelFormat::AV_PIX_FMT_YUV420P, width, height);

src->data[0] =(uint8_t*) y;
src->data[1] =(uint8_t*) u;
src->data[2] =(uint8_t*) v;

resize = sws_getContext(
	srcWidth,
	srcHeight,
	AVPixelFormat::AV_PIX_FMT_YUV420P,
	width,
	height,
	AVPixelFormat::AV_PIX_FMT_YUV420P,
	SWS_LANCZOS | SWS_ACCURATE_RND,
	NULL,
	NULL,
	NULL);

int response = sws_scale(
	resize,
	src->data,
	src->linesize,
	0,
	height,
	dst->data,
	dst->linesize);

return dst;

```

}

Here is recording saving

videoFile = fopen(videoFilePath.c\_str(), “ab”);

```
		auto height = data->GetStreamHeight();
		auto width = data->GetStreamWidth();

		AVFrame* yuvScaled = ffmpegHelper.frameConversion(data->GetYBuffer(), data->GetUBuffer(), data->GetVBuffer(), width, height);

		auto yPlanar = 640 * 360;
		auto uPlanar = (yPlanar / 4);
		auto vPlanar = (yPlanar / 4);

		fwrite(yuvScaled->data[0], yPlanar, 1, videoFile);
		fwrite(yuvScaled->data[1], uPlanar, 1, videoFile);
		fwrite(yuvScaled->data[2], vPlanar, 1, videoFile);

		fclose(videoFile);

```

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [August 11, 2022, 4:43am UTC](https://devforum.zoom.us/t/windows-meeting-sdk-video-rawdata-recording-frames-saved-on-disk-but-file-is-not-playable/73541/8 "2022-08-11T04:43:53Z")

</div>

Awesome, @freelancer.nak! Glad you were able to figure out the solution. Can you share more context on how you arrived at the solution you’ve shared above? This will help anyone else who has the same issue that comes across this at a later date.

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [August 12, 2022, 5:11am UTC](https://devforum.zoom.us/t/windows-meeting-sdk-video-rawdata-recording-frames-saved-on-disk-but-file-is-not-playable/73541/10 "2022-08-12T05:11:54Z")

</div>

I figured it out from ‘Invalid Argument’ ffmpeg command error. When raw video file have same width_height frames then ffmpeg command is working fine. Then realised and tried to implement sws\_scale to scale all the frames with same width_height and boom above shared code is now working fine.

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [August 12, 2022, 7:47pm UTC](https://devforum.zoom.us/t/windows-meeting-sdk-video-rawdata-recording-frames-saved-on-disk-but-file-is-not-playable/73541/11 "2022-08-12T19:47:06Z")

</div>

Is currently Windows Native SDK ( **zoom-sdk-windows-5.11.1.6653** ) supporting ScreenShare RawData recording?

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [August 15, 2022, 8:41am UTC](https://devforum.zoom.us/t/windows-meeting-sdk-video-rawdata-recording-frames-saved-on-disk-but-file-is-not-playable/73541/12 "2022-08-15T08:41:39Z")

</div>

@donte.zoom Please reply → [Here](https://devforum.zoom.us/t/windows-meeting-sdk-video-rawdata-recording-frames-saved-on-disk-but-file-is-not-playable/73541/11)

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [August 15, 2022, 9:03am UTC](https://devforum.zoom.us/t/windows-meeting-sdk-video-rawdata-recording-frames-saved-on-disk-but-file-is-not-playable/73541/13 "2022-08-15T09:03:32Z")

</div>

@freelancer.nak Yes, ScreenShare RawData recording is supported.

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [August 15, 2022, 9:23am UTC](https://devforum.zoom.us/t/windows-meeting-sdk-video-rawdata-recording-frames-saved-on-disk-but-file-is-not-playable/73541/14 "2022-08-15T09:23:28Z")

</div>

I have subscribed RawData

rawRender-\>subscribe(participant, ZoomSDKRawDataType::RAW\_DATA\_TYPE\_SHARE);

but unable to receive frames. Any suggestion or doc?.

Thanks.

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [August 15, 2022, 10:04am UTC](https://devforum.zoom.us/t/windows-meeting-sdk-video-rawdata-recording-frames-saved-on-disk-but-file-is-not-playable/73541/15 "2022-08-15T10:04:35Z")

</div>

@freelancer.nak ,

Here is our documentation for Raw Data. Please double-check local recording permission for the current user.

> **[Window Raw Data](https://marketplace.zoom.us/docs/sdk/native-sdks/windows/raw-data/)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [August 15, 2022, 10:15am UTC](https://devforum.zoom.us/t/windows-meeting-sdk-video-rawdata-recording-frames-saved-on-disk-but-file-is-not-playable/73541/16 "2022-08-15T10:15:59Z")

</div>

@donte.zoom I fixed that. Wrong way subscribed ScreeShare Raw. I have subscribed that inside onSharingStatus(status, userid) and things are working fine now.

Is there any way to merge and build single video from multiuser video streams or any layout thing we can subscribe inside SDK?

Thanks.

---

<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:** [September 14, 2022, 8:16pm UTC](https://devforum.zoom.us/t/windows-meeting-sdk-video-rawdata-recording-frames-saved-on-disk-but-file-is-not-playable/73541/17 "2022-09-14T20:16:01Z")

</div>

Closed on September 14, 2022, 8:16pm UTC

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