@remotion/renderer 4.0.122 → 4.0.123

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.
Files changed (60) hide show
  1. package/dist/assets/get-audio-channels.d.ts +10 -2
  2. package/dist/assets/get-audio-channels.js +12 -4
  3. package/dist/calculate-ffmpeg-filters.d.ts +2 -1
  4. package/dist/calculate-ffmpeg-filters.js +14 -3
  5. package/dist/call-ffmpeg.d.ts +6 -2
  6. package/dist/call-ffmpeg.js +12 -4
  7. package/dist/can-use-parallel-encoding.js +2 -2
  8. package/dist/client.d.ts +252 -26
  9. package/dist/client.js +3 -3
  10. package/dist/codec-supports-media.js +5 -0
  11. package/dist/codec.d.ts +1 -1
  12. package/dist/codec.js +1 -0
  13. package/dist/combine-audio.d.ts +1 -1
  14. package/dist/combine-audio.js +1 -1
  15. package/dist/combine-videos.d.ts +8 -3
  16. package/dist/combine-videos.js +85 -61
  17. package/dist/compress-audio.d.ts +5 -2
  18. package/dist/compress-audio.js +22 -3
  19. package/dist/create-audio.d.ts +1 -1
  20. package/dist/create-audio.js +25 -5
  21. package/dist/create-silent-audio.d.ts +3 -1
  22. package/dist/create-silent-audio.js +2 -1
  23. package/dist/crf.js +7 -7
  24. package/dist/ffmpeg-args.js +1 -0
  25. package/dist/file-extensions.d.ts +2 -2
  26. package/dist/file-extensions.js +7 -0
  27. package/dist/get-codec-name.js +3 -3
  28. package/dist/get-extension-from-codec.d.ts +3 -3
  29. package/dist/get-extension-from-codec.js +1 -0
  30. package/dist/guess-extension-for-media.d.ts +3 -1
  31. package/dist/guess-extension-for-media.js +2 -1
  32. package/dist/index.d.ts +49 -21
  33. package/dist/index.js +4 -4
  34. package/dist/merge-audio-track.d.ts +5 -1
  35. package/dist/merge-audio-track.js +40 -3
  36. package/dist/options/audio-codec.d.ts +55 -0
  37. package/dist/options/audio-codec.js +190 -0
  38. package/dist/options/enforce-audio.d.ts +4 -1
  39. package/dist/options/enforce-audio.js +3 -3
  40. package/dist/options/for-seamless-aac-concatenation.js +1 -1
  41. package/dist/options/gl.d.ts +3 -3
  42. package/dist/options/index.d.ts +84 -9
  43. package/dist/options/index.js +8 -0
  44. package/dist/options/options-map.d.ts +137 -6
  45. package/dist/options/options-map.js +13 -0
  46. package/dist/options/separate-audio.d.ts +18 -0
  47. package/dist/options/separate-audio.js +28 -0
  48. package/dist/options/video-codec.d.ts +1 -1
  49. package/dist/preprocess-audio-track.d.ts +4 -0
  50. package/dist/preprocess-audio-track.js +28 -2
  51. package/dist/prespawn-ffmpeg.js +1 -3
  52. package/dist/pure.d.ts +4 -3
  53. package/dist/render-media.d.ts +1 -4
  54. package/dist/render-media.js +10 -5
  55. package/dist/stitch-frames-to-video.d.ts +6 -4
  56. package/dist/stitch-frames-to-video.js +36 -98
  57. package/dist/stringify-ffmpeg-filter.js +9 -8
  58. package/dist/validate-output-filename.d.ts +4 -3
  59. package/dist/validate-output-filename.js +10 -4
  60. package/package.json +9 -9
@@ -1,10 +1,18 @@
1
1
  import type { LogLevel } from '../log-level';
2
+ import type { CancelSignal } from '../make-cancel-signal';
2
3
  import type { AudioChannelsAndDurationResultCache, DownloadMap } from './download-map';
3
- export declare const getAudioChannelsAndDurationWithoutCache: (src: string, indent: boolean, logLevel: LogLevel, binariesDirectory: string | null) => Promise<AudioChannelsAndDurationResultCache>;
4
- export declare const getAudioChannelsAndDuration: ({ downloadMap, src, indent, logLevel, binariesDirectory, }: {
4
+ export declare const getAudioChannelsAndDurationWithoutCache: ({ src, indent, logLevel, binariesDirectory, cancelSignal, }: {
5
+ src: string;
6
+ indent: boolean;
7
+ logLevel: LogLevel;
8
+ binariesDirectory: string | null;
9
+ cancelSignal: CancelSignal | undefined;
10
+ }) => Promise<AudioChannelsAndDurationResultCache>;
11
+ export declare const getAudioChannelsAndDuration: ({ downloadMap, src, indent, logLevel, binariesDirectory, cancelSignal, }: {
5
12
  downloadMap: DownloadMap;
6
13
  src: string;
7
14
  indent: boolean;
8
15
  logLevel: LogLevel;
9
16
  binariesDirectory: string | null;
17
+ cancelSignal: CancelSignal | undefined;
10
18
  }) => Promise<AudioChannelsAndDurationResultCache>;
@@ -4,7 +4,7 @@ exports.getAudioChannelsAndDuration = exports.getAudioChannelsAndDurationWithout
4
4
  const call_ffmpeg_1 = require("../call-ffmpeg");
5
5
  const p_limit_1 = require("../p-limit");
6
6
  const limit = (0, p_limit_1.pLimit)(1);
7
- const getAudioChannelsAndDurationWithoutCache = async (src, indent, logLevel, binariesDirectory) => {
7
+ const getAudioChannelsAndDurationWithoutCache = async ({ src, indent, logLevel, binariesDirectory, cancelSignal, }) => {
8
8
  const args = [
9
9
  ['-v', 'error'],
10
10
  ['-show_entries', 'stream=channels:format=duration'],
@@ -19,6 +19,7 @@ const getAudioChannelsAndDurationWithoutCache = async (src, indent, logLevel, bi
19
19
  indent,
20
20
  logLevel,
21
21
  binariesDirectory,
22
+ cancelSignal,
22
23
  });
23
24
  const channels = task.stdout.match(/channels=([0-9]+)/);
24
25
  const duration = task.stdout.match(/duration=([0-9.]+)/);
@@ -29,21 +30,28 @@ const getAudioChannelsAndDurationWithoutCache = async (src, indent, logLevel, bi
29
30
  return result;
30
31
  };
31
32
  exports.getAudioChannelsAndDurationWithoutCache = getAudioChannelsAndDurationWithoutCache;
32
- async function getAudioChannelsAndDurationUnlimited({ downloadMap, src, indent, logLevel, binariesDirectory, }) {
33
+ async function getAudioChannelsAndDurationUnlimited({ downloadMap, src, indent, logLevel, binariesDirectory, cancelSignal, }) {
33
34
  if (downloadMap.durationOfAssetCache[src]) {
34
35
  return downloadMap.durationOfAssetCache[src];
35
36
  }
36
- const result = await (0, exports.getAudioChannelsAndDurationWithoutCache)(src, indent, logLevel, binariesDirectory);
37
+ const result = await (0, exports.getAudioChannelsAndDurationWithoutCache)({
38
+ src,
39
+ indent,
40
+ logLevel,
41
+ binariesDirectory,
42
+ cancelSignal,
43
+ });
37
44
  downloadMap.durationOfAssetCache[src] = result;
38
45
  return result;
39
46
  }
40
- const getAudioChannelsAndDuration = ({ downloadMap, src, indent, logLevel, binariesDirectory, }) => {
47
+ const getAudioChannelsAndDuration = ({ downloadMap, src, indent, logLevel, binariesDirectory, cancelSignal, }) => {
41
48
  return limit(() => getAudioChannelsAndDurationUnlimited({
42
49
  downloadMap,
43
50
  src,
44
51
  indent,
45
52
  logLevel,
46
53
  binariesDirectory,
54
+ cancelSignal,
47
55
  }));
48
56
  };
49
57
  exports.getAudioChannelsAndDuration = getAudioChannelsAndDuration;
@@ -1,9 +1,10 @@
1
1
  import type { MediaAsset } from './assets/types';
2
2
  import type { FilterWithoutPaddingApplied } from './stringify-ffmpeg-filter';
3
- export declare const calculateFfmpegFilter: ({ asset, fps, durationInFrames, channels, assetDuration, }: {
3
+ export declare const calculateFfmpegFilter: ({ asset, fps, durationInFrames, channels, assetDuration, forSeamlessAacConcatenation, }: {
4
4
  asset: MediaAsset;
5
5
  fps: number;
6
6
  durationInFrames: number;
7
7
  channels: number;
8
8
  assetDuration: number | null;
9
+ forSeamlessAacConcatenation: boolean;
9
10
  }) => FilterWithoutPaddingApplied | null;
@@ -2,13 +2,24 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.calculateFfmpegFilter = void 0;
4
4
  const flatten_volume_array_1 = require("./assets/flatten-volume-array");
5
+ const combine_audio_1 = require("./combine-audio");
6
+ const sample_rate_1 = require("./sample-rate");
5
7
  const stringify_ffmpeg_filter_1 = require("./stringify-ffmpeg-filter");
6
- const calculateFfmpegFilter = ({ asset, fps, durationInFrames, channels, assetDuration, }) => {
8
+ const calculateFfmpegFilter = ({ asset, fps, durationInFrames, channels, assetDuration, forSeamlessAacConcatenation, }) => {
7
9
  if (channels === 0) {
8
10
  return null;
9
11
  }
10
- const assetTrimLeft = (asset.trimLeft * asset.playbackRate) / fps;
11
- const assetTrimRight = assetTrimLeft + (asset.duration * asset.playbackRate) / fps;
12
+ const assetTrimLeft = forSeamlessAacConcatenation
13
+ ? Math.max(0, (0, combine_audio_1.getClosestAlignedTime)(((asset.trimLeft * asset.playbackRate) / fps) * 1000000) /
14
+ 1000000 -
15
+ 2 * (1024 / sample_rate_1.DEFAULT_SAMPLE_RATE))
16
+ : (asset.trimLeft * asset.playbackRate) / fps;
17
+ const assetTrimRight = forSeamlessAacConcatenation
18
+ ? (0, combine_audio_1.getClosestAlignedTime)(((asset.trimLeft + asset.duration * asset.playbackRate) / fps) *
19
+ 1000000) /
20
+ 1000000 +
21
+ 2 * (1024 / sample_rate_1.DEFAULT_SAMPLE_RATE)
22
+ : assetTrimLeft + (asset.duration * asset.playbackRate) / fps;
12
23
  return (0, stringify_ffmpeg_filter_1.stringifyFfmpegFilter)({
13
24
  channels,
14
25
  startInVideo: asset.startInVideo,
@@ -1,19 +1,23 @@
1
+ /// <reference types="node" />
1
2
  import execa from 'execa';
2
3
  import type { SpawnOptionsWithoutStdio } from 'node:child_process';
3
4
  import type { LogLevel } from './log-level';
4
- export declare const callFf: ({ args, bin, indent, logLevel, options, binariesDirectory, }: {
5
+ import type { CancelSignal } from './make-cancel-signal';
6
+ export declare const callFf: ({ args, bin, indent, logLevel, options, binariesDirectory, cancelSignal, }: {
5
7
  bin: 'ffmpeg' | 'ffprobe';
6
8
  args: (string | null)[];
7
9
  indent: boolean;
8
10
  logLevel: LogLevel;
9
11
  binariesDirectory: string | null;
12
+ cancelSignal: CancelSignal | undefined;
10
13
  options?: execa.Options<string> | undefined;
11
14
  }) => execa.ExecaChildProcess<string>;
12
- export declare const callFfNative: ({ args, bin, indent, logLevel, options, binariesDirectory, }: {
15
+ export declare const callFfNative: ({ args, bin, indent, logLevel, options, binariesDirectory, cancelSignal, }: {
13
16
  bin: 'ffmpeg' | 'ffprobe';
14
17
  args: (string | null)[];
15
18
  indent: boolean;
16
19
  logLevel: LogLevel;
17
20
  binariesDirectory: string | null;
21
+ cancelSignal: CancelSignal | undefined;
18
22
  options?: SpawnOptionsWithoutStdio | undefined;
19
23
  }) => import("child_process").ChildProcessWithoutNullStreams;
@@ -10,7 +10,7 @@ const path_1 = __importDefault(require("path"));
10
10
  const get_executable_path_1 = require("./compositor/get-executable-path");
11
11
  const make_file_executable_1 = require("./compositor/make-file-executable");
12
12
  const truthy_1 = require("./truthy");
13
- const callFf = ({ args, bin, indent, logLevel, options, binariesDirectory, }) => {
13
+ const callFf = ({ args, bin, indent, logLevel, options, binariesDirectory, cancelSignal, }) => {
14
14
  const executablePath = (0, get_executable_path_1.getExecutablePath)({
15
15
  type: bin,
16
16
  indent,
@@ -18,13 +18,17 @@ const callFf = ({ args, bin, indent, logLevel, options, binariesDirectory, }) =>
18
18
  binariesDirectory,
19
19
  });
20
20
  (0, make_file_executable_1.makeFileExecutableIfItIsNot)(executablePath);
21
- return (0, execa_1.default)(executablePath, args.filter(truthy_1.truthy), {
21
+ const task = (0, execa_1.default)(executablePath, args.filter(truthy_1.truthy), {
22
22
  cwd: path_1.default.dirname(executablePath),
23
23
  ...options,
24
24
  });
25
+ cancelSignal === null || cancelSignal === void 0 ? void 0 : cancelSignal(() => {
26
+ task.kill();
27
+ });
28
+ return task;
25
29
  };
26
30
  exports.callFf = callFf;
27
- const callFfNative = ({ args, bin, indent, logLevel, options, binariesDirectory, }) => {
31
+ const callFfNative = ({ args, bin, indent, logLevel, options, binariesDirectory, cancelSignal, }) => {
28
32
  const executablePath = (0, get_executable_path_1.getExecutablePath)({
29
33
  type: bin,
30
34
  indent,
@@ -32,9 +36,13 @@ const callFfNative = ({ args, bin, indent, logLevel, options, binariesDirectory,
32
36
  binariesDirectory,
33
37
  });
34
38
  (0, make_file_executable_1.makeFileExecutableIfItIsNot)(executablePath);
35
- return (0, node_child_process_1.spawn)(executablePath, args.filter(truthy_1.truthy), {
39
+ const task = (0, node_child_process_1.spawn)(executablePath, args.filter(truthy_1.truthy), {
36
40
  cwd: path_1.default.dirname(executablePath),
37
41
  ...options,
38
42
  });
43
+ cancelSignal === null || cancelSignal === void 0 ? void 0 : cancelSignal(() => {
44
+ task.kill();
45
+ });
46
+ return task;
39
47
  };
40
48
  exports.callFfNative = callFfNative;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.canUseParallelEncoding = void 0;
4
- const is_audio_codec_1 = require("./is-audio-codec");
4
+ const audio_codec_1 = require("./options/audio-codec");
5
5
  const canUseParallelEncoding = (codec) => {
6
- if ((0, is_audio_codec_1.isAudioCodec)(codec)) {
6
+ if ((0, audio_codec_1.isAudioCodec)(codec)) {
7
7
  return false;
8
8
  }
9
9
  return codec === 'h264' || codec === 'h264-mkv' || codec === 'h265';
package/dist/client.d.ts CHANGED
@@ -1,16 +1,16 @@
1
1
  export { AvailableOptions, TypeOfOption } from './options';
2
2
  export declare const BrowserSafeApis: {
3
- getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">(codec: T, audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null) => import("./file-extensions").FileExtension;
4
- validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "gif"];
3
+ getFileExtensionFromCodec: <T extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif">(codec: T, audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null) => import("./file-extensions").FileExtension;
4
+ validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "h264-ts", "gif"];
5
5
  validAudioCodecs: readonly ["pcm-16", "aac", "mp3", "opus"];
6
- getDefaultCrfForCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => number;
7
- getValidCrfRanges: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => [number, number];
8
- isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | null | undefined) => boolean;
6
+ getDefaultCrfForCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif") => number;
7
+ getValidCrfRanges: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif") => [number, number];
8
+ isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null | undefined) => boolean;
9
9
  proResProfileOptions: readonly ["4444-xq", "4444", "hq", "standard", "light", "proxy"];
10
10
  x264PresetOptions: readonly ["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow", "placebo"];
11
11
  validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
12
12
  validOpenGlRenderers: readonly ["swangle", "angle", "egl", "swiftshader", "vulkan", "angle-egl"];
13
- validPixelFormatsForCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"] | ("yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le")[];
13
+ validPixelFormatsForCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif") => readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"] | ("yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le")[];
14
14
  validVideoImageFormats: readonly ["png", "jpeg", "none"];
15
15
  validStillImageFormats: readonly ["png", "jpeg", "pdf", "webp"];
16
16
  DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
@@ -18,6 +18,7 @@ export declare const BrowserSafeApis: {
18
18
  supportedAudioCodecs: {
19
19
  readonly h264: readonly ["aac", "pcm-16", "mp3"];
20
20
  readonly 'h264-mkv': readonly ["pcm-16", "mp3"];
21
+ readonly 'h264-ts': readonly ["pcm-16", "aac"];
21
22
  readonly aac: readonly ["aac", "pcm-16"];
22
23
  readonly gif: readonly [];
23
24
  readonly h265: readonly ["aac", "pcm-16"];
@@ -145,6 +146,19 @@ export declare const BrowserSafeApis: {
145
146
  };
146
147
  };
147
148
  };
149
+ "h264-ts": {
150
+ default: import("./file-extensions").FileExtension;
151
+ forAudioCodec: {
152
+ aac: {
153
+ possible: import("./file-extensions").FileExtension[];
154
+ default: import("./file-extensions").FileExtension;
155
+ };
156
+ "pcm-16": {
157
+ possible: import("./file-extensions").FileExtension[];
158
+ default: import("./file-extensions").FileExtension;
159
+ };
160
+ };
161
+ };
148
162
  gif: {
149
163
  default: import("./file-extensions").FileExtension;
150
164
  forAudioCodec: {};
@@ -187,19 +201,42 @@ export declare const BrowserSafeApis: {
187
201
  compressed: "mp3" | "pcm-16" | null;
188
202
  lossless: "mp3" | "pcm-16" | null;
189
203
  };
204
+ "h264-ts": {
205
+ compressed: "aac" | "pcm-16" | null;
206
+ lossless: "aac" | "pcm-16" | null;
207
+ };
190
208
  gif: {
191
209
  compressed: null;
192
210
  lossless: null;
193
211
  };
194
212
  };
195
- defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">;
196
- validateOutputFilename: <T_1 extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">({ codec, audioCodec, extension, preferLossless, }: {
213
+ defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif">;
214
+ validateOutputFilename: <T_1 extends "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif">({ codec, audioCodecSetting, extension, preferLossless, separateAudioTo, }: {
197
215
  codec: T_1;
198
- audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null;
216
+ audioCodecSetting: "mp3" | "aac" | "pcm-16" | "opus" | null;
199
217
  extension: string;
200
218
  preferLossless: boolean;
219
+ separateAudioTo: string | null;
201
220
  }) => void;
202
221
  options: {
222
+ audioCodecOption: {
223
+ cliFlag: "audio-codec";
224
+ setConfig: (audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null) => void;
225
+ getValue: ({ commandLine }: {
226
+ commandLine: Record<string, unknown>;
227
+ }) => {
228
+ source: string;
229
+ value: "mp3" | "aac" | "pcm-16" | "opus";
230
+ } | {
231
+ source: string;
232
+ value: null;
233
+ };
234
+ description: () => string;
235
+ docLink: string;
236
+ name: string;
237
+ ssrName: "audioCodec";
238
+ type: "mp3" | "aac" | "pcm-16" | "opus";
239
+ };
203
240
  scaleOption: {
204
241
  name: string;
205
242
  cliFlag: "scale";
@@ -289,7 +326,10 @@ export declare const BrowserSafeApis: {
289
326
  commandLine: Record<string, unknown>;
290
327
  }) => {
291
328
  source: string;
292
- value: boolean;
329
+ value: true;
330
+ } | {
331
+ source: string;
332
+ value: false;
293
333
  };
294
334
  setConfig: (value: boolean) => void;
295
335
  };
@@ -314,17 +354,17 @@ export declare const BrowserSafeApis: {
314
354
  description: () => import("react/jsx-runtime").JSX.Element;
315
355
  ssrName: string;
316
356
  docLink: string;
317
- type: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
357
+ type: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
318
358
  getValue: ({ commandLine }: {
319
359
  commandLine: Record<string, unknown>;
320
360
  }, { compositionCodec, configFile, downloadName, outName, uiCodec, }: {
321
361
  outName: string | null;
322
362
  downloadName: string | null;
323
- configFile: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | null;
324
- uiCodec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | null;
325
- compositionCodec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | null;
363
+ configFile: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null;
364
+ uiCodec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null;
365
+ compositionCodec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null;
326
366
  }) => {
327
- value: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
367
+ value: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
328
368
  source: string;
329
369
  };
330
370
  setConfig: (newCodec: import("./codec").CodecOrUndefined) => void;
@@ -424,19 +464,19 @@ export declare const BrowserSafeApis: {
424
464
  cliFlag: "gl";
425
465
  docLink: string;
426
466
  name: string;
427
- type: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
467
+ type: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
428
468
  ssrName: string;
429
469
  description: () => import("react/jsx-runtime").JSX.Element;
430
470
  getValue: ({ commandLine }: {
431
471
  commandLine: Record<string, unknown>;
432
472
  }) => {
433
- value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
473
+ value: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
434
474
  source: string;
435
475
  } | {
436
476
  value: null;
437
477
  source: string;
438
478
  };
439
- setConfig: (value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => void;
479
+ setConfig: (value: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => void;
440
480
  };
441
481
  enableLambdaInsights: {
442
482
  name: string;
@@ -537,6 +577,24 @@ export declare const BrowserSafeApis: {
537
577
  };
538
578
  setConfig: (should: boolean) => void;
539
579
  };
580
+ preferLosslessOption: {
581
+ name: string;
582
+ cliFlag: "prefer-lossless";
583
+ description: () => import("react/jsx-runtime").JSX.Element;
584
+ docLink: string;
585
+ type: boolean;
586
+ ssrName: "preferLossless";
587
+ getValue: ({ commandLine }: {
588
+ commandLine: Record<string, unknown>;
589
+ }) => {
590
+ value: true;
591
+ source: string;
592
+ } | {
593
+ value: false;
594
+ source: string;
595
+ };
596
+ setConfig: (val: boolean) => void;
597
+ };
540
598
  x264Option: {
541
599
  name: string;
542
600
  cliFlag: "x264-preset";
@@ -630,6 +688,42 @@ export declare const BrowserSafeApis: {
630
688
  };
631
689
  setConfig: (value: string | null) => void;
632
690
  };
691
+ forSeamlessAacConcatenationOption: {
692
+ name: string;
693
+ cliFlag: "for-seamless-aac-concatenation";
694
+ description: () => import("react/jsx-runtime").JSX.Element;
695
+ docLink: string;
696
+ getValue: ({ commandLine }: {
697
+ commandLine: Record<string, unknown>;
698
+ }) => {
699
+ source: string;
700
+ value: true;
701
+ } | {
702
+ source: string;
703
+ value: false;
704
+ };
705
+ setConfig: (value: boolean) => void;
706
+ ssrName: string;
707
+ type: boolean;
708
+ };
709
+ separateAudioOption: {
710
+ cliFlag: string;
711
+ description: () => string;
712
+ docLink: string;
713
+ getValue: ({ commandLine }: {
714
+ commandLine: Record<string, unknown>;
715
+ }) => {
716
+ source: string;
717
+ value: string;
718
+ } | {
719
+ source: string;
720
+ value: null;
721
+ };
722
+ name: string;
723
+ setConfig: () => never;
724
+ ssrName: string;
725
+ type: string | null;
726
+ };
633
727
  };
634
728
  validColorSpaces: readonly ["default", "bt709", "bt2020-ncl"];
635
729
  optionsMap: {
@@ -757,17 +851,17 @@ export declare const BrowserSafeApis: {
757
851
  description: () => import("react/jsx-runtime").JSX.Element;
758
852
  ssrName: string;
759
853
  docLink: string;
760
- type: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
854
+ type: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
761
855
  getValue: ({ commandLine }: {
762
856
  commandLine: Record<string, unknown>;
763
857
  }, { compositionCodec, configFile, downloadName, outName, uiCodec, }: {
764
858
  outName: string | null;
765
859
  downloadName: string | null;
766
- configFile: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | null;
767
- uiCodec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | null;
768
- compositionCodec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | null;
860
+ configFile: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null;
861
+ uiCodec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null;
862
+ compositionCodec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif" | null;
769
863
  }) => {
770
- value: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
864
+ value: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
771
865
  source: string;
772
866
  };
773
867
  setConfig: (newCodec: import("./codec").CodecOrUndefined) => void;
@@ -883,6 +977,98 @@ export declare const BrowserSafeApis: {
883
977
  };
884
978
  setConfig: (value: string | null) => void;
885
979
  };
980
+ readonly forSeamlessAacConcatenation: {
981
+ name: string;
982
+ cliFlag: "for-seamless-aac-concatenation";
983
+ description: () => import("react/jsx-runtime").JSX.Element;
984
+ docLink: string;
985
+ getValue: ({ commandLine }: {
986
+ commandLine: Record<string, unknown>;
987
+ }) => {
988
+ source: string;
989
+ value: true;
990
+ } | {
991
+ source: string;
992
+ value: false;
993
+ };
994
+ setConfig: (value: boolean) => void;
995
+ ssrName: string;
996
+ type: boolean;
997
+ };
998
+ readonly separateAudioTo: {
999
+ cliFlag: string;
1000
+ description: () => string;
1001
+ docLink: string;
1002
+ getValue: ({ commandLine }: {
1003
+ commandLine: Record<string, unknown>;
1004
+ }) => {
1005
+ source: string;
1006
+ value: string;
1007
+ } | {
1008
+ source: string;
1009
+ value: null;
1010
+ };
1011
+ name: string;
1012
+ setConfig: () => never;
1013
+ ssrName: string;
1014
+ type: string | null;
1015
+ };
1016
+ readonly audioCodec: {
1017
+ cliFlag: "audio-codec";
1018
+ setConfig: (audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null) => void;
1019
+ getValue: ({ commandLine }: {
1020
+ commandLine: Record<string, unknown>;
1021
+ }) => {
1022
+ source: string;
1023
+ value: "mp3" | "aac" | "pcm-16" | "opus";
1024
+ } | {
1025
+ source: string;
1026
+ value: null;
1027
+ };
1028
+ description: () => string;
1029
+ docLink: string;
1030
+ name: string;
1031
+ ssrName: "audioCodec";
1032
+ type: "mp3" | "aac" | "pcm-16" | "opus";
1033
+ };
1034
+ };
1035
+ readonly stitchFramesToVideo: {
1036
+ readonly forSeamlessAacConcatenation: {
1037
+ name: string;
1038
+ cliFlag: "for-seamless-aac-concatenation";
1039
+ description: () => import("react/jsx-runtime").JSX.Element;
1040
+ docLink: string;
1041
+ getValue: ({ commandLine }: {
1042
+ commandLine: Record<string, unknown>;
1043
+ }) => {
1044
+ source: string;
1045
+ value: true;
1046
+ } | {
1047
+ source: string;
1048
+ value: false;
1049
+ };
1050
+ setConfig: (value: boolean) => void;
1051
+ ssrName: string;
1052
+ type: boolean;
1053
+ };
1054
+ readonly separateAudioTo: {
1055
+ cliFlag: string;
1056
+ description: () => string;
1057
+ docLink: string;
1058
+ getValue: ({ commandLine }: {
1059
+ commandLine: Record<string, unknown>;
1060
+ }) => {
1061
+ source: string;
1062
+ value: string;
1063
+ } | {
1064
+ source: string;
1065
+ value: null;
1066
+ };
1067
+ name: string;
1068
+ setConfig: () => never;
1069
+ ssrName: string;
1070
+ type: string | null;
1071
+ };
886
1072
  };
887
1073
  readonly renderStill: {
888
1074
  readonly offthreadVideoCacheSizeInBytes: {
@@ -1226,6 +1412,24 @@ export declare const BrowserSafeApis: {
1226
1412
  };
1227
1413
  setConfig: (newLoop: import(".").NumberOfGifLoops) => void;
1228
1414
  };
1415
+ readonly preferLossless: {
1416
+ name: string;
1417
+ cliFlag: "prefer-lossless";
1418
+ description: () => import("react/jsx-runtime").JSX.Element;
1419
+ docLink: string;
1420
+ type: boolean;
1421
+ ssrName: "preferLossless";
1422
+ getValue: ({ commandLine }: {
1423
+ commandLine: Record<string, unknown>;
1424
+ }) => {
1425
+ value: true;
1426
+ source: string;
1427
+ } | {
1428
+ value: false;
1429
+ source: string;
1430
+ };
1431
+ setConfig: (val: boolean) => void;
1432
+ };
1229
1433
  readonly audioBitrate: {
1230
1434
  name: string;
1231
1435
  cliFlag: "audio-bitrate";
@@ -1562,6 +1766,24 @@ export declare const BrowserSafeApis: {
1562
1766
  };
1563
1767
  setConfig: (newLoop: import(".").NumberOfGifLoops) => void;
1564
1768
  };
1769
+ readonly preferLossless: {
1770
+ name: string;
1771
+ cliFlag: "prefer-lossless";
1772
+ description: () => import("react/jsx-runtime").JSX.Element;
1773
+ docLink: string;
1774
+ type: boolean;
1775
+ ssrName: "preferLossless";
1776
+ getValue: ({ commandLine }: {
1777
+ commandLine: Record<string, unknown>;
1778
+ }) => {
1779
+ value: true;
1780
+ source: string;
1781
+ } | {
1782
+ value: false;
1783
+ source: string;
1784
+ };
1785
+ setConfig: (val: boolean) => void;
1786
+ };
1565
1787
  readonly colorSpace: {
1566
1788
  name: string;
1567
1789
  cliFlag: "color-space";
@@ -1720,7 +1942,10 @@ export declare const BrowserSafeApis: {
1720
1942
  commandLine: Record<string, unknown>;
1721
1943
  }) => {
1722
1944
  source: string;
1723
- value: boolean;
1945
+ value: true;
1946
+ } | {
1947
+ source: string;
1948
+ value: false;
1724
1949
  };
1725
1950
  setConfig: (value: boolean) => void;
1726
1951
  };
@@ -1851,8 +2076,9 @@ export declare const BrowserSafeApis: {
1851
2076
  };
1852
2077
  };
1853
2078
  };
1854
- codecSupportsCrf: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => boolean;
1855
- codecSupportsVideoBitrate: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => boolean;
2079
+ codecSupportsCrf: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif") => boolean;
2080
+ codecSupportsVideoBitrate: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif") => boolean;
1856
2081
  logLevels: readonly ["verbose", "info", "warn", "error"];
1857
2082
  getOutputCodecOrUndefined: () => import("./codec").CodecOrUndefined;
2083
+ getExtensionFromAudioCodec: (audioCodec: "mp3" | "aac" | "pcm-16" | "opus") => "mp3" | "aac" | "wav" | "opus";
1858
2084
  };
package/dist/client.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BrowserSafeApis = void 0;
4
- const audio_codec_1 = require("./audio-codec");
5
4
  const TimeoutSettings_1 = require("./browser/TimeoutSettings");
6
5
  const codec_1 = require("./codec");
7
6
  const codec_supports_media_1 = require("./codec-supports-media");
@@ -9,9 +8,9 @@ const crf_1 = require("./crf");
9
8
  const file_extensions_1 = require("./file-extensions");
10
9
  const get_extension_from_codec_1 = require("./get-extension-from-codec");
11
10
  const image_format_1 = require("./image-format");
12
- const is_audio_codec_1 = require("./is-audio-codec");
13
11
  const log_level_1 = require("./log-level");
14
12
  const options_1 = require("./options");
13
+ const audio_codec_1 = require("./options/audio-codec");
15
14
  const color_space_1 = require("./options/color-space");
16
15
  const gl_1 = require("./options/gl");
17
16
  const options_map_1 = require("./options/options-map");
@@ -26,7 +25,7 @@ exports.BrowserSafeApis = {
26
25
  validAudioCodecs: audio_codec_1.validAudioCodecs,
27
26
  getDefaultCrfForCodec: crf_1.getDefaultCrfForCodec,
28
27
  getValidCrfRanges: crf_1.getValidCrfRanges,
29
- isAudioCodec: is_audio_codec_1.isAudioCodec,
28
+ isAudioCodec: audio_codec_1.isAudioCodec,
30
29
  proResProfileOptions: prores_profile_1.proResProfileOptions,
31
30
  x264PresetOptions: x264_preset_1.x264PresetOptions,
32
31
  validPixelFormats: pixel_format_1.validPixelFormats,
@@ -48,4 +47,5 @@ exports.BrowserSafeApis = {
48
47
  codecSupportsVideoBitrate: codec_supports_media_1.codecSupportsVideoBitrate,
49
48
  logLevels: log_level_1.logLevels,
50
49
  getOutputCodecOrUndefined: video_codec_1.getOutputCodecOrUndefined,
50
+ getExtensionFromAudioCodec: audio_codec_1.getExtensionFromAudioCodec,
51
51
  };