Skip to content

🎥 Make videos programmatically with React

rename to audioStreamIndex

Jonny Burger689ad45c33a1
diff --git a/packages/core/src/CompositionManager.tsx b/packages/core/src/CompositionManager.tsx
index 159d7b92a7..0b1eda8d85 100644
--- a/packages/core/src/CompositionManager.tsx
+++ b/packages/core/src/CompositionManager.tsx
@@ -133,7 +133,7 @@ export type AudioOrVideoAsset = {
playbackRate: number;
toneFrequency: number | null;
audioStartFrame: number;
- audioChannelIndex: number;
+ audioStreamIndex: number;
};
type DiscriminatedArtifact =
diff --git a/packages/core/src/audio/AudioForPreview.tsx b/packages/core/src/audio/AudioForPreview.tsx
index 263e10d8e8..b8d8821c94 100644
--- a/packages/core/src/audio/AudioForPreview.tsx
+++ b/packages/core/src/audio/AudioForPreview.tsx
@@ -76,7 +76,7 @@ const AudioForDevelopmentForwardRefFunction: React.ForwardRefRenderFunction<
useWebAudioApi,
onError,
onNativeError,
- audioChannelIndex,
+ audioStreamIndex,
...nativeProps
} = props;
diff --git a/packages/core/src/audio/AudioForRendering.tsx b/packages/core/src/audio/AudioForRendering.tsx
index 723b88ca0c..f8374c37dc 100644
--- a/packages/core/src/audio/AudioForRendering.tsx
+++ b/packages/core/src/audio/AudioForRendering.tsx
@@ -45,7 +45,7 @@ const AudioForRenderingRefForwardingFunction: React.ForwardRefRenderFunction<
delayRenderTimeoutInMilliseconds,
loopVolumeCurveBehavior,
pauseWhenBuffering,
- audioChannelIndex,
+ audioStreamIndex,
...nativeProps
} = props;
@@ -110,7 +110,7 @@ const AudioForRenderingRefForwardingFunction: React.ForwardRefRenderFunction<
playbackRate: props.playbackRate ?? 1,
toneFrequency: toneFrequency ?? null,
audioStartFrame: Math.max(0, -(sequenceContext?.relativeFrom ?? 0)),
- audioChannelIndex: audioChannelIndex ?? 0,
+ audioStreamIndex: audioStreamIndex ?? 0,
});
return () => unregisterRenderAsset(id);
}, [
@@ -127,7 +127,7 @@ const AudioForRenderingRefForwardingFunction: React.ForwardRefRenderFunction<
props.playbackRate,
toneFrequency,
sequenceContext?.relativeFrom,
- audioChannelIndex,
+ audioStreamIndex,
]);
const {src} = props;
diff --git a/packages/core/src/audio/props.ts b/packages/core/src/audio/props.ts
index 5e899907f2..c7f913f2b5 100644
--- a/packages/core/src/audio/props.ts
+++ b/packages/core/src/audio/props.ts
@@ -53,7 +53,7 @@ export type RemotionAudioProps = NativeAudioProps & {
delayRenderRetries?: number;
loopVolumeCurveBehavior?: LoopVolumeCurveBehavior;
onError?: (err: Error) => void;
- audioChannelIndex?: number;
+ audioStreamIndex?: number;
};
type IsNever<T> = [T] extends [never] ? true : false;
diff --git a/packages/core/src/test/audio-for-rendering.test.tsx b/packages/core/src/test/audio-for-rendering.test.tsx
index 6cd9c73eb2..81313cf3e1 100644
--- a/packages/core/src/test/audio-for-rendering.test.tsx
+++ b/packages/core/src/test/audio-for-rendering.test.tsx
@@ -61,7 +61,7 @@ describe('Register and unregister asset', () => {
volume: 50,
onDuration: mock(),
onNativeError: mock(),
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
};
const {unmount} = render(
<CanUseRemotionHooksProvider>
@@ -83,7 +83,7 @@ describe('Register and unregister asset', () => {
volume: 50,
onDuration: mock(),
onNativeError: mock(),
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
};
expectToThrow(() => {
render(
diff --git a/packages/core/src/video/OffthreadVideoForRendering.tsx b/packages/core/src/video/OffthreadVideoForRendering.tsx
index 7f60b70e3b..8c28be27d9 100644
--- a/packages/core/src/video/OffthreadVideoForRendering.tsx
+++ b/packages/core/src/video/OffthreadVideoForRendering.tsx
@@ -52,7 +52,7 @@ export const OffthreadVideoForRendering: React.FC<
// Remove crossOrigin prop during rendering
// https://discord.com/channels/809501355504959528/844143007183667220/1311639632496033813
crossOrigin,
- audioChannelIndex,
+ audioStreamIndex,
...props
}) => {
const absoluteFrame = useTimelinePosition();
@@ -124,7 +124,7 @@ export const OffthreadVideoForRendering: React.FC<
playbackRate: playbackRate ?? 1,
toneFrequency: toneFrequency ?? null,
audioStartFrame: Math.max(0, -(sequenceContext?.relativeFrom ?? 0)),
- audioChannelIndex: audioChannelIndex ?? 0,
+ audioStreamIndex: audioStreamIndex ?? 0,
});
return () => unregisterRenderAsset(id);
@@ -140,7 +140,7 @@ export const OffthreadVideoForRendering: React.FC<
playbackRate,
toneFrequency,
sequenceContext?.relativeFrom,
- audioChannelIndex,
+ audioStreamIndex,
]);
const currentTime = useMemo(() => {
diff --git a/packages/core/src/video/VideoForPreview.tsx b/packages/core/src/video/VideoForPreview.tsx
index 149a0d9bdb..a78a9d6d94 100644
--- a/packages/core/src/video/VideoForPreview.tsx
+++ b/packages/core/src/video/VideoForPreview.tsx
@@ -94,7 +94,7 @@ const VideoForDevelopmentRefForwardingFunction: React.ForwardRefRenderFunction<
delayRenderTimeoutInMilliseconds,
allowAmplificationDuringRender,
useWebAudioApi,
- audioChannelIndex,
+ audioStreamIndex,
...nativeProps
} = props;
diff --git a/packages/core/src/video/VideoForRendering.tsx b/packages/core/src/video/VideoForRendering.tsx
index e0830d1825..d08d56111a 100644
--- a/packages/core/src/video/VideoForRendering.tsx
+++ b/packages/core/src/video/VideoForRendering.tsx
@@ -49,7 +49,7 @@ const VideoForRenderingForwardFunction: React.ForwardRefRenderFunction<
delayRenderRetries,
delayRenderTimeoutInMilliseconds,
loopVolumeCurveBehavior,
- audioChannelIndex,
+ audioStreamIndex,
...props
},
ref,
@@ -123,7 +123,7 @@ const VideoForRenderingForwardFunction: React.ForwardRefRenderFunction<
playbackRate: playbackRate ?? 1,
toneFrequency: toneFrequency ?? null,
audioStartFrame: Math.max(0, -(sequenceContext?.relativeFrom ?? 0)),
- audioChannelIndex: audioChannelIndex ?? 0,
+ audioStreamIndex: audioStreamIndex ?? 0,
});
return () => unregisterRenderAsset(id);
@@ -139,7 +139,7 @@ const VideoForRenderingForwardFunction: React.ForwardRefRenderFunction<
playbackRate,
toneFrequency,
sequenceContext?.relativeFrom,
- audioChannelIndex,
+ audioStreamIndex,
]);
useImperativeHandle(ref, () => {
diff --git a/packages/core/src/video/props.ts b/packages/core/src/video/props.ts
index 90c00c6c5c..2bb014981c 100644
--- a/packages/core/src/video/props.ts
+++ b/packages/core/src/video/props.ts
@@ -53,7 +53,7 @@ export type RemotionVideoProps = NativeVideoProps & {
delayRenderRetries?: number;
onError?: (err: Error) => void;
onAutoPlayError?: null | (() => void);
- audioChannelIndex?: number;
+ audioStreamIndex?: number;
};
type DeprecatedOffthreadVideoProps = {
@@ -91,7 +91,7 @@ export type RemotionOffthreadVideoProps = {
onAutoPlayError?: null | (() => void);
onVideoFrame?: OnVideoFrame;
crossOrigin?: '' | 'anonymous' | 'use-credentials';
- audioChannelIndex?: number;
+ audioStreamIndex?: number;
} & RemotionMainVideoProps &
DeprecatedOffthreadVideoProps;
diff --git a/packages/docs/docs/audio.mdx b/packages/docs/docs/audio.mdx
index 0096ed14a2..f90341bbd3 100644
--- a/packages/docs/docs/audio.mdx
+++ b/packages/docs/docs/audio.mdx
@@ -164,7 +164,7 @@ Accepts a number between `0.01` and `2`, where `1` represents the original pitch
A `toneFrequency` of 0.5 would lower the pitch by half, and a `toneFrequency` of `1.5` would increase the pitch by 50%.
-### `audioChannelIndex?`<AvailableFrom v="4.0.340" />
+### `audioStreamIndex?`<AvailableFrom v="4.0.340" />
Select the audio stream to use. The default is `0`.
@@ -175,7 +175,7 @@ import {AbsoluteFill, Audio} from 'remotion';
export const MyComposition = () => {
return (
<AbsoluteFill>
- <Audio audioChannelIndex={1} src={'https://parser.media/multichannel-audio.mov'} />
+ <Audio audioStreamIndex={1} src={'https://parser.media/multichannel-audio.mov'} />
</AbsoluteFill>
);
};
diff --git a/packages/docs/docs/new-video/index.mdx b/packages/docs/docs/new-video/index.mdx
index e9fcfdd2ad..e511113c21 100644
--- a/packages/docs/docs/new-video/index.mdx
+++ b/packages/docs/docs/new-video/index.mdx
@@ -207,7 +207,7 @@ Accepts a number between `0.01` and `2`, where `1` represents the original pitch
A `toneFrequency` of 0.5 would lower the pitch by half, and a `toneFrequency` of `1.5` would increase the pitch by 50%.
-### `audioChannelIndex?`<AvailableFrom v="4.0.340" />
+### `audioStreamIndex?`<AvailableFrom v="4.0.340" />
Select the audio stream to use. The default is `0`.
@@ -218,7 +218,7 @@ import {AbsoluteFill, Audio} from 'remotion';
export const MyComposition = () => {
return (
<AbsoluteFill>
- <Audio audioChannelIndex={1} src={'https://parser.media/multichannel-audio.mov'} />
+ <Audio audioStreamIndex={1} src={'https://parser.media/multichannel-audio.mov'} />
</AbsoluteFill>
);
};
diff --git a/packages/docs/docs/offthreadvideo.mdx b/packages/docs/docs/offthreadvideo.mdx
index 457a39b631..e3c20a6e93 100644
--- a/packages/docs/docs/offthreadvideo.mdx
+++ b/packages/docs/docs/offthreadvideo.mdx
@@ -229,7 +229,7 @@ Disabling tone mapping will speed up rendering, but may result in less vibrant c
Prior to Remotion 4.0.117, tone mapping was always disabled, and the `toneMapped` prop was not available.
-### `audioChannelIndex?`<AvailableFrom v="4.0.340" />
+### `audioStreamIndex?`<AvailableFrom v="4.0.340" />
Select the audio stream to use. The default is `0`.
@@ -240,7 +240,7 @@ import {AbsoluteFill, OffthreadVideo} from 'remotion';
export const MyComposition = () => {
return (
<AbsoluteFill>
- <OffthreadVideo audioChannelIndex={1} src={'https://parser.media/multichannel-audio.mov'} />
+ <OffthreadVideo audioStreamIndex={1} src={'https://parser.media/multichannel-audio.mov'} />
</AbsoluteFill>
);
};
diff --git a/packages/docs/docs/video.mdx b/packages/docs/docs/video.mdx
index 225133863e..4e2dcc8dbd 100644
--- a/packages/docs/docs/video.mdx
+++ b/packages/docs/docs/video.mdx
@@ -220,7 +220,7 @@ Accepts a number between `0.01` and `2`, where `1` represents the original pitch
A `toneFrequency` of 0.5 would lower the pitch by half, and a `toneFrequency` of `1.5` would increase the pitch by 50%.
-### `audioChannelIndex?`<AvailableFrom v="4.0.340" />
+### `audioStreamIndex?`<AvailableFrom v="4.0.340" />
Select the audio stream to use. The default is `0`.
@@ -231,7 +231,7 @@ import {AbsoluteFill, Video} from 'remotion';
export const MyComposition = () => {
return (
<AbsoluteFill>
- <Video audioChannelIndex={1} src={'https://parser.media/multichannel-audio.mov'} />
+ <Video audioStreamIndex={1} src={'https://parser.media/multichannel-audio.mov'} />
</AbsoluteFill>
);
};
diff --git a/packages/example/src/OffthreadRemoteVideo/MultiChannelAudio.tsx b/packages/example/src/OffthreadRemoteVideo/MultiChannelAudio.tsx
index 11ea567b70..ea4907c583 100644
--- a/packages/example/src/OffthreadRemoteVideo/MultiChannelAudio.tsx
+++ b/packages/example/src/OffthreadRemoteVideo/MultiChannelAudio.tsx
@@ -25,7 +25,7 @@ export const calculateMetadataFn: CalculateMetadataFunction<
const Component = () => {
return (
<>
- <Audio src={src} audioChannelIndex={3} />
+ <Audio src={src} audioStreamIndex={3} />
</>
);
};
diff --git a/packages/renderer/src/assets/calculate-asset-positions.ts b/packages/renderer/src/assets/calculate-asset-positions.ts
index eb3e82c6cd..fd848d8701 100644
--- a/packages/renderer/src/assets/calculate-asset-positions.ts
+++ b/packages/renderer/src/assets/calculate-asset-positions.ts
@@ -58,7 +58,7 @@ export const calculateAssetPositions = (
playbackRate: asset.playbackRate,
toneFrequency: asset.toneFrequency,
audioStartFrame: asset.audioStartFrame,
- audioChannelIndex: asset.audioChannelIndex,
+ audioStreamIndex: asset.audioStreamIndex,
});
}
diff --git a/packages/renderer/src/assets/download-and-map-assets-to-file.ts b/packages/renderer/src/assets/download-and-map-assets-to-file.ts
index 66a4ac0d45..e91b1ba88a 100644
--- a/packages/renderer/src/assets/download-and-map-assets-to-file.ts
+++ b/packages/renderer/src/assets/download-and-map-assets-to-file.ts
@@ -154,7 +154,7 @@ export const downloadAsset = async ({
shouldAnalyzeAudioImmediately,
binariesDirectory,
cancelSignalForAudioAnalysis,
- audioChannelIndex,
+ audioStreamIndex,
}: {
src: string;
downloadMap: DownloadMap;
@@ -163,7 +163,7 @@ export const downloadAsset = async ({
shouldAnalyzeAudioImmediately: boolean;
binariesDirectory: string | null;
cancelSignalForAudioAnalysis: CancelSignal | undefined;
- audioChannelIndex: number | undefined;
+ audioStreamIndex: number | undefined;
}): Promise<string> => {
if (isAssetCompressed(src)) {
return src;
@@ -265,7 +265,7 @@ export const downloadAsset = async ({
indent,
logLevel,
cancelSignal: cancelSignalForAudioAnalysis,
- audioChannelIndex,
+ audioStreamIndex,
});
}
@@ -390,7 +390,7 @@ export const downloadAndMapAssetsToFileUrl = async ({
shouldAnalyzeAudioImmediately,
binariesDirectory,
cancelSignalForAudioAnalysis,
- audioChannelIndex: renderAsset.audioChannelIndex,
+ audioStreamIndex: renderAsset.audioStreamIndex,
});
cleanup();
diff --git a/packages/renderer/src/assets/get-audio-channels.ts b/packages/renderer/src/assets/get-audio-channels.ts
index e943e8b146..c9c7954337 100644
--- a/packages/renderer/src/assets/get-audio-channels.ts
+++ b/packages/renderer/src/assets/get-audio-channels.ts
@@ -15,18 +15,18 @@ export const getAudioChannelsAndDurationWithoutCache = async ({
logLevel,
binariesDirectory,
cancelSignal,
- audioChannelIndex,
+ audioStreamIndex,
}: {
src: string;
indent: boolean;
logLevel: LogLevel;
binariesDirectory: string | null;
cancelSignal: CancelSignal | undefined;
- audioChannelIndex: number | undefined;
+ audioStreamIndex: number | undefined;
}) => {
const args = [
['-v', 'error'],
- ['-select_streams', audioChannelIndex ? `a:${audioChannelIndex}` : 'a:0'],
+ ['-select_streams', audioStreamIndex ? `a:${audioStreamIndex}` : 'a:0'],
[
'-show_entries',
'stream=channels:stream=start_time:format=duration:format=format_name',
@@ -83,7 +83,7 @@ async function getAudioChannelsAndDurationUnlimited({
logLevel,
binariesDirectory,
cancelSignal,
- audioChannelIndex,
+ audioStreamIndex,
}: {
downloadMap: DownloadMap;
src: string;
@@ -91,9 +91,9 @@ async function getAudioChannelsAndDurationUnlimited({
logLevel: LogLevel;
binariesDirectory: string | null;
cancelSignal: CancelSignal | undefined;
- audioChannelIndex: number | undefined;
+ audioStreamIndex: number | undefined;
}): Promise<AudioChannelsAndDurationResultCache> {
- const cacheKey = audioChannelIndex ? `${src}-${audioChannelIndex}` : src;
+ const cacheKey = audioStreamIndex ? `${src}-${audioStreamIndex}` : src;
if (downloadMap.durationOfAssetCache[cacheKey]) {
return downloadMap.durationOfAssetCache[cacheKey];
}
@@ -104,7 +104,7 @@ async function getAudioChannelsAndDurationUnlimited({
logLevel,
binariesDirectory,
cancelSignal,
- audioChannelIndex,
+ audioStreamIndex,
});
downloadMap.durationOfAssetCache[cacheKey] = result;
@@ -119,7 +119,7 @@ export const getAudioChannelsAndDuration = ({
logLevel,
binariesDirectory,
cancelSignal,
- audioChannelIndex,
+ audioStreamIndex,
}: {
downloadMap: DownloadMap;
src: string;
@@ -127,7 +127,7 @@ export const getAudioChannelsAndDuration = ({
logLevel: LogLevel;
binariesDirectory: string | null;
cancelSignal: CancelSignal | undefined;
- audioChannelIndex: number | undefined;
+ audioStreamIndex: number | undefined;
}): Promise<AudioChannelsAndDurationResultCache> => {
return limit(() =>
getAudioChannelsAndDurationUnlimited({
@@ -137,7 +137,7 @@ export const getAudioChannelsAndDuration = ({
logLevel,
binariesDirectory,
cancelSignal,
- audioChannelIndex,
+ audioStreamIndex,
}),
);
};
diff --git a/packages/renderer/src/assets/types.ts b/packages/renderer/src/assets/types.ts
index 91d22ab948..c8dd79e97e 100644
--- a/packages/renderer/src/assets/types.ts
+++ b/packages/renderer/src/assets/types.ts
@@ -15,7 +15,7 @@ export type UnsafeAsset = Omit<
id: string;
playbackRate: number;
toneFrequency: number | null;
- audioChannelIndex: number;
+ audioStreamIndex: number;
};
// Volume can either be static, for all frames the same,
diff --git a/packages/renderer/src/create-audio.ts b/packages/renderer/src/create-audio.ts
index f6bf59dfde..53ac71deca 100644
--- a/packages/renderer/src/create-audio.ts
+++ b/packages/renderer/src/create-audio.ts
@@ -114,7 +114,7 @@ export const createAudio = async ({
trimLeftOffset,
trimRightOffset,
forSeamlessAacConcatenation,
- audioChannelIndex: asset.audioChannelIndex,
+ audioStreamIndex: asset.audioStreamIndex,
});
preprocessProgress[index] = 1;
updateProgress();
diff --git a/packages/renderer/src/offthread-video-server.ts b/packages/renderer/src/offthread-video-server.ts
index 4544013d5a..f1b5272d05 100644
--- a/packages/renderer/src/offthread-video-server.ts
+++ b/packages/renderer/src/offthread-video-server.ts
@@ -143,7 +143,7 @@ export const startOffthreadVideoServer = ({
binariesDirectory,
cancelSignalForAudioAnalysis: undefined,
shouldAnalyzeAudioImmediately: true,
- audioChannelIndex: undefined,
+ audioStreamIndex: undefined,
})
.then((to) => {
return new Promise<Uint8Array>((resolve, reject) => {
diff --git a/packages/renderer/src/preprocess-audio-track.ts b/packages/renderer/src/preprocess-audio-track.ts
index 976159b425..a5609197cc 100644
--- a/packages/renderer/src/preprocess-audio-track.ts
+++ b/packages/renderer/src/preprocess-audio-track.ts
@@ -28,7 +28,7 @@ type Options = {
trimRightOffset: number;
forSeamlessAacConcatenation: boolean;
onProgress: (progress: number) => void;
- audioChannelIndex: number;
+ audioStreamIndex: number;
};
export type PreprocessedAudioTrack = {
@@ -50,7 +50,7 @@ const preprocessAudioTrackUnlimited = async ({
trimLeftOffset,
trimRightOffset,
forSeamlessAacConcatenation,
- audioChannelIndex,
+ audioStreamIndex,
}: Options): Promise<PreprocessedAudioTrack | null> => {
const {channels, duration, startTime} = await getAudioChannelsAndDuration({
downloadMap,
@@ -59,7 +59,7 @@ const preprocessAudioTrackUnlimited = async ({
logLevel,
binariesDirectory,
cancelSignal,
- audioChannelIndex,
+ audioStreamIndex,
});
const filter = stringifyFfmpegFilter({
@@ -86,7 +86,7 @@ const preprocessAudioTrackUnlimited = async ({
const args = [
['-hide_banner'],
['-i', resolveAssetSrc(asset.src)],
- audioChannelIndex ? ['-map', `0:a:${audioChannelIndex}`] : [],
+ audioStreamIndex ? ['-map', `0:a:${audioStreamIndex}`] : [],
['-ac', '2'],
['-filter_script:a', file],
['-c:a', 'pcm_s16le'],
diff --git a/packages/renderer/src/test/asset-calculation.test.tsx b/packages/renderer/src/test/asset-calculation.test.tsx
index c85cbc78fc..c4965ca407 100644
--- a/packages/renderer/src/test/asset-calculation.test.tsx
+++ b/packages/renderer/src/test/asset-calculation.test.tsx
@@ -43,7 +43,7 @@ test('Should be able to collect assets', async () => {
playbackRate: 1,
toneFrequency: null,
audioStartFrame: 0,
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
});
});
@@ -65,7 +65,7 @@ test('Should get multiple assets', async () => {
playbackRate: 1,
toneFrequency: null,
audioStartFrame: 0,
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
});
expect(withoutId(assetPositions[1])).toEqual({
type: 'audio',
@@ -77,7 +77,7 @@ test('Should get multiple assets', async () => {
playbackRate: 1,
toneFrequency: null,
audioStartFrame: 0,
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
});
});
@@ -103,7 +103,7 @@ test('Should handle jumps inbetween', async () => {
playbackRate: 1,
toneFrequency: null,
audioStartFrame: 0,
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
});
expect(withoutId(assetPositions[1])).toEqual({
type: 'video',
@@ -115,7 +115,7 @@ test('Should handle jumps inbetween', async () => {
playbackRate: 1,
toneFrequency: null,
audioStartFrame: 0,
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
});
});
@@ -138,7 +138,7 @@ test('Should support sequencing', async () => {
playbackRate: 1,
toneFrequency: null,
audioStartFrame: 20,
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
});
});
@@ -171,7 +171,7 @@ test('Should calculate volumes correctly', async () => {
.filter((f) => f > 0),
toneFrequency: null,
audioStartFrame: 0,
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
});
});
@@ -214,6 +214,6 @@ test('Should calculate startFrom correctly', async () => {
.filter((i) => i > 0),
toneFrequency: null,
audioStartFrame: 100,
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
});
});
diff --git a/packages/renderer/src/test/asset-compression.test.ts b/packages/renderer/src/test/asset-compression.test.ts
index 358b00dddd..daf02f05ed 100644
--- a/packages/renderer/src/test/asset-compression.test.ts
+++ b/packages/renderer/src/test/asset-compression.test.ts
@@ -17,7 +17,7 @@ test('Should compress and uncompress assets', () => {
volume: 1,
toneFrequency: null,
audioStartFrame: 0,
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
},
],
[
@@ -31,7 +31,7 @@ test('Should compress and uncompress assets', () => {
volume: 1,
toneFrequency: null,
audioStartFrame: 0,
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
},
],
].flat(1);
@@ -58,7 +58,7 @@ test('Should compress and uncompress assets', () => {
volume: 1,
toneFrequency: null,
audioStartFrame: 0,
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
},
]);
});
diff --git a/packages/renderer/src/test/dont-skip-assets.test.ts b/packages/renderer/src/test/dont-skip-assets.test.ts
index e0956e6a1f..ed5420203f 100644
--- a/packages/renderer/src/test/dont-skip-assets.test.ts
+++ b/packages/renderer/src/test/dont-skip-assets.test.ts
@@ -25,7 +25,7 @@ const mock: TRenderAsset[][] = new Array(2934)
mediaFrame: 0,
toneFrequency: null,
audioStartFrame: 0,
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
}
: null,
{
@@ -38,7 +38,7 @@ const mock: TRenderAsset[][] = new Array(2934)
mediaFrame: k,
toneFrequency: null,
audioStartFrame: 0,
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
},
].filter(truthy);
});
@@ -61,7 +61,7 @@ test('Dont skip assets', () => {
playbackRate: 1,
toneFrequency: null,
audioStartFrame: 0,
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
},
{
src: 'http://localhost:3000/e15ac5e3d531199ebb1828ca6a99100d.webm',
@@ -74,7 +74,7 @@ test('Dont skip assets', () => {
playbackRate: 1,
toneFrequency: null,
audioStartFrame: 0,
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
},
]);
});
diff --git a/packages/renderer/src/test/ffmpeg-filters.test.ts b/packages/renderer/src/test/ffmpeg-filters.test.ts
index f64f6cd41b..3bbc059fbe 100644
--- a/packages/renderer/src/test/ffmpeg-filters.test.ts
+++ b/packages/renderer/src/test/ffmpeg-filters.test.ts
@@ -18,7 +18,7 @@ const baseAsset: MediaAsset = {
playbackRate: 1,
toneFrequency: null,
audioStartFrame: 0,
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
};
const expandAsset = ({
@@ -327,7 +327,7 @@ test('Should calculate pad correctly with a lot of playbackRate', () => {
playbackRate: 16,
toneFrequency: null,
audioStartFrame: 0,
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
},
extraFramesToCaptureAssets: [
...extraFramesToCaptureAssetsFrontend,
diff --git a/packages/renderer/src/test/get-audio-channels.test.ts b/packages/renderer/src/test/get-audio-channels.test.ts
index 38eff09bb2..7a567bcdab 100644
--- a/packages/renderer/src/test/get-audio-channels.test.ts
+++ b/packages/renderer/src/test/get-audio-channels.test.ts
@@ -25,7 +25,7 @@ test('Get audio channels for video', async () => {
logLevel: 'info',
binariesDirectory: null,
cancelSignal: undefined,
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
});
expect(channels).toEqual({channels: 2, duration: 10, startTime: 0});
}, 90000);
@@ -48,7 +48,7 @@ test('Get audio channels for video without music', async () => {
logLevel: 'info',
binariesDirectory: null,
cancelSignal: undefined,
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
});
expect(channels.channels).toEqual(0);
@@ -75,7 +75,7 @@ test('Get audio channels for mp3', async () => {
logLevel: 'info',
binariesDirectory: null,
cancelSignal: undefined,
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
});
cleanDownloadMap(downloadMap);
@@ -98,7 +98,7 @@ test('Throw error if parsing a non video file', () => {
logLevel: 'info',
binariesDirectory: null,
cancelSignal: undefined,
- audioChannelIndex: 0,
+ audioStreamIndex: 0,
}),
).toThrow(/Invalid data found when processing input/);
cleanDownloadMap(downloadMap);
diff --git a/packages/video/src/new-video-for-rendering.tsx b/packages/video/src/new-video-for-rendering.tsx
index a3fc21a7f7..0e8f104b30 100644
--- a/packages/video/src/new-video-for-rendering.tsx
+++ b/packages/video/src/new-video-for-rendering.tsx
@@ -38,7 +38,7 @@ export const NewVideoForRendering: React.FC<NewVideoProps> = ({
// Remove crossOrigin prop during rendering
// https://discord.com/channels/809501355504959528/844143007183667220/1311639632496033813
crossOrigin,
- audioChannelIndex,
+ audioStreamIndex,
}) => {
// eslint-disable-next-line no-unused-expressions
crossOrigin;
@@ -107,7 +107,7 @@ export const NewVideoForRendering: React.FC<NewVideoProps> = ({
playbackRate: playbackRate ?? 1,
toneFrequency: toneFrequency ?? null,
audioStartFrame: Math.max(0, -(sequenceContext?.relativeFrom ?? 0)),
- audioChannelIndex: audioChannelIndex ?? 0,
+ audioStreamIndex: audioStreamIndex ?? 0,
});
return () => unregisterRenderAsset(id);
@@ -123,7 +123,7 @@ export const NewVideoForRendering: React.FC<NewVideoProps> = ({
playbackRate,
toneFrequency,
sequenceContext?.relativeFrom,
- audioChannelIndex,
+ audioStreamIndex,
]);
const {fps} = videoConfig;
diff --git a/packages/video/src/props.ts b/packages/video/src/props.ts
index b0ceaae5f5..6d34bda070 100644
--- a/packages/video/src/props.ts
+++ b/packages/video/src/props.ts
@@ -25,5 +25,5 @@ export type NewVideoProps = {
* @deprecated For internal use only
*/
stack?: string;
- audioChannelIndex?: number;
+ audioStreamIndex?: number;
};