找不到ffmpeg的文件夹中的错误

编程入门 行业动态 更新时间:2024-10-28 12:21:13
本文介绍了找不到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的文件夹中的错误

本文发布于:2023-11-13 10:07:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1584091.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:找不到   错误   文件   夹中   ffmpeg

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!