Comments (9)
Hm, maybe you coincidentally already had things set up in a way that it wasn't a problem?
Personally, I had to use this (for future reference in case someone else stumbles across this):
module: {
noParse: /ffmpeg/,
rules: [{
test: /\.(js|jsx)$/,
exclude: [/node_modules/, /ffmpeg/],
use: [
'babel-loader',
],
},
...
... so that bundling worked. (Without it, webpack's node process would quickly balloon into using gigs of RAM)
Oh yeah - I don't have ffmpeg in my node_modules because... I tried to get Webstorm not to crash because of trying to index the file. So I copied it out of there and excluded only my ffmpeg directory in Webstorm's project window. Which... I thought would keep it from indexing and thus crashing - didn't work. Using VS Code now.
And in my dev environment config this...
new webpack.EvalSourceMapDevToolPlugin({
exclude: /ffmpeg/
})
... to prevent the file from ballooning up to ~35 MB.
from ffmpeg.js.
@s-h-a-d-o-w You are amazing thanks
from ffmpeg.js.
I passed --max-old-space-size=8192
to get it to build. I have other problems now, ;-) but this helped me get past this particular issue.
from ffmpeg.js.
@JHartman5 Thanks for your help.
We decided not to encode the raw data from webcam. Instead we are using MediaStream Recording API
to have webm
segments, which small enough to send back to the server.
from ffmpeg.js.
@JHartman5
But doesn't that take forever to build? I waited for like 2 minutes and when it was still not done, I killed the process...
It's not really a great dev workflow when after each change, you have to wait minutes for the build process to finish?
from ffmpeg.js.
No, it worked in the normal time for me.
from ffmpeg.js.
// webpack.config.js
const path = require('path');
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
noParse: /ffmpeg/,
rules: [{
test: /\.(js|jsx)$/,
exclude: [/node_modules/, /ffmpeg/],
use: [
'babel-loader',
],
}]
}
};
This is my configuration of webpack. And this error occurs when build.
ERROR in bundle.js from Terser
Import statement may only appear at top level [bundle.js:91,0]
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `webpack`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build 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! /Users/chengjinrui/.npm/_logs/2019-08-02T12_00_30_302Z-debug.log
from ffmpeg.js.
from ffmpeg.js.
It's important to exclude it from the minification if you have that otherwise your build time will skyrocket
from ffmpeg.js.
Related Issues (20)
- Please add browser build of ffmpeg.js HOT 8
- Generated mp4 files getting failed on Vimeo HOT 1
- Building without Docker is extremely slow
- Further Build with Docker instructions HOT 3
- HLS streaming with remote playlist HOT 3
- Are URL inputs supported? HOT 1
- create video from jpeg ipcam snapshot
- when I try to make flv to mp4, it show that flv Invalid data found when processing input HOT 2
- "Bad mount point"
- Upgrade to new FFMPEG version HOT 1
- Error when trying to extract frames from a video HOT 2
- Cannot read property 'write' of undefined HOT 2
- Are there more compact build for FFmpeg library?
- How to Remove the video track from an .mp4 file? HOT 1
- { code: 101, msg: 'The input file path must be a string' } HOT 1
- .mp4 -> .gif without full FFmpeg library HOT 1
- MP4 to PNG: output%d.png: Invalid argument, How can I edit the Makefile to enable PNG output? HOT 1
- Typescript types for FFMPEG.js?
- Support hevc_videotoolbox in ffmpeg
- -movflags seems to not recognize itself
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ffmpeg.js.