Class: LaserBlob::Blob::Video
Instance Attribute Summary
#data
Class Method Summary
collapse
Instance Method Summary
collapse
#extension, #file, #file=, new, #open, #url, #url=
#file_content_type, #file_sha1, filename_from_file
Class Method Details
.process(record, path) ⇒ Object
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'app/models/laserblob/blob/video.rb', line 29
def self.process(record, path)
require 'streamio-ffmpeg' unless defined?(FFMPEG)
video = FFMPEG::Movie.new(path)
record.metadata = {
'duration' => video.duration,
'bitrate' => video.bitrate,
'codec' => video.video_codec,
'width' => video.width,
'height' => video.height,
'frame_rate' => video.frame_rate
}
end
|
Instance Method Details
#bitrate ⇒ Object
17
18
19
|
# File 'app/models/laserblob/blob/video.rb', line 17
def bitrate
metadata['bitrate']
end
|
#codec ⇒ Object
21
22
23
|
# File 'app/models/laserblob/blob/video.rb', line 21
def codec
metadata['codec']
end
|
#duration ⇒ Object
13
14
15
|
# File 'app/models/laserblob/blob/video.rb', line 13
def duration
metadata['duration']
end
|
#frame_rate ⇒ Object
25
26
27
|
# File 'app/models/laserblob/blob/video.rb', line 25
def frame_rate
metadata['frame_rate']
end
|
#height ⇒ Object
9
10
11
|
# File 'app/models/laserblob/blob/video.rb', line 9
def height
metadata['height']
end
|
#width ⇒ Object
5
6
7
|
# File 'app/models/laserblob/blob/video.rb', line 5
def width
metadata['width']
end
|