# Unable to write MP4 tag when change would make the processing of file size go over 4GB threshold

**URL:** https://community.mp3tag.de/t/unable-to-write-mp4-tag-when-change-would-make-the-processing-of-file-size-go-over-4gb-threshold/65218
**Category:** Fixed Bugs
**Tags:** bug-fixed
**Created:** [July 6, 2024, 1:46pm UTC](https://community.mp3tag.de/t/unable-to-write-mp4-tag-when-change-would-make-the-processing-of-file-size-go-over-4gb-threshold/65218 "2024-07-06T13:46:04Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![GrayUser4865](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/7ba0ec/32.png) [@GrayUser4865](https://community.mp3tag.de/u/GrayUser4865)
#### Post date: [July 6, 2024, 1:46pm UTC](https://community.mp3tag.de/t/unable-to-write-mp4-tag-when-change-would-make-the-processing-of-file-size-go-over-4gb-threshold/65218/1 "2024-07-06T13:46:04Z")

</div>

Hi,

On my Win11 X64 computer, I have a video MP4 file size of 4,300,971,434 bytes. I am trying to add a cover of 6 MB, I received an error, cannot write file.

Note that I had this on other files that are also very close to 4GB, so I am sure it is not file related. Other files that are 4.05 GB or 3.90 GB work fine with same type of change, it is always the one that are near 4.0GB that fail.

My guest here is that when writing file tag on MP4, if the temporary file size goes below the 4GB threshold and the new final file would go over the 4GB, some check avoid the write.

I used latest 3.26 release and 3.26c and the issue is still present.

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [July 6, 2024, 1:48pm UTC](https://community.mp3tag.de/t/unable-to-write-mp4-tag-when-change-would-make-the-processing-of-file-size-go-over-4gb-threshold/65218/2 "2024-07-06T13:48:48Z")

</div>

What file system do you use for your Win11 x64 Computer?  
NTFS?

Do you try to change your 4 GB file locally?

---

<div class="post-metadata">

### Author: ![GrayUser4865](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/7ba0ec/32.png) [@GrayUser4865](https://community.mp3tag.de/u/GrayUser4865)
#### Post date: [July 6, 2024, 1:49pm UTC](https://community.mp3tag.de/t/unable-to-write-mp4-tag-when-change-would-make-the-processing-of-file-size-go-over-4gb-threshold/65218/3 "2024-07-06T13:49:35Z")

</div>

It is NTFS and it is localy on the C drive, same as system.

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [July 6, 2024, 1:50pm UTC](https://community.mp3tag.de/t/unable-to-write-mp4-tag-when-change-would-make-the-processing-of-file-size-go-over-4gb-threshold/65218/4 "2024-07-06T13:50:31Z")

</div>

Your 6 MB cover has what picture format?  
JPG? PNG?

---

<div class="post-metadata">

### Author: ![GrayUser4865](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/7ba0ec/32.png) [@GrayUser4865](https://community.mp3tag.de/u/GrayUser4865)
#### Post date: [July 6, 2024, 1:51pm UTC](https://community.mp3tag.de/t/unable-to-write-mp4-tag-when-change-would-make-the-processing-of-file-size-go-over-4gb-threshold/65218/5 "2024-07-06T13:51:27Z")

</div>

PNG. I just tried with a 600KB jpg and it work fine.

Note that I used PNG for all the other files (that are bigger or smaller) without issue.

I just tried also same file with same PNG image but slowly reducing the image size by resizing.  
5.38MB, 5.02MB, 4.59 MB, 4.16MB, 3.72 MB ... until it finally passed with a 1.43 MB cover file.

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [July 6, 2024, 1:58pm UTC](https://community.mp3tag.de/t/unable-to-write-mp4-tag-when-change-would-make-the-processing-of-file-size-go-over-4gb-threshold/65218/6 "2024-07-06T13:58:48Z")

</div>

Are you sure that this is not a problem with this specific 6 MB PNG cover picture?

If you try it with another, bigger or sligthly smaller cover picture it works?  
What if you convert this 6 MB PNG to a JPG?

---

<div class="post-metadata">

### Author: ![GrayUser4865](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/7ba0ec/32.png) [@GrayUser4865](https://community.mp3tag.de/u/GrayUser4865)
#### Post date: [July 6, 2024, 2:02pm UTC](https://community.mp3tag.de/t/unable-to-write-mp4-tag-when-change-would-make-the-processing-of-file-size-go-over-4gb-threshold/65218/7 "2024-07-06T14:02:31Z")

</div>

I just update my previous comment.

In the past, I had the same issue with a change in the Comment field, with a file around the 4GB size, and it failed too, until I reduce the comment length.

So I am pretty sure it is related to file size of the temporary process of final write. Could be a call to an old 32 bit call or path because the file without tags is below 4GB but when adding tags it goes over the 4GB limit and the 32 bit path will not process that.

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [July 6, 2024, 2:03pm UTC](https://community.mp3tag.de/t/unable-to-write-mp4-tag-when-change-would-make-the-processing-of-file-size-go-over-4gb-threshold/65218/8 "2024-07-06T14:03:29Z")

</div>

> [@GrayUser4865](#):
>
> Could be a call to an old 32 bit call

> [@GrayUser4865](#):
>
> I used latest 3.26 release and 3.26c and the issue is still present.

Do you use the 32bit or 64bit version of Mp3tag?  
Menu Help -\> About Mp3tag

---

<div class="post-metadata">

### Author: ![GrayUser4865](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/7ba0ec/32.png) [@GrayUser4865](https://community.mp3tag.de/u/GrayUser4865)
#### Post date: [July 6, 2024, 2:05pm UTC](https://community.mp3tag.de/t/unable-to-write-mp4-tag-when-change-would-make-the-processing-of-file-size-go-over-4gb-threshold/65218/9 "2024-07-06T14:05:30Z")

</div>

64-bit portable

here is the log part:

## MESSAGE

File: y:\projects\_audio\smp4file.cpp  
Line: 568  
Message: write: overflow (C:\Users\GrayG\Desktop\R\Doctor Who\Season 06\Doctor Who - S06E13 - The Wedding Of River Song.mp4)  
00004AE8 at 27:45.438914

---

<div class="post-metadata">

### Author: ![GrayUser4865](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/7ba0ec/32.png) [@GrayUser4865](https://community.mp3tag.de/u/GrayUser4865)
#### Post date: [July 6, 2024, 2:25pm UTC](https://community.mp3tag.de/t/unable-to-write-mp4-tag-when-change-would-make-the-processing-of-file-size-go-over-4gb-threshold/65218/10 "2024-07-06T14:25:47Z")

</div>

Perhaps it could help, when this failed, I was doing the cover change (same PNG) for a lot of mp4 files that were having various size, from 1MB to 4.5 MB, all other files passed except this one. It is the only one with 4.00 GB size in the propriety. All other near were 4.0x or more, and or lower 3.95 and below.

Again in the past I had same issue with file with similar size, any change in the tag could produce this, not linked to only cover change. Cover change issue is easier to detect because you do not need to have a file that is too close to the 4 GB.

Used a 3.98 MB file that was working with the 6MB PNG. I used a 16MB PNG and got the same write error:

## MESSAGE

File: y:\projects\_audio\smp4file.cpp  
Line: 568  
Message: write: overflow (C:\Users\GrayG\Desktop\R\1.mp4)  
00000084 at 24:16.584117

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [July 7, 2024, 7:00am UTC](https://community.mp3tag.de/t/unable-to-write-mp4-tag-when-change-would-make-the-processing-of-file-size-go-over-4gb-threshold/65218/11 "2024-07-07T07:00:24Z")

</div>

The problem is related to the chunk-offset atom `stco` in the problematic file, which holds the 32-bit chunk offsets. Because the file size is at the brink of exceeding the unsigned int 32-bit range, an overflow is produced when trying to remap the offsets during a tag update that exceeds this range.

I think what's needed in those cases is to drop the `stco` atom and create a `co64` atom, which can hold 64-bit chunk offsets. Easier said than done, though 😃

Thanks for reporting!

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [July 26, 2024, 1:09pm UTC](https://community.mp3tag.de/t/unable-to-write-mp4-tag-when-change-would-make-the-processing-of-file-size-go-over-4gb-threshold/65218/12 "2024-07-26T13:09:42Z")

</div>

This is now fixed with [Mp3tag v3.26e](https://community.mp3tag.de/t/455).

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [August 25, 2024, 1:10pm UTC](https://community.mp3tag.de/t/unable-to-write-mp4-tag-when-change-would-make-the-processing-of-file-size-go-over-4gb-threshold/65218/13 "2024-08-25T13:10:03Z")

</div>

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