我想从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的文件夹中的错误
发布评论