-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
Option to avoid parsing entire file? #2135
Comments
Update:
|
parseBlob()
?
Does music-metadata v9.0.0 solve you issue? The implementation of reading from Blobs have been changed from buffering to streaming. |
I'm not sure yet, music-metadata 9.0.0 gives me this error when trying to parse mkv and webm files: Also, do I still need a I'm testing with the following code:
Thanks. |
@Borewit Unless I'm missing something, it looks like parseWebStream is not being exported and thus cannot be used: https://github.com/Borewit/music-metadata/blob/v9.0.0/lib/index.ts#L11. Furthermore, on use of this code: const response = await fetch(`https://my/mp3/file`);
const metadata = await parseWebStream(response.body!, response.headers.get('content-type')!, {
skipPostHeaders: true,
includeChapters: true,
skipCovers: true
}); I get this error:
I wish I knew more about it or else I would have debugged further! Leaving this here instead of on a new issue since I think fixing this would solve "avoid parsing entire file" |
Moved #2135 (comment) to issue #2143 |
It works fine for flac and mp3, no more Buffer-related errors. I'm still getting errors for webm and mkv, though. using
using
|
Parse 'parseBlob()' is calling Lines 23 to 29 in d6c2755
Do you experience the same issues here?: https://audio-tag-analyzer.netlify.app/ |
Yes, same error. I tried with a few video formats (webm, mkv, mp4).. Fileinfo of one of them:
|
I managed to get an end-of-stream exception as well, parsing an MP4 file. Issue may be caused by https://github.com/Borewit/peek-readable/blob/master/lib/WebStreamReader.ts Not something I can resolve quickly. |
No problem, thanks for investigating this. In the meantime, I'll keep testing it with more audio files. I love the fact that my bundle size has decreased around 100 kB with the new music-metadata, compared to the latest music-metadata-browser. Awesome job! |
I did some testing with music-metadata v9.0.3 and this is what I got:
It still reads the entire file, even with I'm not sure if this can be avoided at all, since I don't think you can skip to a random position in the stream (without reading all the data up to that point sequentially). |
Hello!
I'm having some issues when trying to retrieve the metadata of a large (15GB) video file with
parseBlob()
- disk usage skyrockets and it takes about 1 minute and 20 seconds to resolve with the metadata, so it looks like the it's parsing the entire file.Sometimes the browser just crash or I get an out of memory error (having the dev tools open seems to make things worse / slower).
I tried using
skipPostHeaders: true
andduration: false
, but it seemsparseBlob()
doesn't take an options object.I'd appreciate any advice.
Kind regards.
The text was updated successfully, but these errors were encountered: