找不到ffmpeg的文件夹中的错误 [英] Can't find ffmpeg folder error

查看:789
本文介绍了找不到ffmpeg的文件夹中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从YouTube下载音乐和转换下载的.MP4为.mp3,但是我不断收到


  

错误:ffmpeg的退出,code 1:./songs/Battle-Scars.mp4:处理输入时发现无效数据


下面是code

  VAR PROC =新的ffmpeg({来源:./songs/Battle-Scars.mp4'})
  .withAudio codeC('了libmp3lame')
  .toFormat(MP3)
  .saveToFile('./歌曲/争斗Scars.mp4'功能(标准输出,标准错误){
    的console.log('文件已成功转换');
  });

在YouTube - > MP4转换工作正常,当我尝试转换成MP3误差只有发生。我AP preciate所有
 帮助和提前感谢!


  

编辑:当我加入的ffmpeg到的.bash_profile它的工作。感谢所有帮助!



解决方案

来表示你的主目录仅适用于你的shell。相反,试试这个:

  proc.setFfmpegPath(process.env.HOME +'/ local / bin目录/的ffmpeg');

I am trying to download music from youtube and convert the downloaded .mp4 to .mp3 however I keep getting

Error: ffmpeg exited with code 1: ./songs/Battle-Scars.mp4: Invalid data found when processing input

Here is the code

var proc = new ffmpeg({ source: './songs/Battle-Scars.mp4'})
  .withAudioCodec('libmp3lame')
  .toFormat('mp3')
  .saveToFile('./songs/Battle-Scars.mp4', function(stdout, stderr) {
    console.log('file has been converted succesfully');
  });

The youtube -> mp4 conversion works fine, The error is only occurring when I try to convert to mp3. I appreciate all the help and thanks in advance!

Edit: Once I added ffmpeg to bash_profile it worked. Thanks for all the help!

解决方案

The ~ to signify your home dir only works in your shell. Instead, try this:

proc.setFfmpegPath(process.env.HOME + '/local/bin/ffmpeg');

这篇关于找不到ffmpeg的文件夹中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆