bgrins / videoconverter.js

[UNMAINTAINED] Convert videos in your browser
http://bgrins.github.io/videoconverter.js/
Other
2.34k stars 300 forks source link

Upgrade to emscripten 1.35.0, ffmpeg 3.1.3 #55

Open dinedal opened 7 years ago

dinedal commented 7 years ago

This PR fixes both the all codecs and lgpl only build paths.

I tried to keep all emscripten only configure patches to either sed or .patch files, this way it makes it a little easier to upgrade dependencies later.

I had to make a change to the JS other changes for this to work; in this version of emscripten, using -O2 somehow breaks the synchronous API in ffmpeg-pre.js and ffmpeg-post.js. You must now use an asynchronous API during conversion; by specifying Module['returnCallback'] = function(result) { ... } see worker-asm.js for a full example. If you disable the -O2, the synchronous API from before works, I can only imagine that the new emscrpiten is culling the changes in optimization now.

I also upgraded libvpx to 1.6 and x264 to x264-snapshot-20160910-2245

MadLittleMods commented 7 years ago

Was running into the following error but it was solved by providing Module['memoryInitializerPrefixURL'] = 'http://localhost:3000/' here, https://github.com/bgrins/videoconverter.js/blob/42def8c4136b03cbe55951fbf6fcda214f51059a/demo/worker-asm.js#L25

XMLHttpRequest cannot load . Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.

ffmpeg-all-codecs.js:83 Uncaught could not load memory initializer ffmpeg-all-codecs.js.mem

Why is the mem file necessary now?


Anything left to move this forward to get a merge?

I suppose the new async nature needs to be decided on.

dinedal commented 7 years ago

Why is the mem file necessary now?

The newer Emscripten generates it. https://kripken.github.io/emscripten-site/docs/optimizing/Optimizing-Code.html#memory-initialization

davidturissini commented 6 years ago

@dinedal I pulled this down and everything seems to work except png output. Can you advise what needs to change for png output to behave as expected?

For reference, the following ffmpeg command fails at /demo: -i input.webm -filter_complex showwavespic -frames:v 1 output.png

Output: Encoder (codec png) not found for output stream #0:0

Whereas, this command runs as expected: -i input.webm -filter_complex showwavespic -frames:v 1 output.jpg

MadLittleMods commented 6 years ago

@bgrins Friendly ping on timeline to review/merge?