valid points
Browse files
Remotion-app/src/HelloWorld/ImageStream.jsx
CHANGED
|
@@ -9,26 +9,26 @@ import React from 'react';
|
|
| 9 |
import {staticFile, useVideoConfig, Img, Easing} from 'remotion';
|
| 10 |
import imageSequences from './Assets/ImageSequences.json';
|
| 11 |
import {TransitionSeries, linearTiming} from '@remotion/transitions';
|
| 12 |
-
|
| 13 |
export default function ImageStream() {
|
| 14 |
const {fps} = useVideoConfig();
|
| 15 |
|
| 16 |
const frame = useCurrentFrame();
|
| 17 |
return (
|
| 18 |
-
<AbsoluteFill
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
>
|
| 32 |
{imageSequences.map((entry, index) => {
|
| 33 |
const durationInFrames = (entry.end - entry.start) * fps;
|
| 34 |
|
|
@@ -40,27 +40,31 @@ export default function ImageStream() {
|
|
| 40 |
fps * entry.end,
|
| 41 |
],
|
| 42 |
[1, 1.5, 1.3],
|
| 43 |
-
|
| 44 |
-
// easing: Easing.bezier(0.8, 0.22, 0.96, 0.65),
|
| 45 |
-
extrapolateLeft: 'clamp',
|
| 46 |
-
extrapolateRight: 'clamp',
|
| 47 |
-
}
|
| 48 |
);
|
| 49 |
|
| 50 |
return (
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
/>
|
| 63 |
-
|
| 64 |
);
|
| 65 |
})}
|
| 66 |
</TransitionSeries>
|
|
|
|
| 9 |
import {staticFile, useVideoConfig, Img, Easing} from 'remotion';
|
| 10 |
import imageSequences from './Assets/ImageSequences.json';
|
| 11 |
import {TransitionSeries, linearTiming} from '@remotion/transitions';
|
| 12 |
+
import {slide} from '@remotion/transitions/slide';
|
| 13 |
export default function ImageStream() {
|
| 14 |
const {fps} = useVideoConfig();
|
| 15 |
|
| 16 |
const frame = useCurrentFrame();
|
| 17 |
return (
|
| 18 |
+
<AbsoluteFill
|
| 19 |
+
style={{
|
| 20 |
+
top: '50%',
|
| 21 |
+
left: '50%',
|
| 22 |
+
transform: 'translate(-50%, -50%)',
|
| 23 |
+
color: 'white',
|
| 24 |
+
position: 'absolute',
|
| 25 |
+
width: '100%',
|
| 26 |
+
height: '100%',
|
| 27 |
+
zIndex: 0,
|
| 28 |
+
objectFit: 'cover',
|
| 29 |
+
}}
|
| 30 |
+
>
|
| 31 |
+
<TransitionSeries>
|
| 32 |
{imageSequences.map((entry, index) => {
|
| 33 |
const durationInFrames = (entry.end - entry.start) * fps;
|
| 34 |
|
|
|
|
| 40 |
fps * entry.end,
|
| 41 |
],
|
| 42 |
[1, 1.5, 1.3],
|
| 43 |
+
[1, 1.2, 1]
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
);
|
| 45 |
|
| 46 |
return (
|
| 47 |
+
<>
|
| 48 |
+
<TransitionSeries.Sequence
|
| 49 |
+
key={index}
|
| 50 |
+
// from={fps * entry.start}
|
| 51 |
+
durationInFrames={fps * (entry.end - entry.start)}
|
| 52 |
+
>
|
| 53 |
+
<Img
|
| 54 |
+
style={{
|
| 55 |
+
transform: `scale(${zoom})`,
|
| 56 |
+
}}
|
| 57 |
+
src={staticFile(entry.name)}
|
| 58 |
+
/>
|
| 59 |
+
</TransitionSeries.Sequence>
|
| 60 |
+
<TransitionSeries.Transition
|
| 61 |
+
presentation={slide('from-left')}
|
| 62 |
+
timing={linearTiming({
|
| 63 |
+
durationInFrames: 1,
|
| 64 |
+
easing: Easing.bezier(0.02, 1.85, 0.83, 0.43),
|
| 65 |
+
})}
|
| 66 |
/>
|
| 67 |
+
</>
|
| 68 |
);
|
| 69 |
})}
|
| 70 |
</TransitionSeries>
|