1

I can give ffmpeg videos to convert via command line, and it converts them happily, but when I ask it to convert things in rails, it returns "Unknown encoder libfaac" no matter the video I give it.

I call it using this line: process encode_video: [:mp4, resolution: "640x480"]

I've already spent hours trying to (unsuccessfully) compile ffmpeg with libfaac on Windows, but now it just seems ridiculous, because not everything I pass it is even aac. What's going on?

Olga
  • 186
  • 3
  • 15
  • 1
    Does your ffmpeg build include `--enable-libfaac --enable-nonfree`? This is doubtful (due to `--enable-nonfree`) unless you compiled ffmpeg yourself. Why not use a different AAC encoder? – llogan Nov 05 '13 at 23:19

2 Answers2

5

In uploader/video_uploader.rb add these lines

version :mp4 do
   process :encode_video=> [:mp4, audio_codec: "aac",:custom => "-strict experimental -q:v 5 -preset slow -g 30"]
end
akshay
  • 1,151
  • 1
  • 19
  • 31
1

I fixed it! For some reason it was always using libfaac. I fixed this by adding audio_codec: "aac", custom: "-strict experimental -q:v 5 -preset slow -g 30" to the arguments of encode_video.

Olga
  • 186
  • 3
  • 15