简体   繁体   English

原始h264到GIF节点js

[英]raw h264 to GIF node js

I am trying to use the "pi-camera" library which is working and allowing me to record video in a raw h264 format on my r-pi. 我正在尝试使用正在运行的“ pi-camera”库,并允许我在r-pi上以原始h264格式录制视频。 However, the node js library "gifify" continuously gives me the error "RangeError: Maximum call stack size exceeded" looking this error up it seems to be related calling many functions within functions multiple times or something related to this. 但是,节点js库“ gifify”连续不断地向我显示错误“ RangeError:超出最大调用堆栈大小”,查找该错误似乎与多次调用函数中的多个函数或与此相关。 However, my code only uses one function which contains a simple command to take the video and then convert it. 但是,我的代码仅使用一个函数,其中包含一个简单的命令来拍摄视频,然后将其转换。

 const PiCamera = require('pi-camera'); var fs = require('fs'); var gifify = require('gifify'); var path = require('path'); var sleep = require('system-sleep'); const myCamera = new PiCamera({ mode: 'video', output: `/home/pi/Videos/video.h264`, width: 640, height: 480, time: 5000, nopreview: true, vflip: true, }); var input = path.join('/home/pi/Videos', 'video.h264'); var output = path.join('/home/pi/Videos', 'daily.gif'); var gif = fs.createWriteStream(output); var options = { speed: 5, text: 'Daily Plant GIF' }; sleep(5000); setInterval(vid, 10000); function vid(){ myCamera.record() .then((result) => { console.log('success'); gifify(input, options).pipe(gif); }) .catch((error) => { console.log(error); }); } 

any information on what this error truly means in this scenario/ how to fix it would be much appreciated. 任何有关此错误在此情况下真正意味着什么/如何解决的信息,将不胜感激。 Thank you! 谢谢!

an error can be related not to your code only but also to libraries you are using. 错误可能不仅与您的代码有关,而且还与您正在使用的库有关。

I see at least few issues been reported to gifyfy about "maximum stack exceeded" open one: https://github.com/vvo/gifify/issues/94 我看到至少有一些问题报告给gifyfy有关“超出最大堆栈”的问题之一: https : //github.com/vvo/gifify/issues/94

I'm not sure if there is any workaround in your case. 我不确定您的情况是否有任何解决方法。 maybe you need trying different parameters or look for different library 也许您需要尝试不同的参数或寻找不同的库

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM