-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error running example #15
Comments
Hi. That's odd. I just tried the same thing and it works for me. Did you do the other required steps like |
I'm using yarn as my package manager and yes I did install it with |
which exact command are you running? I did like this and it works:
create MyVideo.jsimport React from 'react';
import { Image, Segment, Video, useVideo } from 'reactive-video';
export default () => {
const { currentFrame, currentTime, durationFrames, durationTime } = useVideo();
return (
<>
{/* This segment lasts for 30 frames. Print out the current frame number */}
<Segment duration={30}>
<div
style={{ width: '100%', height: '100%', backgroundColor: `hsl(${(currentFrame * 10) % 360}deg 78% 37%)`, color: 'white', display: 'flex', alignItems: 'center', justifyContent: 'center', flexDirection: 'column', fontSize: 100 }}
>
Current frame {currentFrame}
</div>
</Segment>
{/* This segment starts from 60 frames. Shows an image with a Ken Burns zoom effect */}
<Segment
start={30}
duration={30}
render={(segment) => (
<Image src="https://static.mifi.no/losslesscut/47320816_571610306620180_5860442193520120371_n.jpg" style={{ width: '100%', transform: `scale(${1 + (segment.currentFrame / segment.durationFrames) * 0.1})` }} />
)}
/>
{/* This segment starts from 60 frames. Starts 100 frames into the source video (seek to) */}
<Segment start={60}>
<Segment start={-100}>
<Video src="https://static.mifi.no/Zv5RvLhCz4M-small.mp4" style={{ width: '100%' }} />
</Segment>
</Segment>
</>
);
}; create index.jsconst Editor = require('@reactive-video/builder');
(async () => {
const editor = Editor({
ffmpegPath: 'ffmpeg',
ffprobePath: 'ffprobe',
devMode: true,
});
const width = 1280;
const height = 720;
const fps = 25;
const durationFrames = 90;
const reactVideo = 'MyVideo.js';
const userData = { some: 'value' };
// Build the video
await editor.edit({
reactVideo,
width,
height,
durationFrames,
userData,
output: 'my-video.mov',
concurrency: 3,
// headless: false,
// extraPuppeteerArgs: ['--no-sandbox', '--disable-setuid-sandbox']
// Optionally set rawOutput to false if you want to encode output to h264 (if not it will create MJPEG)
// rawOutput: false,
});
// Or start a live preview:
await editor.preview({
reactVideo,
width,
height,
fps,
durationFrames,
userData,
});
})().catch(console.error);
what about the cli, does that also not work? |
I did the exact same commands and it is still throwing me errors (with both yarn and npm).
cli also throws the same error:
I tried it on WSL and it works fine. |
@seriiix i am also getting same error , could you please guide me,how you solved error? |
@preetparm are you also on Windows? I haven't tested on windows so there could be some bugs there |
Yes windows 10 system |
Got the same error on an ubuntu system (glitch.com) |
I created both
index.js
andMyVideo.js
with the examples provided. however, when I runindex.js
I get this error:The text was updated successfully, but these errors were encountered: