ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: AndrewSB on December 14, 2019, 12:50:02 AM

Title: Error: '0x0d0d0d0d' atom is too large for rewriting (209 MB)
Post by: AndrewSB on December 14, 2019, 12:50:02 AM
Hey! I'm not an expert, so this might be relatively obvious, I searched and I couldn't find anything similar. I'm trying to edit the tags of some (small) mp4 files, an example command is
`exiftool '-IPTC:Keywords=test' /Users/asb/Desktop/IMG_0729.mp4`, the one I'm actually trying to run is `exiftool '-MyTimeStamps=2015:09:13 21:05:35' ~/Desktop/IMG_0729.mp4`, where `MyTimeStamps` is defined in my config as:

```
%Image::ExifTool::UserDefined::Shortcuts = (
        MyTimeStamps => ['QuickTime:CreateDate', 'QuickTime:ModifyDate', 'Track1:MediaModifyDate', 'Track1:MediaCreateDate', 'Track1:TrackModifyDate', 'Track1:TrackCreateDate', 'Track2:MediaModifyDate', 'Track2:MediaCreateDate', 'Track2:TrackModifyDate', 'Track2:TrackCreateDate']
);
```

The error I'm getting (when I run either of the above two commands) is
```
Error: '0x07070702' atom is too large for rewriting (112 MB) - /Users/asb/Desktop/IMG_0729.mp4
    0 image files updated
    1 files weren't updated due to errors
```
. I tried it with another mp4 file just to make sure I didn't have a strangely corrupted file, similar error, just a different hex value for the atom (0x0d0d0d0d, for the other file).

The only sketchy thing I've noticed is that when I try `exiftool -a -s -G` on the file, there's output that says "[ExifTool]      Warning                         : Truncated 'x0dx0dx0dx0d' data". I couldn't find anything on google/the forums that was similar.
I'm going to email you the file I'm working with so you have something to repro with. Thank you for all of your hard work over the years to make exiftool so powerful.

Obligatory:
platform macOS 10.14.6
exiftool -ver 11.70
Title: Re: Error: '0x0d0d0d0d' atom is too large for rewriting (209 MB)
Post by: AndrewSB on December 14, 2019, 12:55:08 AM
just emailed the asset to philharvey66@gmail.com
Title: Re: Error: '0x0d0d0d0d' atom is too large for rewriting (209 MB)
Post by: Phil Harvey on December 14, 2019, 07:39:53 AM
There is some garbage at the end of this file:

   ab349: 07 07 07 07 07 07 07 02 f9 4b 95 01 b9 da 47 03 [.........K....G.]
   ab359: 44 94 88 9b 69 29 77                            [D...i)w]


ExifTool attempts to parse this, but fails because the atom size is invalid.  Rather than risk further corruption and loss of data, ExifTool refuses to write the file.

What software wrote this file?

- Phil
Title: Re: Error: '0x0d0d0d0d' atom is too large for rewriting (209 MB)
Post by: AndrewSB on December 14, 2019, 03:10:19 PM
what tool did you use to figure that out?

this set of assets are from snapchat's iOS app circa 2014, saved to an iphone, uploaded to icloud, exported from macOS photos, then uploaded to amazon photos and then downloaded. so there are a couple places the garbage could have shown up. could have been from the initial snapchat export, or bad flags when downloading from amazon. what do you think?

also, with this corrupted data at the end, what's my best course of action to rewrite the date time? can I clean up the files somehow before attempting to write to the tags?
Title: Re: Error: '0x0d0d0d0d' atom is too large for rewriting (209 MB)
Post by: StarGeek on December 14, 2019, 03:24:46 PM
You might try this FFMpeg (https://www.ffmpeg.org/download.html) command
ffmpeg -i input.mp4 -c copy -map_metadata 0 output.mp4

That should copy all streams and metadata from the Input.mp4 and create a new Output.mp4 file without doing any re-encoding.  Though I'd double check things afterword to be sure.  I've used that to fix a few problem videos, as well as lossless convert from mkv to mp4.
Title: Re: Error: '0x0d0d0d0d' atom is too large for rewriting (209 MB)
Post by: Phil Harvey on December 14, 2019, 05:11:59 PM
I used exiftool -v3 to look at the file.  I could perhaps do some diagnostics to determine the nature of the bad atom, and provide an option to ignore the problem and rewrite the file anyway in cases like this because I don't think the garbage contains anything useful.  Let me think about this.

StarGeek's suggestion sounds like a reasonable thing to do in the mean time.

- Phil
Title: Re: Error: '0x0d0d0d0d' atom is too large for rewriting (209 MB)
Post by: Phil Harvey on December 17, 2019, 10:32:39 AM
I've just released ExifTool 11.80.  This version should allow you to write MP4 videos which have a bit of garbage at the end, using the -m option.

- Phil
Title: Re: Error: '0x0d0d0d0d' atom is too large for rewriting (209 MB)
Post by: AndrewSB on December 20, 2019, 03:08:19 AM
wow, that was super fast. I was just about to write the subroutine to trap on 'Truncated' in metadata and pass the file through ffmpeg. this is way easier.

thanks Phil!