As suggested by @Mulvya and @estus, the correct parameter is -i - (to enable input from stdin):'use strict';var cp = require('child_process');var proc = cp.spawn('ffmpeg', [ '-hide_banner', '-f', 'rawvideo', '-pix_fmt', 'rgb24', '-s', '2x2', '-i', '-', '1.png']);proc.stdin.write(Buffer.from([ 255, 0, 0, 0, 255, 0, 0, 255, 255, 255, 0, 255]));proc.stdin.end();proc.stderr.pipe(process.stdout);它产生此图像: 它也适用于动画.It produces this image:It works for animations too.感谢大家的帮助! 这篇关于Node.js-将数据缓冲到Ffmpeg的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-16 03:41
查看更多