# Working with the Zoom RAW video data .yuv file

**URL:** <https://devforum.zoom.us/t/working-with-the-zoom-raw-video-data-yuv-file/104379>\
**Category:** Linux\
**Tags:** recording, video-sdk\
**Created:** [February 22, 2024, 10:14am UTC](https://devforum.zoom.us/t/working-with-the-zoom-raw-video-data-yuv-file/104379 "2024-02-22T10:14:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gofmannir](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gofmannir/32/56746_2.png) [@gofmannir](https://devforum.zoom.us/u/gofmannir)\
**Post date:** [February 22, 2024, 10:14am UTC](https://devforum.zoom.us/t/working-with-the-zoom-raw-video-data-yuv-file/104379/1 "2024-02-22T10:14:27Z")

</div>

Hello,  
I successfully implemented a meeting bot that joins the meeting and records the video and audio using the example code (Linux SDK with ubuntu container).

So, the bot generate a .yuv file, I’ve tried to open the file with vlc using:

```auto
/Applications/VLC.app/Contents/MacOS/VLC --rawvid-fps 25 --rawvid-width 1920 --rawvid-height 1080 --rawvid-chroma I420 output.yuv

```

but got the frames in a very weird format (see image attached)

 ![Screenshot 2024-02-22 at 12.00.07](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/e/0/e0cec916f82729397a7bcac32c955591c4ce9e82.jpeg)

Also, tried using ffmpeg:

```auto
 ~/Downloads/ffmpeg -s 640x480 -i output.yuv -ss 00:00:00 -c:v libx264 -s:v 640x480 -preset slow -t 00:08:20 output.mp4

```

But again the frames always “jumps”, see image:

 ![Screenshot 2024-02-22 at 12.07.11](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/8/6/860a07fb1eaf0bbba2b21459ef26461ccb2aabd4.jpeg)

Also tried 320x160 resolution.

Also tried to stream the file to custom RTMP server using ffmpeg but same results (As @MaxM Described here: [https://devforum.zoom.us/t/live-streaming-with-rtmp/63328/3](https://devforum.zoom.us/t/live-streaming-with-rtmp/63328/3))

cc: @chunsiong.zoom

Appreciate any help working with this file format.

Here is the code which generates the output.yuv file:

```auto
void ZoomSDKRenderer::SaveToRawYUVFile(YUVRawDataI420* data) {

	// Open the file for writing
	std::ofstream outputFile("output.yuv", std::ios::out | std::ios::binary | std::ios::app);
	if (!outputFile.is_open())
	{
		std::cout << "Error opening file." << std::endl;
		return;
	}
	// Calculate the sizes for Y, U, and V components
	size_t ySize = data->GetStreamWidth() * data->GetStreamHeight();
	size_t uvSize = ySize / 4;

	// Write Y, U, and V components to the output file
	outputFile.write(data->GetYBuffer(), ySize);
	outputFile.write(data->GetUBuffer(), uvSize);
	outputFile.write(data->GetVBuffer(), uvSize);

	// Close the file
	outputFile.close();
	outputFile.flush();
}

```

---

<div class="post-metadata">

**Author:** ![Wang](https://avatars.discourse-cdn.com/v4/letter/w/edb3f5/32.png) [@Wang](https://devforum.zoom.us/u/Wang)\
**Post date:** [February 23, 2024, 2:31am UTC](https://devforum.zoom.us/t/working-with-the-zoom-raw-video-data-yuv-file/104379/2 "2024-02-23T02:31:09Z")

</div>

You can try to deal with it this way.

```auto
...
size_t len = data-> GetBufferLen();
outputFile.write(data->GetBuffer(), len);
...

```

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 23, 2024, 3:00am UTC](https://devforum.zoom.us/t/working-with-the-zoom-raw-video-data-yuv-file/104379/3 "2024-02-23T03:00:14Z")

</div>

@gofmannir I’ve tried your implementation of saving the file, it works fine.

For ffmpeg conversion, I’m doing it like this

`ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 640*360 -framerate 25 -i chrome.yuv -f mp4 chrome.mp4`

---

<div class="post-metadata">

**Author:** ![gofmannir](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gofmannir/32/56746_2.png) [@gofmannir](https://devforum.zoom.us/u/gofmannir)\
**Post date:** [February 23, 2024, 9:49pm UTC](https://devforum.zoom.us/t/working-with-the-zoom-raw-video-data-yuv-file/104379/4 "2024-02-23T21:49:24Z")

</div>

@chunsiong.zoom That worked! thanks :).  
Now, in anther related topic, there is the ‘.pcm’ audio file, There is a useful command to combine both the video and the audio to the mp4 file?

---

<div class="post-metadata">

**Author:** ![gofmannir](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gofmannir/32/56746_2.png) [@gofmannir](https://devforum.zoom.us/u/gofmannir)\
**Post date:** [February 24, 2024, 1:29pm UTC](https://devforum.zoom.us/t/working-with-the-zoom-raw-video-data-yuv-file/104379/5 "2024-02-24T13:29:47Z")

</div>

Iv’e used 2 ffmpeg commands like this:

```auto
ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 640*360 -framerate 25 -i output.yuv -f mp4 video.mp4 && ffmpeg -i video.mp4 -f s16le -ar 32000 -ac 1 -i audio.pcm -c:v copy -c:a aac -strict experimental final.mp4

```

@chunsiong.zoom Maybe you know a better way with 1 command?  
Also, is it right the 32000hz ? not seen it in the documentation.

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 26, 2024, 4:38am UTC](https://devforum.zoom.us/t/working-with-the-zoom-raw-video-data-yuv-file/104379/6 "2024-02-26T04:38:35Z")

</div>

@gofmannir the sample rate is 32000hz.

The command which you have shared should work for muxing

---

<div class="post-metadata">

**Author:** ![akshat.amrit](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/akshat.amrit/32/58726_2.png) [@akshat.amrit](https://devforum.zoom.us/u/akshat.amrit)\
**Post date:** [April 17, 2024, 12:29pm UTC](https://devforum.zoom.us/t/working-with-the-zoom-raw-video-data-yuv-file/104379/7 "2024-04-17T12:29:59Z")

</div>

I’m facing the same issue but on android. Can anybody help: [Save raw Videosdk data to file](https://devforum.zoom.us/t/save-raw-videosdk-data-to-file/108060)?
