🎥 Make videos programmatically with React
scaffold captions package
Jonny Burgerb240579f5682
diff --git a/packages/captions/README.md b/packages/captions/README.mdnew file mode 100644index 0000000000..ecc18e21dc--- /dev/null+++ b/packages/captions/README.md@@ -0,0 +1,18 @@+# @remotion/captions++Helpers for installing and using Whisper.cpp++[](https://npmcharts.com/compare/@remotion/captions?minimal=true)++## Installation++```bash+npm install @remotion/captions --save-exact+```++When installing a Remotion package, make sure to align the version of all `remotion` and `@remotion/*` packages to the same version.+Remove the `^` character from the version number to use the exact version.++## Usage++See the [documentation](https://www.remotion.dev/docs/captions) for more information.diff --git a/packages/captions/package.json b/packages/captions/package.jsonnew file mode 100644index 0000000000..f2352f7501--- /dev/null+++ b/packages/captions/package.json@@ -0,0 +1,35 @@+{+ "repository": {+ "url": "https://github.com/remotion-dev/remotion/tree/main/packages/captions"+ },+ "name": "@remotion/captions",+ "version": "4.0.215",+ "description": "",+ "main": "dist/index.js",+ "sideEffects": false,+ "bugs": {+ "url": "https://github.com/remotion-dev/remotion/issues"+ },+ "scripts": {+ "formatting": "prettier src --check",+ "lint": "eslint src --ext ts,tsx",+ "test": "bun test src"+ },+ "files": [+ "dist"+ ],+ "author": "Jonny Burger <[email protected]>",+ "license": "SEE LICENSE IN LICENSE.md",+ "dependencies": {},+ "peerDependencies": {},+ "devDependencies": {},+ "keywords": [+ "remotion",+ "openai",+ "whisper"+ ],+ "publishConfig": {+ "access": "public"+ },+ "homepage": "https://www.remotion.dev/docs/captions"+}diff --git a/packages/captions/src/captions.ts b/packages/captions/src/captions.tsnew file mode 100644index 0000000000..190ef16fd3--- /dev/null+++ b/packages/captions/src/captions.ts@@ -0,0 +1,6 @@+export type Caption = {+ text: string;+ timestamp: number;+ from: number;+ to: number;+};diff --git a/packages/captions/src/index.ts b/packages/captions/src/index.tsnew file mode 100644index 0000000000..4c6bd20250--- /dev/null+++ b/packages/captions/src/index.ts@@ -0,0 +1 @@+export {Caption} from './captions';diff --git a/packages/captions/tsconfig.json b/packages/captions/tsconfig.jsonnew file mode 100644index 0000000000..c80d66921c--- /dev/null+++ b/packages/captions/tsconfig.json@@ -0,0 +1,8 @@+{+ "extends": "../tsconfig.settings.json",+ "compilerOptions": {+ "rootDir": "src",+ "outDir": "dist"+ },+ "include": ["src"]+}diff --git a/packages/cli/src/list-of-remotion-packages.ts b/packages/cli/src/list-of-remotion-packages.tsindex 5b4d3ed223..78a3e1bd33 100644--- a/packages/cli/src/list-of-remotion-packages.ts+++ b/packages/cli/src/list-of-remotion-packages.ts@@ -31,6 +31,7 @@ export const listOfRemotionPackages = ['@remotion/tailwind','@remotion/transitions','@remotion/install-whisper-cpp',+ '@remotion/captions','@remotion/animation-utils','@remotion/animated-emoji','@remotion/media-parser',diff --git a/packages/create-video/src/list-of-remotion-packages.ts b/packages/create-video/src/list-of-remotion-packages.tsindex 4adafd53c2..22e982aced 100644--- a/packages/create-video/src/list-of-remotion-packages.ts+++ b/packages/create-video/src/list-of-remotion-packages.ts@@ -31,6 +31,7 @@ export const listOfRemotionPackages = ['@remotion/tailwind','@remotion/transitions','@remotion/install-whisper-cpp',+ '@remotion/captions','@remotion/animation-utils','@remotion/animated-emoji','@remotion/media-parser',diff --git a/packages/docs/package.json b/packages/docs/package.jsonindex e94fe2b6ca..df2c770a70 100644--- a/packages/docs/package.json+++ b/packages/docs/package.json@@ -41,6 +41,7 @@"@remotion/fonts": "workspace:*","@remotion/gif": "workspace:*","@remotion/google-fonts": "workspace:*",+ "@remotion/captions": "workspace:*","@remotion/install-whisper-cpp": "workspace:*","@remotion/lambda": "workspace:*","@remotion/layout-utils": "workspace:*",diff --git a/packages/install-whisper-cpp/package.json b/packages/install-whisper-cpp/package.jsonindex 363e3cc521..a55e76b18a 100644--- a/packages/install-whisper-cpp/package.json+++ b/packages/install-whisper-cpp/package.json@@ -21,10 +21,7 @@"author": "Jonny Burger <[email protected]>","license": "SEE LICENSE IN LICENSE.md","dependencies": {},- "peerDependencies": {- "react": ">=16.8.0",- "react-dom": ">=16.8.0"- },+ "peerDependencies": {},"devDependencies": {},"keywords": ["remotion",diff --git a/packages/it-tests/package.json b/packages/it-tests/package.jsonindex 54ae661950..59b04d2c2d 100644--- a/packages/it-tests/package.json+++ b/packages/it-tests/package.json@@ -28,6 +28,7 @@"@remotion/lottie": "workspace:*","@remotion/layout-utils": "workspace:*","@remotion/install-whisper-cpp": "workspace:*",+ "@remotion/captions": "workspace:*","@remotion/google-fonts": "workspace:*","@remotion/serverless": "workspace:*","@remotion/studio-server": "workspace:*",diff --git a/packages/it-tests/tsconfig.json b/packages/it-tests/tsconfig.jsonindex c5a2be2d41..6bfca56bc6 100644--- a/packages/it-tests/tsconfig.json+++ b/packages/it-tests/tsconfig.json@@ -26,6 +26,9 @@{"path": "../install-whisper-cpp"},+ {+ "path": "../captions"+ },{"path": "../studio-shared"},diff --git a/packages/studio-shared/src/package-info.ts b/packages/studio-shared/src/package-info.tsindex e0981f5a99..2c6e9fca31 100644--- a/packages/studio-shared/src/package-info.ts+++ b/packages/studio-shared/src/package-info.ts@@ -62,6 +62,7 @@ export const packages = ['zod-types','webcodecs','convert',+ 'captions',] as const;export type Pkgs = (typeof packages)[number];@@ -133,6 +134,7 @@ export const descriptions: {[key in Pkgs]: string | null} = {serverless: 'A runtime for distributed rendering',webcodecs: 'Media conversion in the browser',convert: 'Video conversion tool - convert.remotion.dev',+ captions: 'Primitives for dealing with captions',};export const apiDocs: {[key in Pkgs]: string | null} = {@@ -201,4 +203,5 @@ export const apiDocs: {[key in Pkgs]: string | null} = {'animated-emoji': 'https://www.remotion.dev/docs/animated-emoji',webcodecs: null,convert: 'https://convert.remotion.dev',+ captions: 'https://remotion.dev/docs/captions',};diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 91666bb788..11d73153c6 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -186,6 +186,8 @@ importers:specifier: 18.3.1version: 18.3.1([email protected])+ packages/captions: {}+packages/cli:dependencies:'@remotion/bundler':@@ -514,6 +516,9 @@ importers:'@remotion/bundler':specifier: workspace:*version: link:../bundler+ '@remotion/captions':+ specifier: workspace:*+ version: link:../captions'@remotion/cli':specifier: workspace:*version: link:../cli@@ -1028,20 +1033,16 @@ importers:specifier: 3.3.3version: 3.3.3- packages/install-whisper-cpp:- dependencies:- react:- specifier: '>=16.8.0'- version: 18.2.0- react-dom:- specifier: '>=16.8.0'- version: 18.2.0([email protected])+ packages/install-whisper-cpp: {}packages/it-tests:devDependencies:'@remotion/bundler':specifier: workspace:*version: link:../bundler+ '@remotion/captions':+ specifier: workspace:*+ version: link:../captions'@remotion/cli':specifier: workspace:*version: link:../clidiff --git a/tsconfig.json b/tsconfig.jsonindex 8fb92b4a19..8ff6613df5 100644--- a/tsconfig.json+++ b/tsconfig.json@@ -81,6 +81,9 @@{"path": "./packages/install-whisper-cpp"},+ {+ "path": "./packages/captions"+ },{"path": "./packages/motion-blur"},