enzo1982 / mp4v2

Reviving the MP4v2 project...
https://mp4v2.org
Other
139 stars 50 forks source link

MP4v2 deletes all audio content when saving M4A files #45

Open Openstreetmapler opened 1 year ago

Openstreetmapler commented 1 year ago

(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

  1. Open an MP4/M4A audio file
  2. Make any changes in the Tag 2: MP4 section
  3. 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

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?

enzo1982 commented 1 year ago

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.

Openstreetmapler commented 1 year ago

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

Openstreetmapler commented 1 year ago

Hmm … Did anyone read my comment from 3 days ago?