MP4v2 deletes all audio content when saving M4A files
(Original issue reported for Kid3)
MP4v2 Version: the one used as a plugin in Kid3 3.9.3 (probably MP4v2 v2.1.0 or v2.1.1) This means that the issue might already be fixed in the latest version.
When I edit the tags of an MP4/M4A file that I downloaded from YouTube using kid3 and save them, all audio content gets stripped away. According to Urs Fleisch’s comment, it must be an issue with libmp4v2metadata.dylib.
Steps to reproduce in Kid3
- Open an MP4/M4A audio file
- Make any changes in the Tag 2: MP4 section
- Press the Save button
Observed result
The file doesn't get corrupted, but the audio length becomes zero-duration and the file size shrinks down to a few bytes to kilobytes, i. e. it will only consist of the tags.
Expected result
MP4 tags are written and the audio is untouched.
Software/OS Versions
- macOS Big Sur 11.6
- Kid3 3.9.3
- MP4v2 unknown version, probably 2.1.0 or 2.1.1
Additional information
With Kid3, I can avoid the problem by using TagLib instead of MP4v2. This raises the question: What is TagLib doing differently where MP4v2 fails?
Thank you for reporting this!
I can reproduce and confirm the issue. It happens with DASH files which are not really supported by MP4v2 yet. Nevertheless, opening such a file, adding tags and storing it should not damage the remaining data.
I'll investigate and report back.
It seems to only happen with some DASH files; for example, this one:
https://github.com/enzo1982/mp4v2/assets/9383930/e09d6cdd-ae02-443a-b99b-0ec6db97ad86
(Had to change the extension from .m4a to .mp4 so GitHub accepts it.)
Hmm … Did anyone read my comment from 3 days ago?