简体   繁体   English

在ubuntu和node.js上设置ffmpeg

[英]setup ffmpeg on ubuntu and node.js

I am new to ubuntu and I am struggling in setting up ffmpeg installation on the ubuntu server. 我是ubuntu的新手,我正在努力在ubuntu服务器上设置ffmpeg安装。 I have install the ffmpeg on ubuntu and also I can see it by issuing a command ffmpeg -v. 我已经在ubuntu上安装了ffmpeg,也可以通过发出命令ffmpeg -v看到它。 I have done the development in node.js in windows and specify the path of ffmpeg. 我已经在Windows的node.js中完成了开发工作,并指定了ffmpeg的路径。 Below is the path of window in node.js: 以下是node.js中窗口的路径:

proc.setFfmpegPath("D:\\abc\\ffmpeg-20121120-git-8b6aeb1-win64-static\\bin\\ffmpeg.exe");

but now I have to specify the path for ffmpeg for ubuntu in my node.js code. 但是现在我必须在node.js代码中为ubuntu指定ffmpeg的路径。

proc.setFfmpegPath("/usr/bin/ffmpeg/ffmpeg");

it says Uncaught Error: spawn ENOTDIR 它说未捕获的错误:生成ENOTDIR

Even though I have tried with this path: 即使我尝试使用此路径:

proc.setFfmpegPath("/usr/bin/ffmpeg");

then it says An error happened: ffmpeg exited with code 1 然后它说发生了错误:ffmpeg退出,代码为1

Also I have run this command "whereis ffmpeg" and it says "/usr/bin/ffmpeg" 我也已经运行了这个命令“ whereis ffmpeg”,它说“ / usr / bin / ffmpeg”

Any help is very much appreciated 很感谢任何形式的帮助

This one is correct: 这是正确的:

proc.setFfmpegPath("/usr/bin/ffmpeg");

It is returning error code 1, which means that it is executing the ffmpeg but ffmpeg is not successfully running to completion. 它返回错误代码1,表示它正在执行ffmpeg但是ffmpeg没有成功运行到完成。 Try running it on the command line to see if there are any obvious problems. 尝试在命令行上运行它,看是否有明显的问题。 If that doesn't work, you'll have to dig in with some more logging and/or debugging. 如果这不起作用,则必须深入进行更多日志记录和/或调试。

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

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