@remotion/studio 4.0.439 → 4.0.440

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.
@@ -1,5 +1,5 @@
1
1
  import type { AvailableOptions } from '@remotion/renderer/client';
2
- export declare const useCrfState: (codec: "aac" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav") => {
2
+ export declare const useCrfState: (codec: "aac" | "av1" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav") => {
3
3
  crf: number | null;
4
4
  setCrf: import("react").Dispatch<import("react").SetStateAction<number>>;
5
5
  minCrf: number;
@@ -1,13 +1,13 @@
1
1
  import type { RenderType } from './RenderModalAdvanced';
2
2
  export declare const getDefaultCodecs: ({ defaultConfigurationVideoCodec, compositionDefaultVideoCodec, renderType, defaultConfigurationAudioCodec, }: {
3
- defaultConfigurationVideoCodec: "aac" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav" | null;
3
+ defaultConfigurationVideoCodec: "aac" | "av1" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav" | null;
4
4
  defaultConfigurationAudioCodec: "aac" | "mp3" | "opus" | "pcm-16" | null;
5
- compositionDefaultVideoCodec: "aac" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav" | null;
5
+ compositionDefaultVideoCodec: "aac" | "av1" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav" | null;
6
6
  renderType: RenderType;
7
7
  }) => {
8
8
  initialAudioCodec: "aac" | "mp3" | "opus" | "pcm-16" | null;
9
- initialVideoCodec: "aac" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav";
9
+ initialVideoCodec: "aac" | "av1" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav";
10
10
  initialRenderType: RenderType;
11
- initialVideoCodecForAudioTab: "aac" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav";
12
- initialVideoCodecForVideoTab: "aac" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav";
11
+ initialVideoCodecForAudioTab: "aac" | "av1" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav";
12
+ initialVideoCodecForVideoTab: "aac" | "av1" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav";
13
13
  };
@@ -1 +1 @@
1
- export declare const humanReadableCodec: (codec: "aac" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav") => "AAC" | "GIF" | "H.264" | "H.264 (Matroska)" | "H.264 (Transport Stream)" | "H.265" | "MP3" | "ProRes" | "VP8" | "VP9" | "Waveform";
1
+ export declare const humanReadableCodec: (codec: "aac" | "av1" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav") => "AAC" | "AV1" | "GIF" | "H.264" | "H.264 (Matroska)" | "H.264 (Transport Stream)" | "H.265" | "MP3" | "ProRes" | "VP8" | "VP9" | "Waveform";
@@ -23,6 +23,9 @@ const humanReadableCodec = (codec) => {
23
23
  if (codec === 'h265') {
24
24
  return 'H.265';
25
25
  }
26
+ if (codec === 'av1') {
27
+ return 'AV1';
28
+ }
26
29
  if (codec === 'prores') {
27
30
  return 'ProRes';
28
31
  }
@@ -1,7 +1,7 @@
1
1
  import type { RenderType } from './RenderModalAdvanced';
2
2
  export declare const validateOutnameGui: ({ outName, codec, audioCodec, renderMode, stillImageFormat, separateAudioTo, }: {
3
3
  outName: string;
4
- codec: "aac" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav";
4
+ codec: "aac" | "av1" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav";
5
5
  audioCodec: "aac" | "mp3" | "opus" | "pcm-16";
6
6
  renderMode: RenderType;
7
7
  stillImageFormat: "jpeg" | "pdf" | "png" | "webp" | null;
@@ -50,7 +50,7 @@ export declare const addVideoRenderJob: ({ compositionId, outName, imageFormat,
50
50
  jpegQuality: number | null;
51
51
  scale: number;
52
52
  logLevel: "error" | "info" | "trace" | "verbose" | "warn";
53
- codec: "aac" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav";
53
+ codec: "aac" | "av1" | "gif" | "h264" | "h264-mkv" | "h264-ts" | "h265" | "mp3" | "prores" | "vp8" | "vp9" | "wav";
54
54
  concurrency: number;
55
55
  crf: number | null;
56
56
  startFrame: number;
@@ -100,7 +100,7 @@ const TimelineInner = () => {
100
100
  var _a;
101
101
  const isExpanded = visualModeEnabled && ((_a = expandedTracks[track.sequence.id]) !== null && _a !== void 0 ? _a : false);
102
102
  return (acc +
103
- (0, timeline_layout_1.getTimelineLayerHeight)(track.sequence.type === 'video' ? 'video' : 'other') +
103
+ (0, timeline_layout_1.getTimelineLayerHeight)(track.sequence.type) +
104
104
  Number(timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM) +
105
105
  (isExpanded
106
106
  ? (0, timeline_layout_1.getExpandedTrackHeight)(track.sequence.controls) +
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export declare const TimelineImageInfo: React.FC<{
3
+ readonly src: string;
4
+ readonly visualizationWidth: number;
5
+ }>;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TimelineImageInfo = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const timeline_layout_1 = require("../../helpers/timeline-layout");
7
+ const HEIGHT = (0, timeline_layout_1.getTimelineLayerHeight)('image') - 2;
8
+ const containerStyle = {
9
+ height: HEIGHT,
10
+ width: '100%',
11
+ backgroundColor: 'rgba(0, 0, 0, 0.3)',
12
+ display: 'flex',
13
+ borderTopLeftRadius: 2,
14
+ borderBottomLeftRadius: 2,
15
+ };
16
+ const TimelineImageInfo = ({ src, visualizationWidth }) => {
17
+ const ref = (0, react_1.useRef)(null);
18
+ (0, react_1.useEffect)(() => {
19
+ const { current } = ref;
20
+ if (!current) {
21
+ return;
22
+ }
23
+ const canvas = document.createElement('canvas');
24
+ canvas.width = visualizationWidth * window.devicePixelRatio;
25
+ canvas.height = HEIGHT * window.devicePixelRatio;
26
+ canvas.style.width = visualizationWidth + 'px';
27
+ canvas.style.height = HEIGHT + 'px';
28
+ const ctx = canvas.getContext('2d');
29
+ if (!ctx) {
30
+ return;
31
+ }
32
+ current.appendChild(canvas);
33
+ const img = new Image();
34
+ img.crossOrigin = 'anonymous';
35
+ img.onload = () => {
36
+ const scale = (HEIGHT * window.devicePixelRatio) / img.naturalHeight;
37
+ const scaledWidth = img.naturalWidth * scale;
38
+ const scaledHeight = HEIGHT * window.devicePixelRatio;
39
+ const offscreen = document.createElement('canvas');
40
+ offscreen.width = scaledWidth;
41
+ offscreen.height = scaledHeight;
42
+ const offCtx = offscreen.getContext('2d');
43
+ if (!offCtx) {
44
+ return;
45
+ }
46
+ offCtx.drawImage(img, 0, 0, scaledWidth, scaledHeight);
47
+ const pattern = ctx.createPattern(offscreen, 'repeat-x');
48
+ if (!pattern) {
49
+ return;
50
+ }
51
+ ctx.fillStyle = pattern;
52
+ ctx.fillRect(0, 0, visualizationWidth * window.devicePixelRatio, HEIGHT * window.devicePixelRatio);
53
+ };
54
+ img.src = src;
55
+ return () => {
56
+ current.removeChild(canvas);
57
+ };
58
+ }, [src, visualizationWidth]);
59
+ return jsx_runtime_1.jsx("div", { ref: ref, style: containerStyle });
60
+ };
61
+ exports.TimelineImageInfo = TimelineImageInfo;
@@ -69,8 +69,7 @@ const TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
69
69
  }, [sequence.id, setHidden]);
70
70
  const outer = (0, react_1.useMemo)(() => {
71
71
  return {
72
- height: (0, timeline_layout_1.getTimelineLayerHeight)(sequence.type === 'video' ? 'video' : 'other') +
73
- timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM,
72
+ height: (0, timeline_layout_1.getTimelineLayerHeight)(sequence.type) + timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM,
74
73
  color: 'white',
75
74
  fontFamily: 'Arial, Helvetica, sans-serif',
76
75
  display: 'flex',
@@ -10,11 +10,13 @@ const timeline_layout_1 = require("../../helpers/timeline-layout");
10
10
  const use_max_media_duration_1 = require("../../helpers/use-max-media-duration");
11
11
  const AudioWaveform_1 = require("../AudioWaveform");
12
12
  const LoopedTimelineIndicators_1 = require("./LoopedTimelineIndicators");
13
+ const TimelineImageInfo_1 = require("./TimelineImageInfo");
13
14
  const TimelineSequenceFrame_1 = require("./TimelineSequenceFrame");
14
15
  const TimelineVideoInfo_1 = require("./TimelineVideoInfo");
15
16
  const TimelineWidthProvider_1 = require("./TimelineWidthProvider");
16
17
  const AUDIO_GRADIENT = 'linear-gradient(rgb(16 171 58), rgb(43 165 63) 60%)';
17
18
  const VIDEO_GRADIENT = 'linear-gradient(to top, #8e44ad, #9b59b6)';
19
+ const IMAGE_GRADIENT = 'linear-gradient(to top, #2980b9, #3498db)';
18
20
  const TimelineSequence = ({ s }) => {
19
21
  const windowWidth = (0, react_1.useContext)(TimelineWidthProvider_1.TimelineWidthContext);
20
22
  if (windowWidth === null) {
@@ -51,7 +53,7 @@ const Inner = ({ s, windowWidth }) => {
51
53
  ? s.loopDisplay.durationInFrames * s.loopDisplay.numberOfTimes
52
54
  : s.duration,
53
55
  startFrom: s.loopDisplay ? s.from + s.loopDisplay.startOffset : s.from,
54
- startFromMedia: s.type === 'sequence' ? 0 : s.startMediaFrom,
56
+ startFromMedia: s.type === 'sequence' || s.type === 'image' ? 0 : s.startMediaFrom,
55
57
  maxMediaDuration,
56
58
  video,
57
59
  windowWidth,
@@ -65,11 +67,13 @@ const Inner = ({ s, windowWidth }) => {
65
67
  ? AUDIO_GRADIENT
66
68
  : s.type === 'video'
67
69
  ? VIDEO_GRADIENT
68
- : colors_1.BLUE,
70
+ : s.type === 'image'
71
+ ? IMAGE_GRADIENT
72
+ : colors_1.BLUE,
69
73
  border: get_timeline_sequence_layout_1.SEQUENCE_BORDER_WIDTH + 'px solid rgba(255, 255, 255, 0.2)',
70
74
  borderRadius: 2,
71
75
  position: 'absolute',
72
- height: (0, timeline_layout_1.getTimelineLayerHeight)(s.type === 'video' ? 'video' : 'other'),
76
+ height: (0, timeline_layout_1.getTimelineLayerHeight)(s.type),
73
77
  marginLeft,
74
78
  width,
75
79
  color: 'white',
@@ -103,8 +107,9 @@ const Inner = ({ s, windowWidth }) => {
103
107
  )`,
104
108
  position: 'absolute',
105
109
  right: 0,
106
- } })) : null, s.type === 'audio' ? (jsx_runtime_1.jsx(AudioWaveform_1.AudioWaveform, { src: s.src, doesVolumeChange: s.doesVolumeChange, visualizationWidth: width, startFrom: s.startMediaFrom, durationInFrames: s.duration, volume: s.volume, playbackRate: s.playbackRate })) : null, s.type === 'video' ? (jsx_runtime_1.jsx(TimelineVideoInfo_1.TimelineVideoInfo, { src: s.src, visualizationWidth: width, naturalWidth: naturalWidth, trimBefore: s.startMediaFrom, durationInFrames: s.duration, playbackRate: s.playbackRate })) : null, s.loopDisplay === undefined ? null : (jsx_runtime_1.jsx(LoopedTimelineIndicators_1.LoopedTimelineIndicator, { loops: s.loopDisplay.numberOfTimes })), s.type !== 'audio' &&
110
+ } })) : null, s.type === 'audio' ? (jsx_runtime_1.jsx(AudioWaveform_1.AudioWaveform, { src: s.src, doesVolumeChange: s.doesVolumeChange, visualizationWidth: width, startFrom: s.startMediaFrom, durationInFrames: s.duration, volume: s.volume, playbackRate: s.playbackRate })) : null, s.type === 'video' ? (jsx_runtime_1.jsx(TimelineVideoInfo_1.TimelineVideoInfo, { src: s.src, visualizationWidth: width, naturalWidth: naturalWidth, trimBefore: s.startMediaFrom, durationInFrames: s.duration, playbackRate: s.playbackRate })) : null, s.type === 'image' ? (jsx_runtime_1.jsx(TimelineImageInfo_1.TimelineImageInfo, { src: s.src, visualizationWidth: width })) : null, s.loopDisplay === undefined ? null : (jsx_runtime_1.jsx(LoopedTimelineIndicators_1.LoopedTimelineIndicator, { loops: s.loopDisplay.numberOfTimes })), s.type !== 'audio' &&
107
111
  s.type !== 'video' &&
112
+ s.type !== 'image' &&
108
113
  s.loopDisplay === undefined &&
109
114
  (isInRange || isPremounting || isPostmounting) ? (jsx_runtime_1.jsx("div", { style: {
110
115
  paddingLeft: 5 + (premountWidth !== null && premountWidth !== void 0 ? premountWidth : 0),
@@ -31,7 +31,9 @@ const TimelineStack = ({ isCompact, sequence, originalLocation }) => {
31
31
  const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
32
32
  .previewServerState.type;
33
33
  const assetPath = (0, react_1.useMemo)(() => {
34
- if (sequence.type !== 'video' && sequence.type !== 'audio') {
34
+ if (sequence.type !== 'video' &&
35
+ sequence.type !== 'audio' &&
36
+ sequence.type !== 'image') {
35
37
  return null;
36
38
  }
37
39
  const isStatic = sequence.src.startsWith(window.remotion_staticBase);
@@ -42,7 +42,7 @@ const TimelineTracks = ({ timeline, hasBeenCut }) => {
42
42
  const isExpanded = (_a = expandedTracks[track.sequence.id]) !== null && _a !== void 0 ? _a : false;
43
43
  return (jsx_runtime_1.jsxs("div", { children: [
44
44
  jsx_runtime_1.jsx("div", { style: {
45
- height: (0, timeline_layout_1.getTimelineLayerHeight)(track.sequence.type === 'video' ? 'video' : 'other'),
45
+ height: (0, timeline_layout_1.getTimelineLayerHeight)(track.sequence.type),
46
46
  marginBottom: timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM,
47
47
  }, children: jsx_runtime_1.jsx(TimelineSequence_1.TimelineSequence, { s: track.sequence }) }), visualModeEnabled && isExpanded ? (jsx_runtime_1.jsx("div", { style: getExpandedPlaceholderStyle(track.sequence.controls) })) : null] }, track.sequence.id));
48
48
  })] }), hasBeenCut ? jsx_runtime_1.jsx(MaxTimelineTracks_1.MaxTimelineTracksReached, {}) : null] }));