title: ruby on rails carrierwave-video ffmpeg AWS
body: <p>I am trying to create an academic site where users can upload lecture videos and other users can view them - similar to a site like Udemy.</p>
  
  <p>I am using Carrierwave, Carrierwave-video (for encoding videos), AWS to make this happen. AWS configuration has been done, and it's working.</p>
  
  <p>However, I am getting this error. (By the way, I am testing this video feature in a Yelpdemo site, so I am trying to have users upload videos to restaurants for now.)</p>
  
  <p>rails points the error to @restaurant = Restaurant.new(restaurant_params) </p>
  
  <p>Errno::ENOENT in RestaurantsController#create</p>
  
  <p>No such file or directory - ffmpeg</p>
  
  <p># POST /restaurants.json
    def create
      @restaurant = Restaurant.new(restaurant_params)</p>
  
  <pre><code>respond_to do |format|
    if @restaurant.save
  </code></pre>
  
  <p>This is my video_uploader.rb</p>
  
  <pre><code># encoding: utf-8
  
  class VideoUploader &lt; CarrierWave::Uploader::Base
  
    include CarrierWave::Video
    include CarrierWave::Video::Thumbnailer
  
    process encode_video: [:mp4]
  
    include CarrierWave::MiniMagick
  
    storage :fog
  
    def store_dir
      "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
    end
  
     version :thumb do
        process thumbnail: [{format: 'png', quality: 10, size: 192, strip: true, logger: Rails.logger}]
        def full_filename for_file
          png_name for_file, version_name
        end
    end
  
      def png_name for_file, version_name
        %Q{#{version_name}_#{for_file.chomp(File.extname(for_file))}.png}
      end
  end
  </code></pre>
  
  <p>I have manually (added a file to the model) created video.rb in the model - not sure if this is the right way to do it..</p>
  
  <pre><code>class Video &lt; ActiveRecord::Base
  
    attr_accessor :user_id, :video,, :type, :filename, :path, :filesize, :width, :height, :duration, :bit_rate
  
    belongs_to :restaurant
    belongs_to :user
  
    mount_uploader :video, VideoUploader
  end
  </code></pre>
  
  <p>in app/views/restaurants/show.html.erb  for showing the video. Right now, without the encoding done, I can see like an image of the video. When I right lick and copy the code - it gives me the AWS URL which means AWS configuration is in place</p>
  
  <pre><code>        &lt;p&gt;
              &lt;strong&gt;Video:&lt;/strong&gt;
              &lt;%= video_tag @restaurant.video_url %&gt;
          &lt;/p&gt;
  </code></pre>
  
  <p>I am trying to show videos like this.</p>
  
  <p>I have downloaded FFMPEG (both ffmpeg-2.6 and SnowLeopard_Lion_Mountain_Yosemite_17) - not sure which one's the right one.. And I have read somewhere that you need to place FFMPEG in your usr/local/bin   -> So do you have to physically place ffmpeg exec file in your respective folder?</p>
  
  <p>Need your expert help please.</p>
  
  <p>Thank you in advance!</p>