ffmpegwasm / ffmpegwasm/ffmpeg.wasm

Supply @ffmpeg/core directly to createFFmpeg instead of as URL

Đang mở
#126 2 bình luận 19 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C
Star
17.8k
Fork
1.1k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**Is your feature request related to a problem? Please describe.**
I'm running ffmpeg.wasm in a browser environment but do not want to rely on loading a script from unpkg.com (it's annoying from a CORS perspective and goes against security and uptime best practices). Seemingly not a big deal since you can supply `corePath` but this is a little tricky with a bundler involved (particularly with Parcel which we use).

`ffmpeg-core.js` needs to be bundled since it does its own imports but it also needs to be reference by name and can't be in the same bundle. Code-splitting or dynamic importing would seem to be a solution but bundlers increasingly handle those transparently and don't expose the name.

**Describe the solution you'd like**
I'd like to be able to import `ffmpeg-core.js` myself and supply it to `createFFmpeg`, e.g.
```javascript
import FFmpegCore from '@ffmpeg/core/dist/ffmpeg-core'
const ffmpeg = createFFmpeg({ corePath: FFmpegCore });
```
or

```javascript
const FFmpegCore await import('@ffmpeg/core/dist/ffmpeg-core')
const ffmpeg = createFFmpeg({ corePath: FFmpegCore });
```

**Describe alternatives you've considered**
I've explored a few different bundlers and solving this problem on that level is quite annoying. You could also supply a version that bundles core but just allowing the user to supply it lets the whole thing be bundled together anyway.

**Additional context**
N/A

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.