It seems that Taglib-sharp does not support files over 4GB. I want to edit things like title, descriptions, artwork, etc for large HD movie files. I have found a few comments in the code that seem to imply 64bit files are not supported. Anyone know if this is ever going to be supported? I'm also open to other suggestions in terms of alternative libraries.
Asked
Active
Viewed 1,104 times
4
-
Do you have evidence of this issue? When looking at the main file handling code here: https://github.com/mono/taglib-sharp/blob/master/src/TagLib/File.cs it seems to handle 64-bit sized files (using 'long' everywhere its about size and length) – Simon Mourier Nov 04 '14 at 07:14
-
Yes, of course, the problem is that in a 64bit file the Atom Size / offset is different so when the code tries to read the "MVHD" box (the first box it looks for when opening the file) it does not get the correct bytes and fails saying its an invalid MPEG4. Yes, I'm 100% sure it is a valid mpeg4 using other software to read and play the file work correctly. – Matthew M. Osborn Nov 04 '14 at 17:47
-
1Ah ok you mean the mvhd atom *size* is 64-bit. Do you have such a an MP4 sample file we can get somewhere on the web? – Simon Mourier Nov 05 '14 at 06:54
-
Sadly I do not have one and couldn't find one but if you have a large file > 4GB just run it through handbrake with large file support turned on. – Matthew M. Osborn Nov 05 '14 at 18:11
-
1I wrote that code back in 2007 when I couldn't even imagine a 4GB file. I think I was even just targeting audio at the time. :) Looks like there's probably some data lost in conversion somewhere. Just skimming I see that [`Box.Size`](https://github.com/mono/taglib-sharp/blob/a5f6949a53d09ce63ee7495580d6802921a21f14/src/TagLib/Mpeg4/Box.cs#L126) converts `BoxHeader.TotalBoxSize` from a long to an int. That's probably at least part of the problem. – Brian Nickel Nov 05 '14 at 20:24
1 Answers
2
Okay so here is the problem. What happens in that by default 64bit MPEG4 have their moov
box placed after the mdat
box. In taglib-sharp only the first 32 bytes of the file are read which is enough if the moov
box comes first. To fix this you can use mp4box.exe to switch positions of the box or you can tick the "optimize for web" box in handbrake which will place the moov
box first.

Matthew M. Osborn
- 4,673
- 4
- 25
- 26