Git Product home page Git Product logo

mediainfo.js's People

Contributors

buzz avatar corbenf-shuttlerock avatar craftycodie avatar davidlyons avatar elkindev avatar iwestlin avatar matthewleon avatar tannerrogalsky avatar tayles avatar tomwilsonmerkle avatar trendy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mediainfo.js's Issues

Files >2GB don't work due to 32bit truncation

Open_Buffer_Continue_GoTo_Get() returns a 64bit seek position, but the binding to JS makes a long (32bit) out of it. Thus seeking in large files doesn't work. It gets obviuos when comparing the offsets from JS and native code:

native:
lseek(4, 2131533686, SEEK_SET)
lseek(4, 4261375884, SEEK_SET)

JS:
offset 2130943862 state 5 seekto -33591412

4261375884 is -33591412 as int32_t ;)

BTW: I tried to fix that on my own in the binding, but emscripten seems to have long term troubles under Ubuntu. Can you give an example of a "proven" build system? Thanks...

Npm Module

The ability to use this as an npm module would be a nice addition.

Image Size Error

I ran the media info script on a PNG of size 1000X684. The resulting object contains:

  "Width": [
    "1000",
    "1 000 pixels"
  ],
  "Height": [
    "684",
    "684 pixels"
  ],

The width is "1 000 pixels". It has a space where a comma should be. Should this be a human-readable field using commas? It would be useful to have a property with just the number (1000), a property with the units (pixels) and a property that is human-readable (1,000 pixels)

CompileError using webpack: Missing mediainfo.wasm

Hey there!

It seems like there is a bug. Here is what I'm getting when playing around with the library using create react app template:

Uncaught (in promise) RuntimeError: abort(CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0). Build with -s ASSERTIONS=1 for more info.
    at abort (http://localhost:3000/static/js/1.chunk.js:3145:17)
    at http://localhost:3000/static/js/1.chunk.js:3239:15

That's how the lib is being imported:

import MediaInfo from 'mediainfo.js'

Any suggestions? Thanks!

large files and wasm build

I am compiling 19.07 MediaInfoLib to wasm and using it. It works for small files, files smaller than my "chunk size". But if I have to iterate through chunks I get memory faults.

I'd like to try to use the functions I see in the gh-pages branch

mi.open_buffer_continue_goto_get_upper()
and
mi.open_buffer_continue_goto_get_lower()

to see if this fixes the issue, as I had similar issues using the asm output that were solved by using these functions. but I cannot find them in the c++ source.

I am referring specifically to this commit:

87dccc3

Do they exist in c++, and if not, do you have any guidance for recreating them or for using the lib compiled to wasm?

thank you.

Soren Roth

No callback in case of error

If MediaInfo cannot be initialized (e.g. wasm library not found or unrechable) no callback is called. The MediaInfoFactory should catch errors and reject the promise.

Certain files don't read properly

Hi Buzz, thanks for putting this together! Everything works great for short clips (15 seconds, 3-5MB) but I've tried a couple longer ones (2 min, ~11MB) and they do not grab the data. I tried on your demo page as well and it's having the same issue. Any idea what might be causing this?

As a note, the desktop app for MediaInfo pulls the data correctly for both files.

The screenshot below shows the longer clip on top and shorter one below it.
image

Allow user to change MediaInfoModule.wasm location

Hello,

In this closed issue I had some difficulties using this library in Angular. So I asked for help in Stackoverflow in this question, and it worked perfectly.

Then I created a working example for Angular users, so others could have an easier path than mine. I also created a pull request with the example. It's here

I would like to say that I made this effort because I thought, given it's great usefulness, this project was worth the effort. Thanks for your work in it.

Finally I also want to give you an idea to create an option that allows the user to change MediaInfoModule.wasm location from root to some other arbitrary location. For most projects, root is not ideal for any library, not library part.

Hope it's useful for you and other users.

Async and sync fetching of the wasm failed

I'm trying to use Mediainfo.js to get some video info on the frontend of an Angular 8 project. But I'm getting the errors below:

GET https://192.168.25.177:4200/MediaInfoModule.wasm 404 (Not Found)
wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': HTTP status code is not ok
falling back to ArrayBuffer instantiation
GET https://192.168.25.177:4200/MediaInfoModule.wasm 404 (Not Found)
bothg async and sync fetching of the wasm failed
failed to asynchronously prepare wasm: RuntimeError: abort(both async and sync fetching of the wasm failed). Build with -s ASSERTIONS=1 for more info.
RuntimeError: abort(both async and sync fetching of the wasm failed). Build with -s ASSERTIONS=1 for more info.
ERROR Error: Uncaught (in promise): RuntimeError: abort(RuntimeError: abort(both async and sync fetching of the wasm failed). Build with -s ASSERTIONS=1 for more info.). Build with -s ASSERTIONS=1 for more info.
RuntimeError: abort(RuntimeError: abort(both async and sync fetching of the wasm failed). Build with -s ASSERTIONS=1 for more info.). Build with -s ASSERTIONS=1 for more info.
at abort (vendor.js:131481)
at vendor.js:131481
at ZoneDelegate.invoke (polyfills.js:3709)
at Object.onInvoke (vendor.js:82905)
at ZoneDelegate.invoke (polyfills.js:3708)
at Zone.run (polyfills.js:3474)
at polyfills.js:4205
at ZoneDelegate.invokeTask (polyfills.js:3741)
at Object.onInvokeTask (vendor.js:82886)
at ZoneDelegate.invokeTask (polyfills.js:3740)
at resolvePromise (polyfills.js:4147)
at polyfills.js:4212
at ZoneDelegate.invokeTask (polyfills.js:3741)
at Object.onInvokeTask (vendor.js:82886)
at ZoneDelegate.invokeTask (polyfills.js:3740)
at Zone.runTask (polyfills.js:3518)
at drainMicroTaskQueue (polyfills.js:3909)

I tried to install wasm package, but it returned lots of V8 related errors. And in it's npm page says it's Node only (https://www.npmjs.com/package/wasm)

Yet Mediainfo's page claims "All analyzing is done in the browser"
How can I use Mediainfo in the browser without it ? Is there any way I can install wasm in the frontend ?
Any other info on this error that can help me ?

Duration does not have milliseconds information for videos over 1 minute.

Hello,

The library does not return the milliseconds information for videos over 1 minute.

examples:
Actual -> Reported
1.911s -> 1s 911ms
61.911s -> 1mn 1s // miliseconds got truncated. expected was 1mn 1s 911ms

Is there any setting to obtain the complete duration including milliseconds.
Thanks.

medainfo.js + React App

I'm trying to add this library to my create-react-app project, after declaring the libraries using script tag in index.html (in public directory) :

<script src="%PUBLIC_URL%/js/mediainfo.js"></script> <script src="%PUBLIC_URL%/js/mediainfo.js.mem"></script> <script src="%PUBLIC_URL%/js/xml2json.js"></script>

still window.mi or window.miLib is undefined. any idea for solving the issue ?

Speed difference MediaInfo and mediainfo.js

Hi,

I've been doing some testing with regards to analysing media files, specifically larger ones and did compare times in the MacOS CLI version and using mediainfo.js in the browser on the same machine (Safari on MacOS 10.15.7, but a colleague also tested on Chrome).

It seems to me that execution times for mediainfo.js are significantly longer, i.e., a ~763MB Prores file takes ~3.5s to process in mediainfo.js vs. CLI version which takes 0.036s.

Maybe I am not understanding something, but what would be the reason of this and is there a way to speed this up in mediainfo.js.

We are basically trying to build a webtool to read meta-data for multiple files in a browser and our use case might not be viable if we not manage to improve the speed it takes to analyse files for meta-data.

Thank you for any thoughts or help in advance.

Scanning through subfolders

Hi, and thanks for your work!

I would like to be able to fetch metadata from multiple files including subfolders. I tried to modify the multiple-files browser example and use webkitRelativePath, but I didn't manage to make it work. Any chance someone could implement it?

Implemantation with dropzone

Hello, I would like to implement mediainfo.js in the following code in dropzone when activating success:

var varFunc_Dropzone = function () {

	var dzone_upload_show_poster = function () {

		$('#dzone_poster').dropzone({

			url: "../../assets/system/sys_upload_manager.php",
			method: "POST",
			paramName: "file",
			acceptedFiles: "image/*",
			maxFiles: 1,
			maxFilesize: 1, // MB
			uploadMultiple: false,
			// clickable: '#fileinput',
			// createImageThumbnails: true,
			thumbnailWidth: null,
			thumbnailHeight: null,
			addRemoveLinks: true,
			timeout: 180000,
			dictRemoveFileConfirmation: "Sicuro?",
			dictFileTooBig: "File grande ({{filesize}}mb). Massimo consentito {{maxFilesize}}mb",
			dictInvalidFileType: "Tipo di file non valido",
			dictCancelUpload: "Cancella",
			dictRemoveFile: "Rimuovi",
			dictMaxFilesExceeded: "Sono consentiti un massimo di {{maxFiles}} file",
			dictDefaultMessage: "Trascina il file qui per effettuare Upload",

			success: function(file, done) {

// implement the trigger here
// get_file_info(MediaInfo({ format: 'text' }, {file}));
// var xFile = MediaInfo({ format: 'text' }, (mediainfo) => {file});
// fileinput.addEventListener('change', () => onChangeFile(mediainfo));
// var xFile = MediaInfo({ format: 'text' }, (mediainfo) => onChangeFile(file));

			}

		});


	}

	return {
		init: function() {

			dzone_upload_show_poster();
		}
	};
}();

KTUtil.ready(function() { varFunc_Dropzone.init(); });

I try with:
const onChangeFile = (mediainfo) => {
and
function get_file_info(mediainfo, file) {

Thank you for your willingness!!!

Dependencies do not compile with Emscripten 1.39.16

Having trouble compiling the dependencies using NPM.

npm run build:deps

> [email protected] build:deps /home/ubuntu/projects/mediainfo.js
> bash scripts/build-deps.sh

+ LIBMEDIAINFO_VERSION=19.09
+ LIBZEN_VERSION=0.4.37
+ ZLIB_VERSION=1.2.11
+ mkdir -p build/vendor
+ cd build/vendor
+ wget https://mediaarea.net/download/source/libmediainfo/19.09/libmediainfo_19.09.tar.bz2 -q -O -
+ tar -xj
+ wget https://mediaarea.net/download/source/libzen/0.4.37/libzen_0.4.37.tar.bz2 -q -O -
+ tar -xj
+ mkdir -p Shared/Source
+ tar -xz -C Shared/Source
+ wget http://zlib.net/zlib-1.2.11.tar.gz -q -O -
+ mv Shared/Source/zlib-1.2.11 Shared/Source/zlib
+ cd Shared/Source/zlib
+ emconfigure ./configure
cache:INFO: generating system asset: is_vanilla.txt... (this will be cached in "/home/ubuntu/projects/emsdk/upstream/emscripten/cache/is_vanilla.txt" for subsequent builds)
cache:INFO:  - ok
configure: ./configure
Checking for shared library support...
Building shared library libz.so.1.2.11 with /home/ubuntu/projects/emsdk/upstream/emscripten/emcc.
Checking for size_t... Yes.
Checking for off64_t... Yes.
Checking for fseeko... Yes.
Checking for strerror... Yes.
Checking for unistd.h... Yes.
Checking for stdarg.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf().
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for attribute(visibility) support... Yes.
+ emmake make
make: make
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -I. -c -o example.o test/example.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o adler32.o adler32.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o crc32.o crc32.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o deflate.o deflate.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o infback.o infback.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o inffast.o inffast.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o inflate.o inflate.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o inftrees.o inftrees.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o trees.o trees.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o zutil.o zutil.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o compress.o compress.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o uncompr.o uncompr.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o gzclose.o gzclose.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o gzlib.o gzlib.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o gzread.o gzread.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o gzwrite.o gzwrite.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emar rc libz.a adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o 
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o example example.o -L. libz.a
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -I. -c -o minigzip.o test/minigzip.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o minigzip minigzip.o -L. libz.a
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/adler32.o adler32.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/crc32.o crc32.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/deflate.o deflate.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/infback.o infback.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/inffast.o inffast.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/inflate.o inflate.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/inftrees.o inftrees.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/trees.o trees.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/zutil.o zutil.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/compress.o compress.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/uncompr.o uncompr.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/gzclose.o gzclose.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/gzlib.o gzlib.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/gzread.o gzread.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/gzwrite.o gzwrite.c
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o libz.so.1.2.11 adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo  -lc 
emcc: warning: Assuming object file output in the absence of `-c`, based on output filename. Add with `-c` or `-r` to avoid this warning [-Wemcc]
rm -f libz.so libz.so.1
ln -s libz.so.1.2.11 libz.so
ln -s libz.so.1.2.11 libz.so.1
/home/ubuntu/projects/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o examplesh example.o -L. libz.so.1.2.11
emcc: warning: ignoring dynamic library libz.so.1.2.11 because not compiling to JS or HTML, remember to link it when compiling to JS or HTML at the end [-Wemcc]
error: undefined symbol: compress (referenced by top-level compiled C/C++ code)
warning: Link with `-s LLD_REPORT_UNDEFINED` to get more information on undefined symbols
warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
warning: _compress may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: deflate (referenced by top-level compiled C/C++ code)
warning: _deflate may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: deflateEnd (referenced by top-level compiled C/C++ code)
warning: _deflateEnd may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: deflateInit_ (referenced by top-level compiled C/C++ code)
warning: _deflateInit_ may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: deflateParams (referenced by top-level compiled C/C++ code)
warning: _deflateParams may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: deflateSetDictionary (referenced by top-level compiled C/C++ code)
warning: _deflateSetDictionary may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: gzclose (referenced by top-level compiled C/C++ code)
warning: _gzclose may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: gzerror (referenced by top-level compiled C/C++ code)
warning: _gzerror may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: gzgetc (referenced by top-level compiled C/C++ code)
warning: _gzgetc may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: gzgets (referenced by top-level compiled C/C++ code)
warning: _gzgets may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: gzopen (referenced by top-level compiled C/C++ code)
warning: _gzopen may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: gzprintf (referenced by top-level compiled C/C++ code)
warning: _gzprintf may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: gzputc (referenced by top-level compiled C/C++ code)
warning: _gzputc may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: gzputs (referenced by top-level compiled C/C++ code)
warning: _gzputs may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: gzread (referenced by top-level compiled C/C++ code)
warning: _gzread may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: gzseek (referenced by top-level compiled C/C++ code)
warning: _gzseek may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: gztell (referenced by top-level compiled C/C++ code)
warning: _gztell may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: gzungetc (referenced by top-level compiled C/C++ code)
warning: _gzungetc may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: inflate (referenced by top-level compiled C/C++ code)
warning: _inflate may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: inflateEnd (referenced by top-level compiled C/C++ code)
warning: _inflateEnd may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: inflateInit_ (referenced by top-level compiled C/C++ code)
warning: _inflateInit_ may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: inflateSetDictionary (referenced by top-level compiled C/C++ code)
warning: _inflateSetDictionary may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: inflateSync (referenced by top-level compiled C/C++ code)
warning: _inflateSync may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: uncompress (referenced by top-level compiled C/C++ code)
warning: _uncompress may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: zlibCompileFlags (referenced by top-level compiled C/C++ code)
warning: _zlibCompileFlags may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: zlibVersion (referenced by top-level compiled C/C++ code)
warning: _zlibVersion may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
Error: Aborting compilation due to previous errors
emcc: error: '/home/ubuntu/projects/emsdk/node/12.9.1_64bit/bin/node /home/ubuntu/projects/emsdk/upstream/emscripten/src/compiler.js /tmp/tmpn16g4v51.txt' failed (1)
Makefile:295: recipe for target 'examplesh' failed
make: *** [examplesh] Error 1
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build:deps: `bash scripts/build-deps.sh`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the [email protected] build:deps script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ubuntu/.npm/_logs/2020-05-22T12_15_17_576Z-debug.log

Something that seemed suspicious during the emsdk installation:

./emsdk install latest
Installing SDK 'sdk-releases-upstream-ae5001fac3849895a873e422a2a80afc90f3b798-64bit'..
Installing tool 'node-12.9.1-64bit'..
Downloading: /home/ubuntu/projects/emsdk/zips/node-v12.9.1-linux-x64.tar.xz from https://storage.googleapis.com/webassembly/emscripten-releases-builds/deps/node-v12.9.1-linux-x64.tar.xz, 13918928 Bytes
Unpacking '/home/ubuntu/projects/emsdk/zips/node-v12.9.1-linux-x64.tar.xz' to '/home/ubuntu/projects/emsdk/node/12.9.1_64bit'
Done installing tool 'node-12.9.1-64bit'.
Installing tool 'releases-upstream-ae5001fac3849895a873e422a2a80afc90f3b798-64bit'..
Downloading: /home/ubuntu/projects/emsdk/zips/ae5001fac3849895a873e422a2a80afc90f3b798-wasm-binaries.tbz2 from https://storage.googleapis.com/webassembly/emscripten-releases-builds/linux/ae5001fac3849895a873e422a2a80afc90f3b798/wasm-binaries.tbz2, 181107331 Bytes
Unpacking '/home/ubuntu/projects/emsdk/zips/ae5001fac3849895a873e422a2a80afc90f3b798-wasm-binaries.tbz2' to '/home/ubuntu/projects/emsdk/upstream'
tar: lib/libLLVM.so: Cannot utime: No such file or directory
tar: lib/libLLVM.so: Cannot change ownership to uid 1010, gid 1011: No such file or directory
tar: lib/libLLVM-11.0.0git.so: Cannot utime: No such file or directory
tar: lib/libLLVM-11.0.0git.so: Cannot change ownership to uid 1010, gid 1011: No such file or directory
tar: lib/libRemarks.so: Cannot utime: No such file or directory
tar: lib/libRemarks.so: Cannot change ownership to uid 1010, gid 1011: No such file or directory
tar: lib/libclang.so: Cannot utime: No such file or directory
tar: lib/libclang.so: Cannot change ownership to uid 1010, gid 1011: No such file or directory
tar: bin/clang++: Cannot utime: No such file or directory
tar: bin/clang++: Cannot change ownership to uid 1010, gid 1011: No such file or directory
tar: bin/wasm32-clang: Cannot utime: No such file or directory
tar: bin/wasm32-clang: Cannot change ownership to uid 1010, gid 1011: No such file or directory
tar: bin/wasm32-clang++: Cannot utime: No such file or directory
tar: bin/wasm32-clang++: Cannot change ownership to uid 1010, gid 1011: No such file or directory
tar: bin/wasm32-wasi-clang: Cannot utime: No such file or directory
tar: bin/wasm32-wasi-clang: Cannot change ownership to uid 1010, gid 1011: No such file or directory
tar: bin/wasm32-wasi-clang++: Cannot utime: No such file or directory
tar: bin/wasm32-wasi-clang++: Cannot change ownership to uid 1010, gid 1011: No such file or directory
tar: fastcomp/lib/libLLVM.so: Cannot utime: No such file or directory
tar: fastcomp/lib/libLLVM.so: Cannot change ownership to uid 1010, gid 1011: No such file or directory
tar: fastcomp/lib/libLLVM-6.0.1.so: Cannot utime: No such file or directory
tar: fastcomp/lib/libLLVM-6.0.1.so: Cannot change ownership to uid 1010, gid 1011: No such file or directory
tar: fastcomp/lib/libclang.so: Cannot utime: No such file or directory
tar: fastcomp/lib/libclang.so: Cannot change ownership to uid 1010, gid 1011: No such file or directory
tar: fastcomp/lib/libLTO.so: Cannot utime: No such file or directory
tar: fastcomp/lib/libLTO.so: Cannot change ownership to uid 1010, gid 1011: No such file or directory
tar: fastcomp/bin/clang++: Cannot utime: No such file or directory
tar: fastcomp/bin/clang++: Cannot change ownership to uid 1010, gid 1011: No such file or directory
tar: fastcomp/bin/clang: Cannot utime: No such file or directory
tar: fastcomp/bin/clang: Cannot change ownership to uid 1010, gid 1011: No such file or directory
tar: emscripten/tools/emdump: Cannot utime: No such file or directory
tar: emscripten/tools/emdump: Cannot change ownership to uid 1010, gid 1011: No such file or directory
tar: Exiting with failure status due to previous errors
['tar', '-xf', '/home/ubuntu/projects/emsdk/zips/ae5001fac3849895a873e422a2a80afc90f3b798-wasm-binaries.tbz2', '--strip', '1'] failed with error code 2!
Done installing tool 'releases-upstream-ae5001fac3849895a873e422a2a80afc90f3b798-64bit'.
Running post-install step: npm ci ...
Done running: npm ci
Done installing SDK 'sdk-releases-upstream-ae5001fac3849895a873e422a2a80afc90f3b798-64bit'.
root@haze:/home/ubuntu/projects/emsdk# ./emsdk install latest
Installing SDK 'sdk-releases-upstream-ae5001fac3849895a873e422a2a80afc90f3b798-64bit'..
Skipped installing node-12.9.1-64bit, already installed.
Skipped installing releases-upstream-ae5001fac3849895a873e422a2a80afc90f3b798-64bit, already installed.
Running post-install step: npm ci ...
Done running: npm ci
Done installing SDK 'sdk-releases-upstream-ae5001fac3849895a873e422a2a80afc90f3b798-64bit'.

Oddly, utime is available and in PATH. Any ideas what might be going wrong?

Typescript Support

Great job on the library, thank you. It works great for my app so far. Any chance you planning on having TypeScript support?

Failed to Install Dependencies: ./configure: line 4651: AC_DISABLE_STATIC: command not found

I'm getting this error when installing the dependencies:

[ec2-user@XXXX mediainfo.js]$ ./build-deps.sh
Checking for shared library support...
Building shared library libz.so.1.2.11 with /home/ec2-user/emsdk/upstream/emscripten/emcc.
Checking for size_t... Yes.
Checking for off64_t... Yes.
Checking for fseeko... Yes.
Checking for strerror... Yes.
Checking for unistd.h... Yes.
Checking for stdarg.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf().
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for attribute(visibility) support... Yes.
make: ['make']
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -I. -c -o example.o test/example.c
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o adler32.o adler32.c
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o crc32.o crc32.c
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o deflate.o deflate.c
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o infback.o infback.c
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o inffast.o inffast.c
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o inflate.o inflate.c
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o inftrees.o inftrees.c
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o trees.o trees.c
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o zutil.o zutil.c
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o compress.o compress.c
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o uncompr.o uncompr.c
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o gzclose.o gzclose.c
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o gzlib.o gzlib.c
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o gzread.o gzread.c
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -c -o gzwrite.o gzwrite.c
/home/ec2-user/emsdk/upstream/emscripten/emar rc libz.a adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o example example.o -L. libz.a
shared:WARNING: Assuming object file output in the absence of `-c`, based on output filename. Please add with `-c` or `-r` to avoid this warning
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -I. -c -o minigzip.o test/minigzip.c
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o minigzip minigzip.o -L. libz.a
shared:WARNING: Assuming object file output in the absence of `-c`, based on output filename. Please add with `-c` or `-r` to avoid this warning
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/adler32.o adler32.c
shared:WARNING: ignoring -fPIC flag when not building with SIDE_MODULE or MAIN_MODULE
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/crc32.o crc32.c
shared:WARNING: ignoring -fPIC flag when not building with SIDE_MODULE or MAIN_MODULE
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/deflate.o deflate.c
shared:WARNING: ignoring -fPIC flag when not building with SIDE_MODULE or MAIN_MODULE
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/infback.o infback.c
shared:WARNING: ignoring -fPIC flag when not building with SIDE_MODULE or MAIN_MODULE
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/inffast.o inffast.c
shared:WARNING: ignoring -fPIC flag when not building with SIDE_MODULE or MAIN_MODULE
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/inflate.o inflate.c
shared:WARNING: ignoring -fPIC flag when not building with SIDE_MODULE or MAIN_MODULE
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/inftrees.o inftrees.c
shared:WARNING: ignoring -fPIC flag when not building with SIDE_MODULE or MAIN_MODULE
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/trees.o trees.c
shared:WARNING: ignoring -fPIC flag when not building with SIDE_MODULE or MAIN_MODULE
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/zutil.o zutil.c
shared:WARNING: ignoring -fPIC flag when not building with SIDE_MODULE or MAIN_MODULE
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/compress.o compress.c
shared:WARNING: ignoring -fPIC flag when not building with SIDE_MODULE or MAIN_MODULE
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/uncompr.o uncompr.c
shared:WARNING: ignoring -fPIC flag when not building with SIDE_MODULE or MAIN_MODULE
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/gzclose.o gzclose.c
shared:WARNING: ignoring -fPIC flag when not building with SIDE_MODULE or MAIN_MODULE
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/gzlib.o gzlib.c
shared:WARNING: ignoring -fPIC flag when not building with SIDE_MODULE or MAIN_MODULE
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/gzread.o gzread.c
shared:WARNING: ignoring -fPIC flag when not building with SIDE_MODULE or MAIN_MODULE
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/gzwrite.o gzwrite.c
shared:WARNING: ignoring -fPIC flag when not building with SIDE_MODULE or MAIN_MODULE
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o libz.so.1.2.11 adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo  -lc
shared:WARNING: Assuming object file output in the absence of `-c`, based on output filename. Please add with `-c` or `-r` to avoid this warning
shared:WARNING: ignoring -fPIC flag when not building with SIDE_MODULE or MAIN_MODULE
rm -f libz.so libz.so.1
ln -s libz.so.1.2.11 libz.so
ln -s libz.so.1.2.11 libz.so.1
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o examplesh example.o -L. libz.so.1.2.11
shared:WARNING: ignoring dynamic library libz.so.1.2.11 because not compiling to JS or HTML, remember to link it when compiling to JS or HTML at the end
shared:WARNING: Assuming object file output in the absence of `-c`, based on output filename. Please add with `-c` or `-r` to avoid this warning
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o minigzipsh minigzip.o -L. libz.so.1.2.11
shared:WARNING: ignoring dynamic library libz.so.1.2.11 because not compiling to JS or HTML, remember to link it when compiling to JS or HTML at the end
shared:WARNING: Assuming object file output in the absence of `-c`, based on output filename. Please add with `-c` or `-r` to avoid this warning
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -I. -D_FILE_OFFSET_BITS=64 -c -o example64.o test/example.c
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o example64 example64.o -L. libz.a
shared:WARNING: Assuming object file output in the absence of `-c`, based on output filename. Please add with `-c` or `-r` to avoid this warning
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -I. -D_FILE_OFFSET_BITS=64 -c -o minigzip64.o test/minigzip.c
/home/ec2-user/emsdk/upstream/emscripten/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o minigzip64 minigzip64.o -L. libz.a
shared:WARNING: Assuming object file output in the absence of `-c`, based on output filename. Please add with `-c` or `-r` to avoid this warning
./autogen.sh: line 8: libtoolize: command not found
configure.ac:18: installing './config.guess'
configure.ac:18: installing './config.sub'
configure.ac:19: installing './install-sh'
configure.ac:19: installing './missing'
Makefile.am:3: error: Libtool library used but 'LIBTOOL' is undefined
Makefile.am:3:   The usual way to define 'LIBTOOL' is to add 'LT_INIT'
Makefile.am:3:   to 'configure.ac' and run 'aclocal' and 'autoconf' again.
Makefile.am:3:   If 'LT_INIT' is in 'configure.ac', make sure
Makefile.am:3:   its definition is in aclocal's search path.
Makefile.am: installing './depcomp'
configure.ac:27: error: possibly undefined macro: AC_DISABLE_STATIC
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:28: error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL
configure.ac:29: error: possibly undefined macro: AC_PROG_LIBTOOL
autoreconf: /usr/bin/autoconf failed with exit status: 1
checking build system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for le32-unknown-nacl-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for le32-unknown-nacl-gcc... /home/ec2-user/emsdk/upstream/emscripten/emcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /home/ec2-user/emsdk/upstream/emscripten/emcc accepts -g... yes
checking for /home/ec2-user/emsdk/upstream/emscripten/emcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of /home/ec2-user/emsdk/upstream/emscripten/emcc... gcc3
checking whether we are using the GNU C++ compiler... yes
checking whether /home/ec2-user/emsdk/upstream/emscripten/em++ accepts -g... yes
checking dependency style of /home/ec2-user/emsdk/upstream/emscripten/em++... gcc3
checking how to run the C preprocessor... /home/ec2-user/emsdk/upstream/emscripten/emcc -E
./configure: line 4037: AC_DISABLE_STATIC: command not found
./configure: line 4038: AC_LIBTOOL_WIN32_DLL: command not found
./configure: line 4039: AC_PROG_LIBTOOL: command not found
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating libzen-config
config.status: creating libzen.pc
config.status: error: cannot find input file: `Makefile.in'
make: ['make']
make: *** No targets specified and no makefile found.  Stop.
./autogen.sh: line 6: libtoolize: command not found
configure.ac:27: installing './compile'
configure.ac:18: installing './config.guess'
configure.ac:18: installing './config.sub'
configure.ac:19: installing './install-sh'
configure.ac:19: installing './missing'
Makefile.am:3: error: Libtool library used but 'LIBTOOL' is undefined
Makefile.am:3:   The usual way to define 'LIBTOOL' is to add 'LT_INIT'
Makefile.am:3:   to 'configure.ac' and run 'aclocal' and 'autoconf' again.
Makefile.am:3:   If 'LT_INIT' is in 'configure.ac', make sure
Makefile.am:3:   its definition is in aclocal's search path.
Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
configure.ac:29: error: possibly undefined macro: AC_DISABLE_STATIC
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:30: error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL
configure.ac:31: error: possibly undefined macro: AC_PROG_LIBTOOL
autoreconf: /usr/bin/autoconf failed with exit status: 1
checking build system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for le32-unknown-nacl-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for le32-unknown-nacl-gcc... /home/ec2-user/emsdk/upstream/emscripten/emcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /home/ec2-user/emsdk/upstream/emscripten/emcc accepts -g... yes
checking for /home/ec2-user/emsdk/upstream/emscripten/emcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of /home/ec2-user/emsdk/upstream/emscripten/emcc... gcc3
checking whether /home/ec2-user/emsdk/upstream/emscripten/emcc and cc understand -c and -o together... yes
checking whether we are using the GNU C++ compiler... yes
checking whether /home/ec2-user/emsdk/upstream/emscripten/em++ accepts -g... yes
checking dependency style of /home/ec2-user/emsdk/upstream/emscripten/em++... gcc3
./configure: line 4651: AC_DISABLE_STATIC: command not found
./configure: line 4652: AC_LIBTOOL_WIN32_DLL: command not found
./configure: line 4653: AC_PROG_LIBTOOL: command not found
configure: error: libzen configuration is not found
make: ['make']
make: *** No targets specified and no makefile found.  Stop.

[ec2-user@ip-172-30-4-43 mediainfo.js]$ cat /etc/*-release
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
Amazon Linux release 2 (Karoo)

mediainfo with HTTP Range Requests

Hi @buzz , thank you for this awesome library!

I'm trying to retrieve the mediainfo data from an URL by using Range Requests HTTP feature in Node.js.

Here is my code:

const MediaInfo = require('mediainfo.js');
const axios = require('axios');

// main
(async () => {

    const mediainfo = await MediaInfo({ chunkSize: 256*1024, coverData: false, format: 'object' });

    const url = "http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_60fps_stereo_abl.mp4";

    const response = await axios.get(url, {responseType: 'stream'});
    const contentLength = response.headers['content-length'];
    console.log(contentLength);

    const getSize = () => {
        const size = Number(contentLength);
        return size;
    }

    let readChunk = async (chunkSize, offset) => {
        const Range = `bytes=${offset}-${offset + chunkSize}`;
        console.log('reading ' + Range);
        try {
            const res = await axios.get(url, {
                headers: {
                    Range,
                }
            });
            console.log('-> received ' + res.headers['content-length'] + ' bytes');

            return res.data;
        } catch (err) {
            console.log(err);
            throw err;
        }
    };

    const result = await mediainfo.analyzeData(getSize, readChunk);
    console.log(JSON.stringify(result, null, 2));
})();

This is the output I get:

514832018
reading bytes=0-262144
-> received 262145 bytes
reading bytes=424967-687111
-> received 262145 bytes
{
  "media": {
    "@ref": "",
    "track": [
      {
        "@type": "General",
        "Format": "MPEG-4",
        "Format_Profile": "Base Media",
        "CodecID": "isom",
        "CodecID_Compatible": "isom/avc1",
        "FileSize": "514832018",
        "StreamSize": "514832018",
        "extra": {
          "IsTruncated": "Yes"
        }
      }
    ]
  }
}

This data is incomplete, so I guess I'm doing something incorrect. I've noticed that the logged ranges are not contiguous.

Can you spot what I'm missing?
Thanks a lot!

Question about format

Hello, great library, is there a way to change the format to JSON. e.g.

miLib = MediaInfo(function() {
   mi = new miLib.MediaInfo({"Output: "JSON"});
})

I see there is an option to change the output in https://github.com/buzz/mediainfo.js/blob/master/mediainfojs.cpp

MediaInfoJs() {
    mi.Option(__T("Output"), __T("XML"));
    mi.Option(__T("File_IsSeekable"), __T("1"));
  }

but can't quite figure out how to make it work

Thanks

Typescript Typing Error

I'm following the simple example fairly closely except using typescript

import { Ref, WritableComputedRef, ref } from '@vue/composition-api'
import mediaInfo, { MediaInfo, Result } from 'mediainfo.js'

export default function useFileMetadata (file: Ref<File|null>|WritableComputedRef<File|null>) {
  const metadata = ref<Result|null>(null)

  async function handleFile (file: File, mediaInfo: MediaInfo) {
    const getSize = () => file.size

    const readChunk = (chunkSize: number, offset: number) => {
      return new Promise<Uint8Array>((resolve, reject) => {
        const reader = new FileReader()
        reader.onload = (event) => {
          if (!event.target) reject('Target not defined')
          else if (event.target.error) reject(event.target.error)
          else resolve(new Uint8Array(event.target.result as ArrayBuffer))
        }
        reader.readAsArrayBuffer(file.slice(offset, offset + chunkSize))
      })
    }

    try {
      const res = await mediaInfo.analyzeData(getSize, readChunk)
      if (!res) console.error('analyze response was undefined')
      else metadata.value = res
    } catch (err) {
      console.error(err)
    }
  }

  mediaInfo({}, (mi) => {
    if (file.value) handleFile(file.value, mi) // this line gives me an error
  })

  return {
    metadata
  }
}

The commented line give the following error

Argument of type 'import(".../node_modules/mediainfo.js/dist/types").MediaInfo' is not assignable to parameter of type 'import(".../node_modules/mediainfo.js/dist/mediainfo").MediaInfo'.
  Property 'wasmInstance' is missing in type 'import(".../node_modules/mediainfo.js/dist/types").MediaInfo' but required in type 'import(".../node_modules/mediainfo.js/dist/mediainfo").MediaInfo'.ts(2345)
mediainfo.d.ts(6, 22): 'wasmInstance' is declared here.

I haven't dug super deeply into source but I'm sticking fairly close to the example.

Awesome library btw this has helped me a lot. Many thanks 😊

Reduce WASM file-size

Any ideas on how to optimise the file size of the web assembly? Using wasm-opt with the -Oz parameter managed to bring down the WASM from 4.6M to 4.3M. Wonder if stripping symbols or somehow shaking the tree from the rest of the libraries could help reduce file size further.

Hard code file name

Still trying to figure out how this script operates. Im trying to hardcode the file that is to be analyzed.

ive replaced const file = fileinput.files[0] with const file = "D:\videoFiles\sampleVideo.mp4

Then I call the onChangeFile class with a button <button class="btn btn-default" id="getframe" onclick="onChangeFile()">Get Frame Rate</button>

It never produces a result. The output displays "Working…"

Is there a different place that I can hardcode the file name & path?

 const onChangeFile = (filename) => {
            //const file = fileinput.files[0]
            const file = "D:\videoFiles\sampleVideo.mp4";

            if (file) {

                output.value = 'Working…'
   
                const getSize = () => file.size

                const readChunk = (chunkSize, offset) =>
                    new Promise((resolve, reject) => {
                        const reader = new FileReader()
                        reader.onload = (event) => {
                            if (event.target.error) {
                                reject(event.target.error)
                            }
                            resolve(new Uint8Array(event.target.result))
                        }
                        reader.readAsArrayBuffer(file.slice(offset, offset + chunkSize))
                    })

                mediainfo
                    .analyzeData(getSize, readChunk)
                    .then((result) => {
                        console.log("Frame: " + result.media.track[0].FrameRate);
                        output.value = result;
                    })
                    .catch((error) => {
                        output.value = `An error occured:\n${error.stack}`
                    })
            }
        }

some info like DURATION not detected in mpg format

thank for your great library.
i use web js version of library but DURATION not loaded for mpg file.
in other format like mkv,avi , ... duration load nicely but this problem occur only in mpg format

Use with-libcurl

This resource has been great! I was able to incorporate mediainfo.js into my project and have been able to extract the metadata I need.

However, whilst testing I have been using the <Input type....... approach for simplicity.

Now I want to ditch that and just directly access the video files on the webserver. The problem is I can't pass a URL to the MediaInfoModule.

Then I read that the CLI version of MediaInfo comes with an option to compile using libcurl. Therefore, allowing a URL to specified. In this instance, it just downloads enough to create the output.

Is there a way of passing a URL?

Thanks

Andrew

Using the library from the file-protocol possible?

This library is awesome and works pretty good!

Here's one thing, though (I don't know, if this can get solved using wasm at all):

Since mediainfo uses fetch to load data, I'm unable to run it from the file:// protocol.
I tried to polyfill `fetch, but get this error:

wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': An argument must be provided, which must be a Response or Promise object

Any hint, if it is even possible to use mediainfo.js from the file://protocol?

MediaInfoLib 17.10

Hello,

I did forked this repo and attempted to build a new js file from latest MediaInfoLib 17.10, everything went fine at first glance, but it turns out certain files such as *.mkv returns incomplete metadata (eg, missing Duration, Frame Rate, etc)

By analyzing how these two versions does work (yours, and mine), i can see some strange behavior when invoking open_buffer_continue by adding this console call at processChunk:

...
          seekTo = seekToLow + (seekToHigh * 4294967296);
        }
        console.debug('len=%s, state=%s, offset=%s', l, state, offset, seekToLow, seekToHigh, seekTo)

The mkv file i'm using to test has a length of 3914281338 bytes, for reference, the issue is not tied to that specific file.

MediaInfoLib 17.10 gives:

len=5242880, state=5, offset=0 -1 -1 -1
len=5242880, state=5, offset=5242880 -1 -1 -1
len=5242880, state=5, offset=10485760 -1 -1 -1
len=5242880, state=5, offset=15728640 -1 -1 -1
len=5242880, state=5, offset=20971520 -1 -1 -1
len=5242880, state=5, offset=26214400 -1 -1 -1
len=5242880, state=7, offset=31457280 -380764220 0 3914203076
len=78262, state=7, offset=3914203076 -1 -1 -1
len=0, state=7, offset=3914281338 -1 -1 -1

Your version, latest one on gh-pages as of time of this write, gives:

len=5242880, state=5, offset=0 -1 -1 -1
len=5242880, state=5, offset=5242880 -1 -1 -1
len=5242880, state=5, offset=10485760 -1 -1 -1
len=5242880, state=5, offset=15728640 -1 -1 -1
len=5242880, state=5, offset=20971520 -1 -1 -1
len=5242880, state=5, offset=26214400 -1 -1 -1
len=5242880, state=5, offset=31457280 -1 -1 -1
len=5242880, state=5, offset=36700160 -1 -1 -1
len=5242880, state=5, offset=41943040 -1 -1 -1
len=5242880, state=5, offset=47185920 -1 -1 -1
len=5242880, state=5, offset=52428800 -1 -1 -1
len=5242880, state=5, offset=57671680 -1 -1 -1
len=5242880, state=5, offset=62914560 -1 -1 -1
len=5242880, state=5, offset=68157440 -1 -1 -1
len=5242880, state=5, offset=73400320 -1 -1 -1
len=5242880, state=7, offset=78643200 -380764220 0 3914203076
len=78262, state=15, offset=3914203076 -1 -1 -1

Do you have some clue what the problem could be?

Btw, I did modified MediaInfo_Inform.cpp to export to JSON by default when compiling with Emscripten, if you are interested in that i can send you a patch.

Question: Syntax question

Still trying to figure out how this script operates. Im trying to hardcode the file that is to be analyzed.

ive replaced const file = fileinput.files[0] with const file = "D:\videoFiles\sampleVideo.mp4

Then I call the onChangeFile class with a button <button class="btn btn-default" id="getframe" onclick="onChangeFile()">Get Frame Rate</button>

It never produces a result. The output displays "Working…"

Is there a different place that I can hardcode the file name & path?

 const onChangeFile = (filename) => {
            //const file = fileinput.files[0]
            const file = "D:\videoFiles\sampleVideo.mp4";

            if (file) {

                output.value = 'Working…'
   
                const getSize = () => file.size

                const readChunk = (chunkSize, offset) =>
                    new Promise((resolve, reject) => {
                        const reader = new FileReader()
                        reader.onload = (event) => {
                            if (event.target.error) {
                                reject(event.target.error)
                            }
                            resolve(new Uint8Array(event.target.result))
                        }
                        reader.readAsArrayBuffer(file.slice(offset, offset + chunkSize))
                    })

                mediainfo
                    .analyzeData(getSize, readChunk)
                    .then((result) => {
                        console.log("Frame: " + result.media.track[0].FrameRate);
                        output.value = result;
                    })
                    .catch((error) => {
                        output.value = `An error occured:\n${error.stack}`
                    })
            }
        }

Example for using in Node.js

Just posting this here if someone might be interested.

I know that we can use the mediaInfo binary for node but sometimes you run in a strange environment and you wanna stick to js and not rely on binaries.

This is how I used this library in Node.js - this is probably the simplest way to use it there are probably some better practices -

'use strict';
const mediaInfo = require('mediainfo.js');
const parser = require('xml2json');
const fs = require('fs');

let mi;

function init() {
  patchFsForMediaInfo();
  let mediaInfoLib = mediaInfo();
  mi = new mediaInfoLib.MediaInfo();
}

function patchFsForMediaInfo() {
  // some weird bug in the mediainfo.js library
  var oldReadFileSync = fs.readFileSync;
  fs.readFileSync = function(filename) {
    if (filename === 'mediainfo.js.mem') {
      return oldReadFileSync.call(this, require.resolve('mediainfo.js') + '.mem');
    } else {
      return oldReadFileSync.apply(fs, arguments);
    }
  };
}

function getMediaInfo(s3FileData) {
  var fileSize = parseInt(s3FileData.ContentLength);
  var offset = 0;

  mi.open_buffer_init(fileSize, offset);
  mi.open_buffer_continue(s3FileData.Body, fileSize); // s3FileData.Body is a buffer
  var xmlResult = mi.inform();
  mi.close();

  var result = parser.toJson(xmlResult, { object: true });
  return result;
}

module.exports = {
  init, getMediaInfo
};

Server-side rendering (SSR)

I've already tried the troubleshooting steps from #38 since I'm using react, but with next.js. I've also tried using next.config.js instead of webpack.config.js but both don't seem to work.

the error comes from node_modules/mediainfo.js/dist/mediainfo.js:40:905

I believe Next.js uses nodejs to render server-side first, and then switches to browser-only js which is probably why it's freaking out. Is there maybe some way to disable fs and path inside mediainfo.js or is next.js compatibility not supported at all?

[Question] - Get raw output value

Hello there,

Thank you for an awesome library, everything is working fine so far, and I got a question about the output value. Currently, all the values are parsed to the human-friendly format. For example, the Duration is 1h 13mn. I wonder if I can get the raw value without any format, just the number so I can format it to the way I like.

In the demo website of Mediainfo Demo, you can get the raw values with XML or JSON output option, but not others.

Error when loading mediainfo in frontend

Hello,

I get this error when trying to load Mediainfo in an Angular 8 project:

ERROR in ./node_modules/mediainfo.js/dist/mediainfo.js
Module not found: Error: Can't resolve 'fs' in '/vagrant/frontend/node_modules/mediainfo.js/dist'
ERROR in ./node_modules/mediainfo.js/dist/mediainfo.js
Module not found: Error: Can't resolve 'path' in '/vagrant/frontend/node_modules/mediainfo.js/dist'

As it's a frontend application I obviously aint got the node's fs module.

I was just trying to run your browser example. Any ideas what may be happening ?

I have installed it with npm.

could not load "mediainfo.wasm" in electron renderer

GET //mediainfo.wasm net::ERR_FILE_NOT_FOUND
index.html:1 Uncaught (in promise) TypeError: Failed to fetch
mediainfo.js:874 GET http://mediainfo.wasm/ net::ERR_NAME_NOT_RESOLVED
Uncaught (in promise) TypeError: Failed to fetch

I'm using electron and react.
and import mediainfo.js from App.js with this line. import MediaInfo from "mediainfo.js";
I put mediainfo.wasm file into /public directory, but not works.

Question. Query specific data.

Im trying to come up with a way to extract specific data.

For example. Frame rate.

Im thinking the syntax should be something like this with result.frameRate

`

        mediainfo
               .analyzeData(getSize, readChunk)
                .then((result) => {
                    consoleLog("Frame: "+ result.frameRate)
                    //output.value = result
                })
                .catch((error) => {
                    output.value = `An error occured:\n${error.stack}`
                })`

but I cant figure out the exact syntax. Can you help point me in the right direction?

Error instantiating MediaInfo (WebAssembly Compile error)

Hi,
I'm new on using this library, and I was following the instructions to install and the examples provided and integrating it on my application.
I have a React application, already with a drag/drop mechanism for uploading videos, so I thought it would be a matter of copy/paste the example with a few changes:

I have installed mediainfo.js using yarn
yarn add mediainfo.js

Then added the following code

          import MediaInfo from 'mediainfo.js';

          const readChunk = (file) => (chunkSize, offset) =>
             new Promise((resolve, reject) => {
                const reader = new FileReader()
                reader.onload = (event) => {
                if (event.target.error) {
                   reject(event.target.error)
                }
                resolve(new Uint8Array(event.target.result))
             }
             reader.readAsArrayBuffer(file.slice(offset, offset + chunkSize))
           });
          ...
          MediaInfo().then((mediainfo) =>
            mediainfo
            .analyzeData(() => file.size, readChunk(file))
            .then((result) => {
              console.log('RESULT', result);
            })
            .catch((error) => {
              console.log('ERROR', error);
            })
        )

I had set breakpoints on both then and catch, but none are being called, instead I get the errors below:

Chrome:

CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0
arg0:CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0 

Firefox:

 instrument.js:138
Uncaught (in promise) RuntimeError: abort(CompileError: wasm validation error: at offset 4: failed to match magic number). Build with -s ASSERTIONS=1 for more info

Eventually, Firefox gives me a stack trace:

Unhandled Rejection (CompileError): wasm validation error: at offset 4: failed to match magic number
instantiateArrayBuffer/<
node_modules/mediainfo.js/dist/mediainfo.js:633
promise callback*instantiateArrayBuffer
node_modules/mediainfo.js/dist/mediainfo.js:632
instantiateAsync/</<
node_modules/mediainfo.js/dist/mediainfo.js:649
promise callback*instantiateAsync/<
node_modules/mediainfo.js/dist/mediainfo.js:646
promise callback*instantiateAsync
node_modules/mediainfo.js/dist/mediainfo.js:644
createWasm
node_modules/mediainfo.js/dist/mediainfo.js:667
./node_modules/mediainfo.js/dist/mediainfo.js/</</Module</<
node_modules/mediainfo.js/dist/mediainfo.js:2936
MediaInfoFactory
node_modules/mediainfo.js/dist/mediainfo.js:3328
MediaInfoFactory/<
node_modules/mediainfo.js/dist/mediainfo.js:3305
MediaInfoFactory
node_modules/mediainfo.js/dist/mediainfo.js:3304
<<<My code here>>>

I know that it requires wasm libraries, but do I need to do some extra steps to install it?

I've tried it on:
Firefox 87.0
Chrome 90.0.4430.85
mediainfojs 0.1.5

Query Specific Data

I got an example working great.

Now Im trying to come up with a way to extract specific data.

For example. Frame rate.

Im thinking the syntax should be something like this with result.frameRate

`

      mediainfo
              .analyzeData(getSize, readChunk)
               .then((result) => {
                   consoleLog("Frame: "+ result.frameRate)
                   //output.value = result
               })
               .catch((error) => {
                   output.value = `An error occured:\n${error.stack}`
               })`

but I cant figure out the exact syntax. Can you help point me in the right direction?

where is the coverData?

my code

MediaInfo({ coverData: true }).then((mediainfo: any) => mediainfo
        .analyzeData(() => file.size, this.readChunk(file))
        .then((result: any) => {
           console.log(result);  // I did not found the coverData
         })

there is no coverData in result, where is the coverData?

Using mediainfo.js with Angular

Hello,

I am trying to use this library in my application written in Angular 7.

I could not compile the project as explained because it appears it can be compiled only on a 32 bit machine and on my machine is giving a lot of problems, so I am using the mediainfo.js and mediainfo.js.mem that I found in the repository.

After many attempts, I can load mediainfo.js but I get always the error that infomedia.js.mem cannot be found.

I tried all the possible combinations modifying the path in mediainfo.js but it looks like there is no way to get it loaded.

I checked the source of the demo on the internet but I could not see loaded on the there too.

Does anyone else use this library with Angular? Or any other library such as React to Vue?

Thanks for this library and for the help.

Regards

Nic

Different format/codec support from MediaInfo

Noticing that mediainfo.js fails to extract information for some common (?) file types which MediaInfo displays full information for. For example all mediainfo.js displays for this .mov file:
https://dl.dropboxusercontent.com/u/36771332/P1010596.MOV
is
Format QuickTime
Format Info Original Apple specifications
and for this .mp4 file:
https://dl.dropboxusercontent.com/u/36771332/HEALTH-ECIGARETTES-USA.MP4
Format MPEG-4
Format profile Base Media / Version 2
Codec ID mp42 (mp42/mp41)
whereas MediaInfo displays full video and audio details for both.

From casual observation it looks like .mov files with format=MPEG-4 are fully decoded by mediainfo.js but those with format=QuickTime are not. Similarly .mp4 files with a codec ID that includes "isom" are fully decoded, but those with codec ID including "mp42" are not.

Has mediainfo.js been built with only a subset of the formats and codec support which MediaInfo has? Alternatively how to go about finding why these files (and many others) are not fully handled by mediainfo.js ? Are there any debug options that can be enabled, for example, which might provide useful diagnostic info?

Mediainfo.js integration in Angular 8

i get this errr
zone.js?d135:1127 GET http://localhost:8080/app/MediaInfoModule.wasm 404 (Not Found) eval @ zone.js?d135:1127 instantiateAsync @ mediainfo.js?5690:40 createWasm @ mediainfo.js?5690:40 eval @ mediainfo.js?5690:40 MediaInfoFactory @ mediainfo.js?5690:168 eval @ media-manager.component.ts?fb45:714 eval @ tslib.es6.js?9ab4:73 ZoneAwarePromise @ zone.js?d135:915 __awaiter @ tslib.es6.js?9ab4:69

how to fix it

Returning MediaInfo library as a Promise Hangs the Browser

Consider the following JavaScript code:

function init() {
  return new Promise((resolve) => {
    const lib = MediaInfo(() => {
      resolve(lib);
    });
  });
}

init().then((lib) => console.log(lib));

While perfectly reasonable on the surface, running it actually hangs the browser. The log statement is never printed and the entire UI freezes in Chrome. Add a button to the HTML, try to click it and it won't animate. It also locks down the tab and refreshes fail. You have to completely kill the tab and re-open a new one to try again. The same thing happens if you try to use async/await patterns.

I believe the problem here is the Module.then() function. My lib variable is effectively a Module (looking at the obfuscated source here) and the Module has a then() function (reproduced below and pretty-printed).

function then(func) {
    if (Module["calledRun"]) {
        func(Module)
    } else {
        var old = Module["onRuntimeInitialized"];
        Module["onRuntimeInitialized"] = (function() {
            if (old) old();
            func(Module)
        })
    }
    return Module
}

When resolved in a Promise, it sees that the result has a .then() and considers it Thenable. It invokes .then() and returns it's result, expecting a Promise or another Thenable which will chain to an eventual result.

However, .then() actually returns Module which is Thenable with the same function. This endlessly recurses as the Promise continually wraps the Module and invokes .then(). This adds microtasks to the queue forever and so the browser never moves on to paint the UI.

I'm guessing this library was written in a time before the native Promise object, but it should either be changed to be compatible with Thenable semantics or have this function renamed to something else.

Is it possible to analyze an s3 signed url?

Wondering if there are any ways to analyze an s3 asset
What I'm trying to do is store some metadata of the file a user uploads to s3. Is there any way I can pass in a s3 url to the library and analyze it without downloading it?

hangs on some files

I'm encountering this error with one of the files. the original lib (non-js) works fine on that same file.

Uncaught abort("Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value 536870912, (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 ") at Error
    at jsStackTrace (file:///media/vankasteelj/WD500/GIT/opensubtitles-uploader/app/js/vendor/mediainfo.js:1:22392)
    at stackTrace (file:///media/vankasteelj/WD500/GIT/opensubtitles-uploader/app/js/vendor/mediainfo.js:1:22575)
    at abort (file:///media/vankasteelj/WD500/GIT/opensubtitles-uploader/app/js/vendor/mediainfo.js:9:13967)
    at abortOnCannotGrowMemory (file:///media/vankasteelj/WD500/GIT/opensubtitles-uploader/app/js/vendor/mediainfo.js:1:22935)
    at enlargeMemory (file:///media/vankasteelj/WD500/GIT/opensubtitles-uploader/app/js/vendor/mediainfo.js:1:23380)
    at Function.Runtime.dynamicAlloc (file:///media/vankasteelj/WD500/GIT/opensubtitles-uploader/app/js/vendor/mediainfo.js:1:6849)
    at _sbrk (file:///media/vankasteelj/WD500/GIT/opensubtitles-uploader/app/js/vendor/mediainfo.js:1:73610)
    at Mta (file:///media/vankasteelj/WD500/GIT/opensubtitles-uploader/app/js/vendor/mediainfo.js:1:1052160)
    at Spa (file:///media/vankasteelj/WD500/GIT/opensubtitles-uploader/app/js/vendor/mediainfo.js:1:940060)
    at Yua (file:///media/vankasteelj/WD500/GIT/opensubtitles-uploader/app/js/vendor/mediainfo.js:1:1099625)

it hangs for about 2min (on i5 4670k, 16gb ram), then prints that error. I'm using node, but on your test website it acts the same (freezing the entire browser)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.