Replace streamio-ffmpeg library.
Replace the streamio-ffmpeg library with our own very thin FFmpeg wrapper.
This commit is contained in:
@@ -3,14 +3,12 @@
|
||||
#
|
||||
# @see https://github.com/streamio/streamio-ffmpeg
|
||||
class MediaFile::Video < MediaFile
|
||||
delegate :duration, :has_audio?, to: :video
|
||||
|
||||
def dimensions
|
||||
[video.width, video.height]
|
||||
end
|
||||
|
||||
def duration
|
||||
video.duration
|
||||
end
|
||||
|
||||
def preview(max_width, max_height)
|
||||
preview_frame.preview(max_width, max_height)
|
||||
end
|
||||
@@ -19,20 +17,14 @@ class MediaFile::Video < MediaFile
|
||||
preview_frame.crop(max_width, max_height)
|
||||
end
|
||||
|
||||
def has_audio?
|
||||
video.audio_channels.present?
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def video
|
||||
raise NotImplementedError, "can't process videos: ffmpeg or mkvmerge not installed" unless self.class.videos_enabled?
|
||||
|
||||
FFMPEG::Movie.new(file.path)
|
||||
FFmpeg.new(file)
|
||||
end
|
||||
|
||||
def preview_frame
|
||||
FFmpeg.new(file).smart_video_preview
|
||||
video.smart_video_preview
|
||||
end
|
||||
|
||||
memoize :video, :preview_frame, :dimensions, :duration, :has_audio?
|
||||
|
||||
Reference in New Issue
Block a user