我无法使用streamio ffmpeg获取视频缩略图

我无法使用streamio ffmpeg获取视频缩略图,ffmpeg,video-thumbnails,Ffmpeg,Video Thumbnails,谁能给我解释一下吗 def gen_video_thumb(width, height) directory = File.dirname(current_path) tmpfile = File.join(directory, "tmpfile") FileUtils.move(current_path, tmpfile) file = ::FFMPEG::Movie.new(tmpfile)

谁能给我解释一下吗

 def gen_video_thumb(width, height)
          directory = File.dirname(current_path)
          tmpfile = File.join(directory, "tmpfile")
          FileUtils.move(current_path, tmpfile)
          file = ::FFMPEG::Movie.new(tmpfile)
          file.transcode(current_path, "-ss 00:00:01 -an -r 1 -vframes 1 -s #{width}x#{height}")
          FileUtils.rm(tmpfile)
        end
特别是这个

file.transcode(当前路径,“-ss00:00:01-an-r1-vframes 1-s{width}x{height}”)
line

有关详细代码,您可以查看此链接。

这里到底有什么问题?如果您遇到ffmpeg问题,则必须包含完整的ffmpeg控制台输出。我没有问题,它工作正常,但只想知道file.transcoder方法在给定参数下的用途。