Closed tomssem closed 2 years ago
I'm getting the same issue. Win 11.
Tried to actually find the bug but it's above my JS paygrade - in essence handleStreamEnd
gets called in between usingStream
being defined and currentStream
being used in the if statement, so in that time currentStream
is set to null.
Thanks! Gonna look into this. I haven't noticed any errors on my end so a bit tricky for me to debug. Can you be sure you are on the latest version of both canvas-sketch
and canvas-sketch-cli
?
# install latest CLI locally or globally depending on what you use
npm install canvas-sketch-cli@latest --global
# install latest API locally into your repo
npm install canvas-sketch@latest --save
Hi, I have the same issue, I have the latest version of both canvas-sketch and canvas-sketch-cli, when i stop the stream it give me the error, and save the stream on download although I specified the ouput path.
+1, i get the same error message as OP
I've recently hit this issue, I don't have a fix but I have a workaround I can't really explain, at least it works in my case.
I've gone to middleware.js, line 189 and just logged currentStream before the conditional. I can save video's now although there is just a terminal full of logs now, if I remove the log the error returns.
Does anyone with more experience have an insight into why that would happen?
I finally figured it out. Just as @Dot-Rhs pointed out, the trouble is in line number 189. I think that section was added very recently to stop some incompatible encoding from being saved. I just commented out the below code around # 189.
// if (mimeType && mimeType !== currentStream.encoding) { // reject(new Error('Error: Currently only single-image exports in image/png or image/jpeg format is supported with MP4 streaming')); // }
Only caveat, you need to remember that for an mp4 stream, the encoding in the options should be 'image/png' or 'image/jpeg'. The above section of code "enforced" that. Trouble is, it enforced that without checking if the stream is null.
I believe this should now be fixed in latest. Please update like so:
(if you've installed the CLI globally previously)
npm install canvas-sketch-cli@latest --global
Or locally:
npm install canvas-sketch-cli@latest --save-dev
Let me know if any issues persist.
I'm still facing same problem here.
There was a problem starting the stream export
Worked after installing locally.
Every time I try to save a stream of frames (with out without the
--stream
option, and if set togif
or not) I get aTypeError
along the lines of:The exact property that is null can be different, another example being: