Jump Cutting
Sometimes you want to implement a "jump cut" to skip parts of a video (for example to cut out the "uhm"s).
Best practice: Pre-mounting multiple video tags
The recommended approach for smooth jump-cut playback in the browser is to render a separate <Video> from @remotion/media tag for each section using <Series>. The Studio premounts each segment for 2 seconds by default, giving the browser time to preload it before it starts playing. In the Player, pass defaultPremountInSeconds to enable premounting.
JumpCuts.tsximport {Video } from '@remotion/media'; importReact from 'react'; import {CalculateMetadataFunction ,Series ,staticFile } from 'remotion'; constfps = 30; typeSection = {trimBefore : number;durationInFrames : number; }; export constSAMPLE_SECTIONS :Section [] = [ {trimBefore : 0,durationInFrames : 5 *fps }, {trimBefore : 7 *fps ,durationInFrames : 3 *fps }, {trimBefore : 13 *fps ,durationInFrames : 5 *fps }, ]; typeProps = {sections :Section []; }; export constcalculateMetadata :CalculateMetadataFunction <Props > = ({props }) => { constdurationInFrames =props .sections .reduce ((acc ,section ) => { returnacc +section .durationInFrames ; }, 0); return {fps ,durationInFrames , }; }; export constJumpCuts :React .FC <Props > = ({sections }) => { return ( <Series > {sections .map ((section ,i ) => ( <Series .Sequence key ={i }durationInFrames ={section .durationInFrames } > <Video trimBefore ={section .trimBefore }durationInFrames ={section .durationInFrames }src ={staticFile ('time.mp4')} /> </Series .Sequence > ))} </Series > ); };
note
These considerations apply only to smooth previews in the browser.
During rendering, video frames are selected exactly, so premounting is only needed for smoother browser preview playback.