taglib/pytaglib cannot read files > 2GB
Kudos on the python implementation, and yes I know I'm tagging movies , not songs. Am I doing something incorrect or does the binary/library just not support large files (> 2GB)? This is on Windows 10.
I followed instructions to build taglib from v1.11.1 and pip installed pytaglib 1.4.5
Traceback (most recent call last):
File "tag_files.py", line 63, in <module>
movie = taglib.File(ROOT_PATH + '\\' + filename)
File "src/taglib.pyx", line 82, in taglib.File.__cinit__
OSError: Could not read file C:\Video\somemovie.mp4
I've worked around the error in my script by avoiding these files (> 2GB), but would love to eventually tag those files as well. Ive tagged my entire movie collection (when <2GB) perfectly. THANKS!
A perfectly acceptable answer is no, we (and or the taglib binary) don't support large files currently. :)
Sidenote: Did I hear you needed wheel files from a Windows PC? if its as simple as copying some file off my PC, I'd be glad to contribute. If it's more complex, I'd still be willing to try and help.
C:\Program Files\taglib\taglib-1.11.1\taglib-install>pip install pytaglib
Collecting pytaglib
Using cached https://files.pythonhosted.org/packages/02/3b/b7e5fe31527dffa41dd55c8f36c2fdbbf043c0b3d8707a9f9c45f9c49932/pytaglib-1.4.5.tar.gz
Building wheels for collected packages: pytaglib
Building wheel for pytaglib (setup.py) ... done
Stored in directory: C:\Users\username\AppData\Local\pip\Cache\wheels\ab\f9\7a\9f0d1fc2d29e984687a7c9d1df9d354b65e1d17b2a0b5b55e5
Successfully built pytaglib
Installing collected packages: pytaglib
Successfully installed pytaglib-1.4.5
Please and thank you.
I assume the issue is due to a general restriction of 32-bit programs; see https://mail.kde.org/pipermail/taglib-devel/2015-December/002806.html.
Are you using a 64-bit python istallation on windows?
Sorry for the delay.
Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32
I am using 64-bit python (double-checked in appwiz.cpl aka Add/Remove Programs wizard)
From what I read, this shouldn't be an issue for 64-bit python (because it interprets longs as the correct length for "large files"), correct? or did I read the article incorrectly?
Thanks for the response.
Steven
That's what I understood as well. I'll try to find a large video file and try by myself ASAP.
Is this issue supposed to have been addressed? On Windows 10 x64, I'm running a clean install of
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32
>pip list
Package Version
---------- -------
pip 20.1.1
pytaglib 1.4.6
pywin32 228
setuptools 41.2.0
Yet, attempting to open a file larger than 2 GByte with f=taglib.File('name.mp4') consistently fails like this:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "src\taglib.pyx", line 82, in taglib.File.__cinit__
OSError: Could not read file name.mp4
Meanwhile, opening smaller mp4s created in the otherwise identical manner appears to work.
I also encountered the same problem, it works fine on linux but on win "OSError: Could not read file" appears for large files.
Finally found the time to reproduce this behavior. Indeed, opening a large mp4 file doesn't work on Linux, I tried both CPython 3.11 and PyPy 3.9, both x64.
However, I also couldn't open the file with the native C++ taglib library either (building on Windows with -DBUILD_EXAMPLES=ON will create a tagreader.exe binary that prints the tags of a given file). Hence, I conclude that there is some general problem with TagLib, large files, and Windows. While this is a pity, investigating or fixing such a bug is really beyond the scope of this Python wrapper.