How to Fix the "Error while writing video frame (error=-28)" Error

Using oCam at work or school? A license is required, and it removes all ads, including this window. See the paid version →

When recording with oCam, the following error message may appear after a certain amount of time:


"Error while writing video frame (error=-28)"


This error (error code 28) occurs when the file system of the path where the recorded video file is being saved is formatted as FAT (FAT32). The FAT file system has a maximum single-file size limit of 4 GB, so this error occurs when the recorded file size exceeds 4 GB. Below is a detailed explanation of how to resolve this issue.


To fix this error, you can choose one of the following two methods:


1. Change the save path to an NTFS file system  

The NTFS file system has a much larger file size limit (up to 16 EB), so it can store video files larger than 4 GB without any problems. To change oCam's save path to a drive or folder that uses the NTFS format, follow these steps:  

1. In the oCam main window, click 'Tools' in the top menu, then select 'Options'.  

2. In the Settings window, click the 'Save' category in the left menu.  

3. Under the 'Save Path' item, check the current path and change it to another drive or folder that uses the NTFS file system (for example, `C:\Videos` or `D:\Recordings`).  

4. Click the 'OK' button to save the settings, restart oCam, and then try recording again.


2. Format the existing drive as NTFS  

If the drive you are currently using is formatted as FAT or FAT32, you can convert or format it to NTFS. However, formatting will erase all data on the drive, so be sure to back up any important files first. To format the drive, follow these steps:  

1. Open File Explorer and right-click the drive you want to format (for example, a USB drive or external hard drive).  

2. Select 'Format' and set the file system to 'NTFS'.  

3. Choose the formatting options, then click 'Start' to begin formatting.  

4. After formatting is complete, set that drive as the save path in oCam and use it.


Additional Checks  

- To check whether the drive's file system is FAT32, right-click the drive in File Explorer and select 'Properties' to view the file system information.  

- If the problem continues even after changing to NTFS, check whether the drive has enough free space and whether you have write permission.


By changing the save path to an NTFS file system or formatting the drive, you can save large video files over 4 GB without errors. After changing the settings, make a test recording to confirm that the problem has been resolved.

Another helpful tip

How to Reduce the Size of Recorded Video Files When Recording Games (NVIDIA Codec)

If you are using the NVIDIA NVENC H.264 codec by default, the recorded file size may be very large.


Click the Codec menu in oCam to check whether you are using the NVENC H.264 codec, as shown below.

In the oCam Codec menu, click Hardware Encoder Settings.

The Hardware Encoder Settings window will appear as shown below. You can reduce the size of the recorded video file by changing the options highlighted in the yellow box.

First, let's look at how to reduce the size of the recorded file using variable bitrate.

( Rate Control must be set to 1-PASS VBR. )


The Quantizer value can be set from 1 to 51.

The lower the Quantizer value, the better the video quality, and the higher the Quantizer value, the lower the video quality.

In other words, the recording quality is defined by the range from the minimum Quantizer value to the maximum Quantizer value.


For example, 

If the minimum Quantizer value is 1 and the maximum Quantizer value is 13, the recording quality range is 1 to 13.

If the minimum Quantizer value is 1 and the maximum Quantizer value is 51, the recording quality range is 1 to 51.

If the minimum Quantizer value is 13 and the maximum Quantizer value is 51, the recording quality range is 13 to 51.

In conclusion, to reduce the size of a recorded video file, increasing the minimum and maximum Quantizer values will lower the recording quality and reduce the file size.


You can adjust the Quantizer values depending on your needs, as follows.

If you want to maintain the highest recording quality while lowering the quality at certain points to reduce the size of the recorded video, set the minimum Quantizer value to 1 and set the maximum Quantizer value to a higher number depending on how much you want to reduce the quality.

( Example: Minimum Quantizer: 1, Maximum Quantizer: 30 )


If you want to maintain medium quality while lowering the quality as much as possible at certain points to reduce the size of the recorded video, set the minimum Quantizer to 26 and the maximum Quantizer value to 51.

For reference, the minimum Quantizer value cannot be greater than the maximum Quantizer value.

That is, the minimum Quantizer value <= the maximum Quantizer value.


Caution: If you set both the minimum Quantizer value and the maximum Quantizer value to 1, the recorded video file size will become extremely large, so do not use this setting.

The default values in oCam are a minimum Quantizer value of 1 and a maximum Quantizer value of 13, and we recommend setting them within the following range.

Minimum Quantizer >= 1 and Maximum Quantizer value >= 13


Next is how to reduce the size of the recorded video file using constant bitrate.

Change Rate Control to 1-PASS CBR and then set the average bitrate.



The higher the average bitrate, the better the video quality. The lower the bitrate, the lower the video quality and the smaller the recorded file size.


Finally, there is a method that uses a fixed Quantizer parameter.

Set Rate Control to 1-PASS Fixed Quantizer Parameter.



Unlike VBR, there is no concept of minimum and maximum Quantizer values, and the quality is set using a fixed Quantizer value.