I am trying to create an academic site where users can upload lecture videos, while other users can view them - like the Udemy site.
I use Carrierwave, Carrierwave-video (for video encoding), AWS to make this happen. AWS configuration has been completed and it works.
However, I get this error. (By the way, I'm testing this video feature on the Yelpdemo website, so now I'm trying to get users to upload videos to restaurants.)
rails indicate error at @restaurant = Restaurant.new (restaurant_params)
Errno :: ENOENT at RestaurantsController # create
No such file or directory - ffmpeg
# POST / restaurants.json def create @restaurant = Restaurant.new (restaurant_params)
respond_to do |format|
if @restaurant.save
This is my video_uploader.rb
class VideoUploader < 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
( ), video.rb - , .
class Video < 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
/views/restaurants/show.html.erb . , , . - URL AWS, , AWS
<p>
<strong>Video:</strong>
<%= video_tag @restaurant.video_url %>
</p>
, .
FFMPEG ( ffmpeg-2.6 SnowLeopard_Lion_Mountain_Yosemite_17) - , . - , FFMPEG usr/local/bin → ffmpeg exec ?
.
!