jan*_*s86 3 ffmpeg path binaries node.js
我正在构建一个使用模块node-fluent-ffmpeg的应用程序.https://github.com/schaermu/node-fluent-ffmpeg
我正在尝试将ffmpeg二进制文件与我的应用程序一起打包.我想这样做(特别是在Windows上),用户不必手动安装FFMPEG.
可悲的是,我尝试的一切都会导致错误.我尝试过以下方法:
ffmpeg.setFfmpegPath : Gives an error saying setFfmpegPath is not a method
Run Code Online (Sandbox Code Playgroud)
和:
proc.setFfmpegPath : Gives a createproces error.
Run Code Online (Sandbox Code Playgroud)
看来我做错了什么.有人可以指出我的错误.非常感谢.
我修理它!我不知道我必须在路径中包含二进制文件.所以我做了这样的事情:
if(os.platform() === 'win32'){
var ffmpegPath = './bin/ffmpeg/ffmpeg.exe'
}else{
var ffmpegPath = './bin/ffmpeg/ffmpeg'
}
proc = new ffmpeg({ source: movieUrl, nolog: true, timeout: FFMPEG_TIMEOUT })
proc.setFfmpegPath(ffmpegPath)
proc.addOptions(opts)
proc.writeToStream(response, function(return_code, error){
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4059 次 |
| 最近记录: |