Comments (3)
Without a file to look into it's not really possible to say much about this. mutagen fails reading an ogg page header inside the file, so it looks like there is at least some corrupted data structure inside the file.
from mutagen.
Without a file to look into it's not really possible to say much about this. mutagen fails reading an ogg page header inside the file, so it looks like there is at least some corrupted data structure inside the file.
I have the same issue and have a file I can share. How can I share you the file privately?
from mutagen.
Ran into the same issue.
As a quick workaround you can disable metadata padding during save:
mutagen_file.save(padding=lambda info: 0)
Ref.: https://mutagen.readthedocs.io/en/latest/user/padding.html
Attached below is a test file and a minimal example to reproduce the issue
Sinewave_Sweep.zip
import mutagen
file_path = "Sinewave_Sweep.ogg"
mutagen_handle = mutagen.File(file_path)
mutagen_handle["artist"] = u'AAAAAAAAAAAAAAAABBBBBBBBBBBBBBBB'
mutagen_handle["title"] = u'CCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDD'
mutagen_handle["album"] = u'EEEEEEEEEEEEEEEEFFFFFFFFFFFFFFFF'
mutagen_handle["comment"] = u'GGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHH'
mutagen_handle.save()
From my example
Header at offset 2899534
b'OggS\x00\x04\xac\xaak\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa6\x02\x00\x00\x87\xb8\x86\xa7\x10'
oggs b'OggS', version 0, type flags 4, position 7056044, serial 0, sequence 678, crc -1484343161, segments 16
Header at offset 2902121
b'\x00\x00
' -> throws in ogg.py line 91 trying to struct.unpack("<4sBBqIIiB", ..) these bytes.
It always throws at the last Ogg page, trying to interpret the last couple null bytes as a header.
The file still gets saved and once ran, the same ogg file will no longer cause the issue.
However, the offsets also wildly change. On the file that errored previously the last two segments are now
Header at offset 27
b'OggS\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00#SN\xcb\x01'
oggs b'OggS', version 0, type flags 2, position 0, serial 0, sequence 0, crc -884059357, segments 1
Header at offset 85
b'OggS\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\xe6\xe6(\x8e\x11'
oggs b'OggS', version 0, type flags 0, position 0, serial 0, sequence 1, crc -1909922074, segments 17
The same error will return once if you massively increase the size of the metadata (say * 100 for each tag).
(also if the metadata is being reduced a lot)
Maybe there's something in the file messing up the padding calculation when resizing the metadata section.
Couldn't tell what about my file is corrupt though. I hope someone more familiar with the format can spot the problem :)
from mutagen.
Related Issues (20)
- FLAC objects that compare equal do not have the same hash value
- mid3v2 not working with .opus files. HOT 4
- Unable to add artwork to `.ogg` [vorbis] file HOT 9
- Add support for Audiobooks (.m4b) tags to EasyMP4
- Help with implementing ID3v3.2 spec in dart
- Name of tag is cut off when displaying (.m4a file) HOT 1
- album metadata is not being written to when using EasyID3 HOT 4
- ffmpeg + ogg vorbis: header remain warning HOT 1
- Duration not displayed for some MPEG-4 audio files.
- Writing new ID3 tags to .aiff files HOT 5
- Can I sort by track number? HOT 1
- IOError (not enough bytes) in read_full() on WAV file with extended ID3 header HOT 4
- EasyID3 is not used for wav files
- mid3v2 produces file that mutagen can't read again HOT 1
- AcoustID Fingerprint HOT 2
- mutagen - 1.47.0 - Error with reading FLAC tags and values HOT 7
- Bad chapter timestamps for Mp4 files HOT 2
- Please use built-in enums HOT 1
- Errors with opus files previously tagged with picard/mutagen HOT 5
- Writing Library Tag HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mutagen.