gpt4 book ai didi

ruby-on-rails - FFMPEG 说文件不存在,但是,它存在

转载 作者:行者123 更新时间:2023-12-01 03:52:56 24 4
gpt4 key购买 nike

我正在通过 streamio-FFMPEG Rails gem 使用 FFMPEG – https://github.com/streamio/streamio-ffmpeg

出于某种原因,当尝试对视频文件(确实存在)进行转码时,FFMPEG 说该文件不存在。

这是 Rails 控制台的一些输出,显示了我的头痛:

1.9.3p125 :001 > File.exist?("/Applications/MAMP/htdocs/video-app/public/uploads/tmp/20131208-1416-1234-0984/videotest.mp4")
=> true

1.9.3p125 :002 > FFMPEG::Movie.new("/Applications/MAMP/htdocs/video-app/public/uploads/tmp/20131208-1416-1234-0984/videotest.mp4")
Errno::ENOENT: No such file or directory - ffmpeg -i /Applications/MAMP/htdocs/video-app/public/uploads/tmp/20131208-1416-1234-0984/videotest.mp4
from /Users/my-comp/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/open3.rb:202:in `spawn'
from /Users/my-comp/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/open3.rb:202:in `popen_run'
from /Users/my-comp/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/open3.rb:90:in `popen3'
from /Users/my-comp/.rvm/gems/ruby-1.9.3-p125@video-app/gems/streamio-ffmpeg-1.0.0/lib/ffmpeg/movie.rb:17:in `initialize'
from (irb):2:in `new'
from (irb):2
from /Users/my-comp/.rvm/gems/ruby-1.9.3-p125@video-app/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in `start'
from /Users/my-comp/.rvm/gems/ruby-1.9.3-p125@video-app/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start'
from /Users/my-comp/.rvm/gems/ruby-1.9.3-p125@video-app/gems/railties-3.2.8/lib/rails/commands.rb:41:in `<top (required)> '
from script/rails:6:in `require'
from script/rails:6:in `<main>'
1.9.3p125 :003 >

任何帮助,将不胜感激。

最佳答案

好像找不到 ffmpeg二进制文件本身,而不是您指定的文件。在调用构造函数之前尝试设置 FFMPEG 的完整路径:

FFMPEG.ffmpeg_binary = '/usr/local/bin/ffmpeg'

关于ruby-on-rails - FFMPEG 说文件不存在,但是,它存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20459482/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com