Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TXXX type metadata added to ID3.4 by ffmpeg cannot be parsed #24

Open
ivanpadavan opened this issue Dec 9, 2022 · 0 comments
Open

TXXX type metadata added to ID3.4 by ffmpeg cannot be parsed #24

ivanpadavan opened this issue Dec 9, 2022 · 0 comments

Comments

@ivanpadavan
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Without this little assumption it was impossible to parse metadata of TXXX type made by ffmpeg version 4.4
cat no-metadata.mp3 | ffmpeg -i pipe:0 -vn -acodec mp3 -metadata text="Привет мир!" -f mp3 test.mp3

Here is the diff that solved my problem:

diff --git a/node_modules/id3-parser/lib/parsers/v2parser.js b/node_modules/id3-parser/lib/parsers/v2parser.js
index 3fc9bb3..162ca24 100644
@@ -180,7 +181,7 @@ function parseFrame(bytes, minor, size) {
         // Value < text string according to encoding >
         if (header.id === 'TXXX') {
             variableStart = 11;
-            variableLength = utils_1.getEndpointOfBytes(bytes, encoding, variableStart) - variableStart;
+            variableLength = utils_1.getEndpointOfBytes(bytes, 0, variableStart) - variableStart;
             var value = {
                 description: utils_1.readBytesToString(bytes.slice(variableStart), encoding, variableLength),
                 value: '',

This issue body was partially generated by patch-package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant