Reorg folders and use core as ffmpeg from now on
@@ -1,50 +0,0 @@
|
||||
{
|
||||
"name": "@ffmpeg/core-mt",
|
||||
"version": "0.11.0",
|
||||
"description": "ffmpeg.wasm core",
|
||||
"main": "./dist/ffmpeg-core.cjs",
|
||||
"types": "./types/ffmpeg-core.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./types/ffmpeg-core.d.ts",
|
||||
"import": "./dist/ffmpeg-core.js",
|
||||
"require": "./dist/ffmpeg-core.cjs"
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/ffmpegwasm/ffmpeg.wasm.git"
|
||||
},
|
||||
"keywords": [
|
||||
"ffmpeg",
|
||||
"webassembly",
|
||||
"video",
|
||||
"audio",
|
||||
"transcode"
|
||||
],
|
||||
"author": "jeromewus@gmail.com",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/ffmpegwasm/ffmpeg.wasm/issues"
|
||||
},
|
||||
"homepage": "https://github.com/ffmpegwasm/ffmpeg.wasm#readme",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"types"
|
||||
],
|
||||
"scripts": {
|
||||
"lint": "eslint types"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/emscripten": "^1.39.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^5.37.0",
|
||||
"@typescript-eslint/parser": "^5.37.0",
|
||||
"eslint": "^8.23.1",
|
||||
"typescript": "^4.8.3"
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json"
|
||||
}
|
||||
10
packages/core-mt/types/ffmpeg-core.d.ts
vendored
@@ -1,10 +0,0 @@
|
||||
/// <reference types="emscripten" />
|
||||
|
||||
type Pointer = number;
|
||||
type StringArrayPointer = Pointer;
|
||||
|
||||
interface FFmpegCoreModule extends EmscriptenModule {
|
||||
_ffmpeg: (number, StringArrayPointer) => number;
|
||||
}
|
||||
declare const createFFmpegCore: EmscriptenModuleFactory<FFmpegCoreModule>;
|
||||
export default createFFmpegCore;
|
||||
@@ -1,50 +0,0 @@
|
||||
{
|
||||
"name": "@ffmpeg/core",
|
||||
"version": "0.11.0",
|
||||
"description": "ffmpeg.wasm core",
|
||||
"main": "./dist/ffmpeg-core.cjs",
|
||||
"types": "./types/ffmpeg-core.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./types/ffmpeg-core.d.ts",
|
||||
"import": "./dist/ffmpeg-core.js",
|
||||
"require": "./dist/ffmpeg-core.cjs"
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/ffmpegwasm/ffmpeg.wasm.git"
|
||||
},
|
||||
"keywords": [
|
||||
"ffmpeg",
|
||||
"webassembly",
|
||||
"video",
|
||||
"audio",
|
||||
"transcode"
|
||||
],
|
||||
"author": "jeromewus@gmail.com",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/ffmpegwasm/ffmpeg.wasm/issues"
|
||||
},
|
||||
"homepage": "https://github.com/ffmpegwasm/ffmpeg.wasm#readme",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"types"
|
||||
],
|
||||
"scripts": {
|
||||
"lint": "eslint types"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/emscripten": "^1.39.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^5.37.0",
|
||||
"@typescript-eslint/parser": "^5.37.0",
|
||||
"eslint": "^8.23.1",
|
||||
"typescript": "^4.8.3"
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json"
|
||||
}
|
||||
2
packages/ffmpeg/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
dist/
|
||||
types/
|
||||
5
packages/ffmpeg/jest.config.js
Normal file
@@ -0,0 +1,5 @@
|
||||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
|
||||
module.exports = {
|
||||
preset: 'ts-jest',
|
||||
testEnvironment: 'node',
|
||||
};
|
||||
@@ -2,27 +2,18 @@
|
||||
"name": "@ffmpeg/ffmpeg",
|
||||
"version": "0.11.5",
|
||||
"description": "FFmpeg WebAssembly version",
|
||||
"main": "src/index.js",
|
||||
"types": "src/index.d.ts",
|
||||
"directories": {
|
||||
"example": "examples"
|
||||
"main": "./dist/ffmpeg.cjs",
|
||||
"types": "./types/ffmpeg.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./types/ffmpeg.d.ts",
|
||||
"import": "./dist/ffmpeg.js",
|
||||
"require": "./dist/ffmpeg.cjs"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"start": "node scripts/server.js",
|
||||
"start:worker": "node scripts/worker-server.js",
|
||||
"build": "rimraf dist && webpack --config scripts/webpack.config.prod.js",
|
||||
"build:worker": "rimraf dist && webpack --config scripts/webpack.config.worker.prod.js",
|
||||
"prepublishOnly": "npm run build",
|
||||
"wait": "rimraf dist && wait-on http://localhost:3000/dist/ffmpeg.dev.js",
|
||||
"test": "npm-run-all -p -r start test:all",
|
||||
"test:all": "npm-run-all wait test:browser:ffmpeg test:node:all",
|
||||
"test:node": "node node_modules/mocha/bin/_mocha --exit --bail --require ./scripts/test-helper.js",
|
||||
"test:node:all": "npm run test:node -- ./tests/*.test.js",
|
||||
"test:browser": "mocha-headless-chrome -a allow-file-access-from-files -a incognito -a no-sandbox -a disable-setuid-sandbox -a disable-logging -t 300000",
|
||||
"test:browser:ffmpeg": "npm run test:browser -- -f ./tests/ffmpeg.test.html"
|
||||
},
|
||||
"browser": {
|
||||
"./src/node/index.js": "./src/browser/index.js"
|
||||
"lint": "eslint src",
|
||||
"test": "jest"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -31,7 +22,9 @@
|
||||
"keywords": [
|
||||
"ffmpeg",
|
||||
"WebAssembly",
|
||||
"video"
|
||||
"video",
|
||||
"audio",
|
||||
"transcode"
|
||||
],
|
||||
"author": "Jerome Wu <jeromewus@gmail.com>",
|
||||
"license": "MIT",
|
||||
@@ -45,16 +38,13 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"is-url": "^1.2.4",
|
||||
"node-fetch": "^2.6.1",
|
||||
"regenerator-runtime": "^0.13.7",
|
||||
"resolve-url": "^0.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^5.37.0",
|
||||
"@typescript-eslint/parser": "^5.37.0",
|
||||
"eslint": "^8.23.1",
|
||||
"jest-puppeteer": "^6.1.1",
|
||||
"ts-jest": "^29.0.1",
|
||||
"typescript": "^4.8.3"
|
||||
}
|
||||
}
|
||||
|
||||
34
packages/ffmpeg/tests/ffmpeg.test.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import type { FFmpegModule } from "..";
|
||||
import createFFmpeg from "..";
|
||||
|
||||
let core: FFmpegModule;
|
||||
|
||||
beforeAll(async () => {
|
||||
core = await createFFmpeg();
|
||||
});
|
||||
|
||||
describe("core", () => {
|
||||
test("core is ready", () => {
|
||||
expect(core).not.toBeUndefined();
|
||||
});
|
||||
|
||||
test("core functions are exported", () => {
|
||||
expect("NULL" in core).toBeTruthy();
|
||||
expect("SIZE_I32" in core).toBeTruthy();
|
||||
expect("exec" in core).toBeTruthy();
|
||||
expect("stringToPtr" in core).toBeTruthy();
|
||||
expect("stringsToPtr" in core).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
describe("stringToPtr()", () => {
|
||||
test("convert a string to pointer", () => {
|
||||
expect(core.stringToPtr("string")).not.toBe(core.NULL);
|
||||
});
|
||||
});
|
||||
|
||||
describe("stringsToPtr()", () => {
|
||||
test("convert a string array to pointer", () => {
|
||||
expect(core.stringsToPtr(["string"])).not.toBe(core.NULL);
|
||||
});
|
||||
});
|
||||
2
packages/ffprobe-mt/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
dist/
|
||||
types/
|
||||
2
packages/ffprobe/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
dist/
|
||||
types/
|
||||
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |