Skip to content

Premounting does not work as indicator would lead you to believe #6727

@JonnyBurger

Description

@JonnyBurger
import {Video} from '@remotion/media';
import React from 'react';
import {Sequence, staticFile, useVideoConfig} from 'remotion';

const SLICE_DURATION_FRAMES = 3; // 0.1sec at 30fps
const NUM_SLICES = 10;
const PREMOUNT_SEC = 0.5;

export const SlicedVideo: React.FC = () => {
	const src = staticFile('sliced-video.mp4');
	const {fps} = useVideoConfig();

	return (
		<Sequence from={15} premountFor={15}>
			{new Array(NUM_SLICES).fill(0).map((_, i) => {
				const from = i * SLICE_DURATION_FRAMES;
				return (
					<Sequence
						key={i}
						from={from}
						durationInFrames={SLICE_DURATION_FRAMES}
						premountFor={PREMOUNT_SEC * fps}
					>
						<Video src={src} trimBefore={from} />
					</Sequence>
				);
			})}
		</Sequence>
	);
};
Image

However, 6 videos are premounted on frame 0. This is because the premount is cascading?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions