[Bug] Writing GPSPosition to .mov video corrupts file

Started by tipa, January 28, 2025, 06:28:24 PM

Previous topic - Next topic

tipa

When trying to write location information to a certain .mov video, it corrupts the file and it is no longer playable on either Windows or macOS.
Below the required information as requested here

1) System type (Windows XP, Linux, Mac, etc)
Windows 11 26100.2894 & macOS 15.3
Powershell on Windows

2) The ExifTool version you are using (the output of the "exiftool -ver" command).
13.16

3) The specific command line you are using (or a sample script if having problems with the API).
.\exiftool.exe -GPSPosition="0.0, 0.0" .\example.mov
4) The console output from the command.
1 image files updated
5) It is often useful to attach a sample image which exhibits the problem
Example video file

StarGeek

Strange. Exiftool reports this
C:\>exiftool -g1 -a -s -warning -validate  Y:\!temp\x\y\example.mov
---- ExifTool ----
Warning                         : Duplicate tag 'wide' at MOV
Validate                        : 1 Warning

But this ffmpeg command which is supposed to check for problem files reports nothing
C:\> ffmpeg.exe -v error -i  Y:\!temp\x\y\example.mov -f null -

C:\>
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

The problem is that the first 'wide' atom in this movie has an invalid size.  According to the QuickTime specification:

QuoteThe 'wide' atom is exactly 8 bytes in size, and consists solely of its size and type fields. It contains no other data.

but the 'wide' atom in this movie is 12 bytes, and ExifTool isn't handling this properly.  I'll patch ExifTool 13.17 to check the size of 'wide' atoms when writing, and handle invalid sizes by issuing a warning and skipping the extra bytes.

Thanks for this report.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

tipa

Thank you so much for the quick response - happy to hear that it's getting fixed in the next update!

Phil Harvey

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).