Skip to content

Commit

Permalink
Add ffmpeg to svelte frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
BurnySc2 committed Jul 30, 2023
1 parent 81a78c5 commit 517b3d3
Show file tree
Hide file tree
Showing 15 changed files with 804 additions and 2,406 deletions.
2 changes: 1 addition & 1 deletion fastapi_server/systemd/fastapiserver_dev.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[Service]
ExecStart=/usr/bin/docker run --rm --name fastapi_server_dev \
--publish 8001:8000 \
--env STAGE=dev \
--env STAGE=DEV \
--env TIMEOUT=600 \
-v ./data:/root/fastapi_server/data \
burnysc2/fastapi_server:latest_dev
Expand Down
6 changes: 6 additions & 0 deletions svelte_frontend/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ install-dev:
COPY static /root/svelte_frontend/static
# Why is tsconfig.json not needed here?
COPY svelte.config.js vite.config.js ./
# Fix ffmpeg package.json
COPY fixes/package_ffmpeg.json node_modules/@ffmpeg/ffmpeg/package.json
COPY fixes/package_utils.json node_modules/@ffmpeg/util/package.json
SAVE ARTIFACT ./*

install-test:
Expand All @@ -24,6 +27,9 @@ install-test:
COPY svelte.config.js vite.config.js ./
COPY tests /root/svelte_frontend/tests
COPY playwright.config.ts ./
# Fix ffmpeg package.json
COPY fixes/package_ffmpeg.json node_modules/@ffmpeg/ffmpeg/package.json
COPY fixes/package_utils.json node_modules/@ffmpeg/util/package.json

format:
# Run on host system instead of inside a container
Expand Down
64 changes: 64 additions & 0 deletions svelte_frontend/fixes/package_ffmpeg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"name": "@ffmpeg/ffmpeg",
"version": "0.12.2",
"description": "FFmpeg WebAssembly version for browser",
"main": "./dist/umd/ffmpeg.js",
"types": "./dist/esm/index.d.ts",
"exports": {
".": {
"types": "./dist/esm/index.d.ts",
"import": "./dist/esm/index.js",
"require": "./dist/umd/ffmpeg.js"
}
},
"scripts": {
"dev": "webpack -w --mode development",
"lint": "eslint src",
"clean": "rimraf dist",
"build:esm": "tsc -p tsconfig.esm.json",
"build:umd": "webpack",
"build": "npm run clean && npm run build:esm && npm run build:umd",
"prepublishOnly": "npm run build"
},
"files": [
"dist",
"types/ffmpeg.d.ts"
],
"repository": {
"type": "git",
"url": "git+https://github.com/ffmpegwasm/ffmpeg.wasm.git"
},
"keywords": [
"ffmpeg",
"WebAssembly",
"video",
"audio",
"transcode"
],
"author": "Jerome Wu <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://github.com/ffmpegwasm/ffmpeg.wasm/issues"
},
"engines": {
"node": ">=18.17.0"
},
"homepage": "https://github.com/ffmpegwasm/ffmpeg.wasm#readme",
"publishConfig": {
"access": "public"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.1.0",
"@typescript-eslint/parser": "^6.1.0",
"eslint": "^8.45.0",
"rimraf": "^5.0.1",
"ts-loader": "^9.4.4",
"typescript": "^5.1.6",
"webpack-cli": "^5.1.4",
"worker-loader": "^3.0.8"
},
"dependencies": {
"@ffmpeg/types": "^0.12.0"
},
"type": "module"
}
56 changes: 56 additions & 0 deletions svelte_frontend/fixes/package_utils.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"name": "@ffmpeg/util",
"version": "0.12.0",
"description": "browser utils for @ffmpeg/*",
"main": "./dist/cjs/index.js",
"types": "./dist/cjs/index.d.ts",
"exports": {
".": {
"types": "./dist/cjs/index.d.ts",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
}
},
"scripts": {
"dev": "tsc -p tsconfig-esm.json --watch",
"lint": "eslint src",
"clean": "rimraf dist",
"build:esm": "tsc -p tsconfig.esm.json",
"build:umd": "tsc -p tsconfig.cjs.json && webpack",
"build": "npm run clean && npm run build:esm && npm run build:umd"
},
"files": [
"dist"
],
"repository": {
"type": "git",
"url": "git+https://github.com/ffmpegwasm/ffmpeg.wasm.git"
},
"keywords": [
"ffmpeg",
"video",
"audio",
"transcode"
],
"author": "Jerome Wu <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://github.com/ffmpegwasm/ffmpeg.wasm/issues"
},
"engines": {
"node": ">=18.17.0"
},
"homepage": "https://github.com/ffmpegwasm/ffmpeg.wasm#readme",
"publishConfig": {
"access": "public"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.1.0",
"@typescript-eslint/parser": "^6.1.0",
"eslint": "^8.45.0",
"rimraf": "^5.0.1",
"typescript": "^5.1.6",
"webpack-cli": "^5.1.4"
},
"type": "module"
}
Loading

0 comments on commit 517b3d3

Please sign in to comment.