@remotion/captions 4.0.216

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
@@ -0,0 +1,49 @@
1
+ # Remotion License
2
+
3
+ In Remotion 5.0, the license will slightly change. [View the changes here](https://github.com/remotion-dev/remotion/pull/3750).
4
+
5
+ ---
6
+
7
+ Depending on the type of your legal entity, you are granted permission to use Remotion for your project. Individuals and small companies are allowed to use Remotion to create videos for free (even commercial), while a company license is required for for-profit organizations of a certain size. This two-tier system was designed to ensure funding for this project while still allowing the source code to be available and the program to be free for most. Read below for the exact terms of use.
8
+
9
+ - [Free license](#free-license)
10
+ - [Company license](#company-license)
11
+
12
+ ## Free license
13
+
14
+ Copyright © 2024 [Remotion](https://www.remotion.dev)
15
+
16
+ ### Eligibility
17
+
18
+ You are eligible to use Remotion for free if you are:
19
+
20
+ - an individual
21
+ - a for-profit organization with up to 3 employees
22
+ - a non-profit or not-for-profit organization
23
+ - evaluating whether Remotion is a good fit, and are not yet using it in a commercial way
24
+
25
+ ### Allowed use cases
26
+
27
+ Permission is hereby granted, free of charge, to any person eligible for the "Free license", to use the software non-commercially or commercially for the purpose of creating videos and images and to modify the software to their own liking, for the purpose of fulfilling their custom use case or to contribute bug fixes or improvements back to Remotion.
28
+
29
+ ### Disallowed use cases
30
+
31
+ It is not allowed to copy or modify Remotion code for the purpose of selling, renting, licensing, relicensing, or sublicensing your own derivate of Remotion.
32
+
33
+ ### Warranty notice
34
+
35
+ The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the author or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
36
+
37
+ ### Support
38
+
39
+ Support is provided on a best-we-can-do basis via GitHub Issues and Discord.
40
+
41
+ ## Company license
42
+
43
+ You are required to obtain a company license to use Remotion if you are not within the group of entities eligible for a free license. This license will enable you to use Remotion for the allowed use cases specified in the free license, and give you access to prioritized support (read the [Support Policy](https://www.remotion.dev/docs/support)).
44
+
45
+ Visit [remotion.pro](https://www.remotion.pro/license) for pricing and to buy a license.
46
+
47
+ ### FAQs
48
+
49
+ Are you not sure whether you need a company license because of an edge case? Here are some [frequently asked questions](https://www.remotion.pro/faq).
package/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # @remotion/captions
2
+
3
+ Primitives for dealing with captions
4
+
5
+ [![NPM Downloads](https://img.shields.io/npm/dm/@remotion/captions.svg?style=flat&color=black&label=Downloads)](https://npmcharts.com/compare/@remotion/captions?minimal=true)
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @remotion/captions --save-exact
11
+ ```
12
+
13
+ When installing a Remotion package, make sure to align the version of all `remotion` and `@remotion/*` packages to the same version.
14
+ Remove the `^` character from the version number to use the exact version.
15
+
16
+ ## Usage
17
+
18
+ See the [documentation](https://remotion.dev/docs/captions) for more information.
@@ -0,0 +1,7 @@
1
+ export type Caption = {
2
+ text: string;
3
+ startMs: number;
4
+ endMs: number;
5
+ timestampMs: number | null;
6
+ confidence: number | null;
7
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,19 @@
1
+ import type { Caption } from './caption';
2
+ export type TikTokToken = {
3
+ text: string;
4
+ fromMs: number;
5
+ toMs: number;
6
+ };
7
+ export type TikTokPage = {
8
+ text: string;
9
+ startMs: number;
10
+ tokens: TikTokToken[];
11
+ };
12
+ export type CreateTikTokStyleCaptionsInput = {
13
+ captions: Caption[];
14
+ combineTokensWithinMilliseconds: number;
15
+ };
16
+ export type CreateTikTokStyleCaptionsOutput = {
17
+ pages: TikTokPage[];
18
+ };
19
+ export declare function createTikTokStyleCaptions({ captions, combineTokensWithinMilliseconds, }: CreateTikTokStyleCaptionsInput): CreateTikTokStyleCaptionsOutput;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createTikTokStyleCaptions = createTikTokStyleCaptions;
4
+ function createTikTokStyleCaptions({ captions, combineTokensWithinMilliseconds, }) {
5
+ const tikTokStyleCaptions = [];
6
+ let currentText = '';
7
+ let currentTokens = [];
8
+ let currentFrom = 0;
9
+ let currentTo = 0;
10
+ captions.forEach((item, index) => {
11
+ const { text } = item;
12
+ // If text starts with a space, push the currentText (if it exists) and start a new one
13
+ if (text.startsWith(' ') &&
14
+ currentTo - currentFrom > combineTokensWithinMilliseconds) {
15
+ if (currentText !== '') {
16
+ tikTokStyleCaptions.push({
17
+ text: currentText.trimStart(),
18
+ startMs: currentFrom,
19
+ tokens: currentTokens,
20
+ });
21
+ }
22
+ // Start a new sentence
23
+ currentText = text.trimStart();
24
+ currentTokens = [
25
+ { text: currentText, fromMs: item.startMs, toMs: item.endMs },
26
+ ].filter((t) => t.text !== '');
27
+ currentFrom = item.startMs;
28
+ currentTo = item.endMs;
29
+ }
30
+ else {
31
+ // Continuation or start of a new sentence without leading space
32
+ if (currentText === '') {
33
+ // It's the start of the document or after a sentence that started with a space
34
+ currentFrom = item.startMs;
35
+ }
36
+ currentText += text;
37
+ currentText = currentText.trimStart();
38
+ if (text.trim() !== '') {
39
+ currentTokens.push({
40
+ text: currentTokens.length === 0 ? currentText.trimStart() : text,
41
+ fromMs: item.startMs,
42
+ toMs: item.endMs,
43
+ });
44
+ }
45
+ currentTo = item.endMs;
46
+ }
47
+ // Ensure the last sentence is added
48
+ if (index === captions.length - 1 && currentText !== '') {
49
+ tikTokStyleCaptions.push({
50
+ text: currentText,
51
+ startMs: currentFrom,
52
+ tokens: currentTokens,
53
+ });
54
+ }
55
+ });
56
+ return { pages: tikTokStyleCaptions };
57
+ }
@@ -0,0 +1,9 @@
1
+ import type { Caption } from './caption';
2
+ export type EnsureMaxCharactersPerLineInput = {
3
+ captions: Caption[];
4
+ maxCharsPerLine: number;
5
+ };
6
+ export type EnsureMaxCharactersPerLineOutput = {
7
+ segments: Caption[][];
8
+ };
9
+ export declare const ensureMaxCharactersPerLine: ({ captions, maxCharsPerLine, }: EnsureMaxCharactersPerLineInput) => EnsureMaxCharactersPerLineOutput;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ensureMaxCharactersPerLine = void 0;
4
+ const splitWords = (inputCaptions) => {
5
+ const captions = [];
6
+ for (let i = 0; i < inputCaptions.length; i++) {
7
+ const w = inputCaptions[i];
8
+ const words = w.text.split(' ');
9
+ for (let j = 0; j < words.length; j++) {
10
+ const word = words[j];
11
+ captions.push({
12
+ text: j === 0 ? ` ${word}` : word,
13
+ startMs: w.startMs,
14
+ endMs: w.endMs,
15
+ confidence: w.confidence,
16
+ timestampMs: w.timestampMs,
17
+ });
18
+ }
19
+ }
20
+ return captions;
21
+ };
22
+ const ensureMaxCharactersPerLine = ({ captions, maxCharsPerLine, }) => {
23
+ const splitted = splitWords(captions);
24
+ const segments = [];
25
+ let currentSegment = [];
26
+ for (let i = 0; i < splitted.length; i++) {
27
+ const w = splitted[i];
28
+ const remainingWords = splitted.slice(i + 1);
29
+ const filledCharactersInLine = currentSegment
30
+ .map((s) => s.text.length)
31
+ .reduce((a, b) => a + b, 0);
32
+ const preventOrphanWord = remainingWords.length < 4 &&
33
+ remainingWords.length > 1 &&
34
+ filledCharactersInLine > maxCharsPerLine / 2;
35
+ if (filledCharactersInLine + w.text.length > maxCharsPerLine ||
36
+ preventOrphanWord) {
37
+ segments.push(currentSegment);
38
+ currentSegment = [];
39
+ }
40
+ currentSegment.push(w);
41
+ }
42
+ segments.push(currentSegment);
43
+ return { segments };
44
+ };
45
+ exports.ensureMaxCharactersPerLine = ensureMaxCharactersPerLine;
@@ -0,0 +1,8 @@
1
+ export { Caption } from './caption';
2
+ export { createTikTokStyleCaptions, CreateTikTokStyleCaptionsInput, CreateTikTokStyleCaptionsOutput, TikTokPage, TikTokToken, } from './create-tiktok-style-captions';
3
+ export { EnsureMaxCharactersPerLineInput, EnsureMaxCharactersPerLineOutput, } from './ensure-max-characters-per-line';
4
+ export { parseSrt, ParseSrtInput, ParseSrtOutput } from './parse-srt';
5
+ export { serializeSrt, SerializeSrtInput } from './serialize-srt';
6
+ export declare const CaptionsInternals: {
7
+ ensureMaxCharactersPerLine: ({ captions, maxCharsPerLine, }: import("./ensure-max-characters-per-line").EnsureMaxCharactersPerLineInput) => import("./ensure-max-characters-per-line").EnsureMaxCharactersPerLineOutput;
8
+ };
package/dist/index.js ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CaptionsInternals = exports.serializeSrt = exports.parseSrt = exports.createTikTokStyleCaptions = void 0;
4
+ const ensure_max_characters_per_line_1 = require("./ensure-max-characters-per-line");
5
+ var create_tiktok_style_captions_1 = require("./create-tiktok-style-captions");
6
+ Object.defineProperty(exports, "createTikTokStyleCaptions", { enumerable: true, get: function () { return create_tiktok_style_captions_1.createTikTokStyleCaptions; } });
7
+ var parse_srt_1 = require("./parse-srt");
8
+ Object.defineProperty(exports, "parseSrt", { enumerable: true, get: function () { return parse_srt_1.parseSrt; } });
9
+ var serialize_srt_1 = require("./serialize-srt");
10
+ Object.defineProperty(exports, "serializeSrt", { enumerable: true, get: function () { return serialize_srt_1.serializeSrt; } });
11
+ exports.CaptionsInternals = {
12
+ ensureMaxCharactersPerLine: ensure_max_characters_per_line_1.ensureMaxCharactersPerLine,
13
+ };
@@ -0,0 +1,8 @@
1
+ import type { Caption } from './caption';
2
+ export type ParseSrtInput = {
3
+ input: string;
4
+ };
5
+ export type ParseSrtOutput = {
6
+ captions: Caption[];
7
+ };
8
+ export declare const parseSrt: ({ input }: ParseSrtInput) => ParseSrtOutput;
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseSrt = void 0;
4
+ function toSeconds(time) {
5
+ const [first, second, third] = time.split(':');
6
+ if (!first) {
7
+ throw new Error(`Invalid timestamp:${time}`);
8
+ }
9
+ if (!second) {
10
+ throw new Error(`Invalid timestamp:${time}`);
11
+ }
12
+ if (!third) {
13
+ throw new Error(`Invalid timestamp:${time}`);
14
+ }
15
+ const [seconds, millis] = third.split(',');
16
+ if (!seconds) {
17
+ throw new Error(`Invalid timestamp:${time}`);
18
+ }
19
+ if (!millis) {
20
+ throw new Error(`Invalid timestamp:${time}`);
21
+ }
22
+ return (parseInt(first, 10) * 3600 +
23
+ parseInt(second, 10) * 60 +
24
+ parseInt(seconds, 10) +
25
+ parseInt(millis, 10) / 1000);
26
+ }
27
+ const parseSrt = ({ input }) => {
28
+ const inputLines = input.split('\n');
29
+ const captions = [];
30
+ for (let i = 0; i < inputLines.length; i++) {
31
+ const line = inputLines[i];
32
+ const nextLine = inputLines[i + 1];
33
+ if ((line === null || line === void 0 ? void 0 : line.match(/([0-9]+)/)) && (nextLine === null || nextLine === void 0 ? void 0 : nextLine.includes(' --> '))) {
34
+ const nextLineSplit = nextLine.split(' --> ');
35
+ const start = toSeconds(nextLineSplit[0]);
36
+ const end = toSeconds(nextLineSplit[1]);
37
+ captions.push({
38
+ text: '',
39
+ startMs: start * 1000,
40
+ endMs: end * 1000,
41
+ confidence: 1,
42
+ timestampMs: ((start + end) / 2) * 1000,
43
+ });
44
+ }
45
+ else if (line === null || line === void 0 ? void 0 : line.includes(' --> ')) {
46
+ continue;
47
+ }
48
+ else if ((line === null || line === void 0 ? void 0 : line.trim()) === '') {
49
+ captions[captions.length - 1].text = captions[captions.length - 1].text.trim();
50
+ }
51
+ else {
52
+ captions[captions.length - 1].text += line + '\n';
53
+ }
54
+ }
55
+ return {
56
+ captions: captions.map((l) => {
57
+ return {
58
+ ...l,
59
+ text: l.text.trimEnd(),
60
+ };
61
+ }),
62
+ };
63
+ };
64
+ exports.parseSrt = parseSrt;
@@ -0,0 +1,5 @@
1
+ import type { Caption } from './caption';
2
+ export type SerializeSrtInput = {
3
+ lines: Caption[][];
4
+ };
5
+ export declare const serializeSrt: ({ lines }: SerializeSrtInput) => string;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.serializeSrt = void 0;
4
+ const formatSingleSrtTimestamp = (timestamp) => {
5
+ const hours = Math.floor(timestamp / 3600000);
6
+ const minutes = Math.floor((timestamp % 3600000) / 60000);
7
+ const seconds = Math.floor((timestamp % 60000) / 1000);
8
+ const milliseconds = Math.floor(timestamp % 1000);
9
+ return `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')},${String(milliseconds).padStart(3, '0')}`;
10
+ };
11
+ const formatSrtTimestamp = (startMs, endMs) => {
12
+ return `${formatSingleSrtTimestamp(startMs)} --> ${formatSingleSrtTimestamp(endMs)}`;
13
+ };
14
+ const serializeSrt = ({ lines }) => {
15
+ let currentIndex = 0;
16
+ return lines
17
+ .map((s) => {
18
+ currentIndex++;
19
+ if (s.length === 0) {
20
+ return null;
21
+ }
22
+ const firstTimestamp = s[0].startMs;
23
+ const lastTimestamp = s[s.length - 1].endMs;
24
+ return [
25
+ // Index
26
+ currentIndex,
27
+ formatSrtTimestamp(firstTimestamp, lastTimestamp),
28
+ // Text
29
+ s.map((caption) => caption.text).join(''),
30
+ ].join('\n');
31
+ })
32
+ .filter(Boolean)
33
+ .join('\n\n');
34
+ };
35
+ exports.serializeSrt = serializeSrt;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,159 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const bun_test_1 = require("bun:test");
4
+ const ensure_max_characters_per_line_1 = require("../ensure-max-characters-per-line");
5
+ (0, bun_test_1.test)('Ensure max characters per line', () => {
6
+ const captions = [
7
+ {
8
+ confidence: 1,
9
+ endMs: 6000,
10
+ startMs: 3000,
11
+ text: 'This is a demonstration of SRT subtitles.',
12
+ timestampMs: 4500,
13
+ },
14
+ {
15
+ confidence: 1,
16
+ endMs: 10500,
17
+ startMs: 7000,
18
+ text: 'You can use SRT files to add subtitles to your videos.',
19
+ timestampMs: 8750,
20
+ },
21
+ ];
22
+ // TODO: This creates captions that are not nice!
23
+ (0, bun_test_1.expect)((0, ensure_max_characters_per_line_1.ensureMaxCharactersPerLine)({ captions, maxCharsPerLine: 42 })).toEqual({
24
+ segments: [
25
+ [
26
+ {
27
+ text: ' This',
28
+ startMs: 3000,
29
+ endMs: 6000,
30
+ confidence: 1,
31
+ timestampMs: 4500,
32
+ },
33
+ {
34
+ text: 'is',
35
+ startMs: 3000,
36
+ endMs: 6000,
37
+ confidence: 1,
38
+ timestampMs: 4500,
39
+ },
40
+ {
41
+ text: 'a',
42
+ startMs: 3000,
43
+ endMs: 6000,
44
+ confidence: 1,
45
+ timestampMs: 4500,
46
+ },
47
+ {
48
+ text: 'demonstration',
49
+ startMs: 3000,
50
+ endMs: 6000,
51
+ confidence: 1,
52
+ timestampMs: 4500,
53
+ },
54
+ {
55
+ text: 'of',
56
+ startMs: 3000,
57
+ endMs: 6000,
58
+ confidence: 1,
59
+ timestampMs: 4500,
60
+ },
61
+ {
62
+ text: 'SRT',
63
+ startMs: 3000,
64
+ endMs: 6000,
65
+ confidence: 1,
66
+ timestampMs: 4500,
67
+ },
68
+ {
69
+ text: 'subtitles.',
70
+ startMs: 3000,
71
+ endMs: 6000,
72
+ confidence: 1,
73
+ timestampMs: 4500,
74
+ },
75
+ {
76
+ text: ' You',
77
+ startMs: 7000,
78
+ endMs: 10500,
79
+ confidence: 1,
80
+ timestampMs: 8750,
81
+ },
82
+ ],
83
+ [
84
+ {
85
+ text: 'can',
86
+ startMs: 7000,
87
+ endMs: 10500,
88
+ confidence: 1,
89
+ timestampMs: 8750,
90
+ },
91
+ {
92
+ text: 'use',
93
+ startMs: 7000,
94
+ endMs: 10500,
95
+ confidence: 1,
96
+ timestampMs: 8750,
97
+ },
98
+ {
99
+ text: 'SRT',
100
+ startMs: 7000,
101
+ endMs: 10500,
102
+ confidence: 1,
103
+ timestampMs: 8750,
104
+ },
105
+ {
106
+ text: 'files',
107
+ startMs: 7000,
108
+ endMs: 10500,
109
+ confidence: 1,
110
+ timestampMs: 8750,
111
+ },
112
+ {
113
+ text: 'to',
114
+ startMs: 7000,
115
+ endMs: 10500,
116
+ confidence: 1,
117
+ timestampMs: 8750,
118
+ },
119
+ {
120
+ text: 'add',
121
+ startMs: 7000,
122
+ endMs: 10500,
123
+ confidence: 1,
124
+ timestampMs: 8750,
125
+ },
126
+ {
127
+ text: 'subtitles',
128
+ startMs: 7000,
129
+ endMs: 10500,
130
+ confidence: 1,
131
+ timestampMs: 8750,
132
+ },
133
+ ],
134
+ [
135
+ {
136
+ text: 'to',
137
+ startMs: 7000,
138
+ endMs: 10500,
139
+ confidence: 1,
140
+ timestampMs: 8750,
141
+ },
142
+ {
143
+ text: 'your',
144
+ startMs: 7000,
145
+ endMs: 10500,
146
+ confidence: 1,
147
+ timestampMs: 8750,
148
+ },
149
+ {
150
+ text: 'videos.',
151
+ startMs: 7000,
152
+ endMs: 10500,
153
+ confidence: 1,
154
+ timestampMs: 8750,
155
+ },
156
+ ],
157
+ ],
158
+ });
159
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const bun_test_1 = require("bun:test");
4
+ const parse_srt_1 = require("../parse-srt");
5
+ const serialize_srt_1 = require("../serialize-srt");
6
+ const input = `
7
+ 1
8
+ 00:00:00,000 --> 00:00:02,500
9
+ Welcome to the Example Subtitle File!
10
+
11
+ 2
12
+ 00:00:03,000 --> 00:00:06,000
13
+ This is a demonstration of SRT subtitles.
14
+
15
+ 3
16
+ 00:00:07,000 --> 00:00:10,500
17
+ You can use SRT files to add subtitles to your videos.
18
+
19
+ `.trim();
20
+ (0, bun_test_1.test)('Should create captions', () => {
21
+ const { captions } = (0, parse_srt_1.parseSrt)({ input });
22
+ (0, bun_test_1.expect)(captions).toEqual([
23
+ {
24
+ confidence: 1,
25
+ endMs: 2500,
26
+ startMs: 0,
27
+ text: 'Welcome to the Example Subtitle File!',
28
+ timestampMs: 1250,
29
+ },
30
+ {
31
+ confidence: 1,
32
+ endMs: 6000,
33
+ startMs: 3000,
34
+ text: 'This is a demonstration of SRT subtitles.',
35
+ timestampMs: 4500,
36
+ },
37
+ {
38
+ confidence: 1,
39
+ endMs: 10500,
40
+ startMs: 7000,
41
+ text: 'You can use SRT files to add subtitles to your videos.',
42
+ timestampMs: 8750,
43
+ },
44
+ ]);
45
+ const serialized = (0, serialize_srt_1.serializeSrt)({ lines: captions.map((c) => [c]) });
46
+ (0, bun_test_1.expect)(serialized).toEqual(input);
47
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const bun_test_1 = require("bun:test");
4
+ const create_tiktok_style_captions_1 = require("../create-tiktok-style-captions");
5
+ const captions = [
6
+ {
7
+ text: 'Using',
8
+ startMs: 40,
9
+ endMs: 300,
10
+ timestampMs: 200,
11
+ confidence: 0.948258,
12
+ },
13
+ {
14
+ text: " Remotion's",
15
+ startMs: 300,
16
+ endMs: 900,
17
+ timestampMs: 440,
18
+ confidence: 0.548411,
19
+ },
20
+ {
21
+ text: ' TikTok',
22
+ startMs: 900,
23
+ endMs: 1260,
24
+ timestampMs: 1080,
25
+ confidence: 0.953265,
26
+ },
27
+ {
28
+ text: ' template,',
29
+ startMs: 1260,
30
+ endMs: 1950,
31
+ timestampMs: 1600,
32
+ confidence: 0.968126,
33
+ },
34
+ ];
35
+ (0, bun_test_1.test)('Should create captions', () => {
36
+ const { pages: tikTokStyleCaptions } = (0, create_tiktok_style_captions_1.createTikTokStyleCaptions)({
37
+ captions,
38
+ combineTokensWithinMilliseconds: 500,
39
+ });
40
+ (0, bun_test_1.expect)(tikTokStyleCaptions).toEqual([
41
+ {
42
+ text: "Using Remotion's",
43
+ startMs: 40,
44
+ tokens: [
45
+ {
46
+ text: 'Using',
47
+ fromMs: 40,
48
+ toMs: 300,
49
+ },
50
+ {
51
+ text: " Remotion's",
52
+ fromMs: 300,
53
+ toMs: 900,
54
+ },
55
+ ],
56
+ },
57
+ {
58
+ text: 'TikTok template,',
59
+ startMs: 900,
60
+ tokens: [
61
+ {
62
+ text: 'TikTok',
63
+ fromMs: 900,
64
+ toMs: 1260,
65
+ },
66
+ {
67
+ text: ' template,',
68
+ fromMs: 1260,
69
+ toMs: 1950,
70
+ },
71
+ ],
72
+ },
73
+ ]);
74
+ });
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "repository": {
3
+ "url": "https://github.com/remotion-dev/remotion/tree/main/packages/captions"
4
+ },
5
+ "name": "@remotion/captions",
6
+ "version": "4.0.216",
7
+ "description": "Primitives for dealing with captions",
8
+ "main": "dist/index.js",
9
+ "sideEffects": false,
10
+ "bugs": {
11
+ "url": "https://github.com/remotion-dev/remotion/issues"
12
+ },
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "author": "Jonny Burger <jonny@remotion.dev>",
17
+ "license": "MIT",
18
+ "dependencies": {},
19
+ "peerDependencies": {},
20
+ "devDependencies": {},
21
+ "keywords": [
22
+ "remotion"
23
+ ],
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "homepage": "https://remotion.dev/docs/captions",
28
+ "scripts": {
29
+ "formatting": "prettier src --check",
30
+ "lint": "eslint src --ext ts,tsx",
31
+ "test": "bun test src"
32
+ }
33
+ }