Change in mp4 atom handling?

Started by Invindicator, July 27, 2019, 09:54:03 AM

Previous topic - Next topic

Invindicator

Hi Phil,

I normally convert my mov files from my iPhone to mp4 format once on the pc. After using ffmpeg to convert the file, I use exiftool to copy over some of the date data using the following command

exiftool -overwrite_original -ExtractEmbedded -tagsFromFile !inputFile! -createdate -modifydate -trackcreatedate -trackmodifydate -mediacreatedate -mediamodifydate !outputFile!

Previously using this method the mdat atom would remain at the start of the file and the moov atom would be at the end of the file. This way I was still able to add in meta information at the end of the moov atom without adjusting all the other offsets. After not having processed any videos for a month or two but after converting one the other week I realised this was no longer the case

I converted a video with ffmpeg as per normal and confirmed that the atoms remained in the same location as the original.

I then performed the exiftool step with the above line of code and it appears it is exiftool which is placing the moov atom at the start of the file and the mdat atom after it. Reading the update log I looks like you have added a lot in terms of directly writing quicktime tags using exiftool. Because of this change, have you also modified the way exiftool re-writes mp4 files (placing the atoms in this order)?

If this is the case, is there any change a command line switch exists or could be added which tells exiftool to place the moov atom at the start or the end of the file, giving the user a bit more control over this?

Thanks and regards,
Nick

Phil Harvey

ExifTool now uses a much more sophisticated writing algorithm for MP4 files, and always puts mdat at the end.  Before this there were rather severe limitations on the things that ExifTool could write to MP4.  But there is no option to write the moov after mdat.

- 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 ($).

Invindicator

Hmmm okay. Will have to rethink my processes. Thanks Phil