We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I tried to draw the animation using Canvas and save it by converting it to MP4.
But the saved MP4 is too different from the actual animation
node: 12.20.2 node-canvas: 2.8.0 ffmpeg-stream: 0.7.0
const converterInput = converter.createInputStream({ f: "image2pipe", r: 20 }); converter.createOutputToFile("out.mp4", { vcodec: "libx264", pix_fmt: "yuv420p", }); const convertingFinished = converter.run(); let i = 0; let timer = null; const keyframes = () => { console.log(i); const canvas = this.scene.snapshot(); const stream = canvas.createJPEGStream({quality: 1, progressive: false, chromaSubsampling: true}); stream.on('end', () => { i++; if(i>= 150) { clearTimeout(timer); converterInput.end(); } else { timer = setTimeout(keyframes, 1000 / 20); } console.log('end'); }); stream.pipe(converterInput, {end: false}).on('error', (err) => { if(err) console.log(err); }); } keyframes(); await convertingFinished }``` Hope to be able to optimize repair。thank you
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I tried to draw the animation using Canvas and save it by converting it to MP4.
But the saved MP4 is too different from the actual animation
node: 12.20.2
node-canvas: 2.8.0
ffmpeg-stream: 0.7.0
The text was updated successfully, but these errors were encountered: