carrierwave_streamio_ffmpeg 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/README.md +1 -1
- data/lib/carrierwave_streamio_ffmpeg/options.rb +17 -5
- data/lib/carrierwave_streamio_ffmpeg/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ee737c2a9c2cd247d4d875844130b4e6cccde3b7
|
|
4
|
+
data.tar.gz: 49bf242a10461cd515fe084f8f9e2fa6ef3ca179
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: df7b2b79b2469636bc3b2c92c6c3754c56cdf9f27a5da77acaaba0b43e4ffdf7e3c91dc227d8fe46c8cf1f2e25521ada7a2c7687cd253e070f60805dd1fdb5aa
|
|
7
|
+
data.tar.gz: 6141eccdc70c3eb497aa3dc6effa633a7df3fead2616332800cee42ae59b14b4a49dddf0f1077fb213bb68e21694f491250db81915afcfe1ac23bf88b8eb49b3
|
data/.gitignore
CHANGED
data/README.md
CHANGED
|
@@ -46,7 +46,7 @@ The options are passed as hash to this function, can be also empty.
|
|
|
46
46
|
The options are:
|
|
47
47
|
* format - format of the output video, possible options are mp4, webm and ogv
|
|
48
48
|
* resolution - resolution if output file, possible values are p240, p360, p480, p720, p1080 and p2160
|
|
49
|
-
* quality - Quality of the file to be saved, possible values are low, med, and
|
|
49
|
+
* quality - Quality of the file to be saved, possible values are very_low, low, med, high and very_high.
|
|
50
50
|
* preserve_aspect_ratio - value to be preserved when correcting aspect ration, possible values :width and :height.
|
|
51
51
|
|
|
52
52
|
## Contributing
|
|
@@ -6,7 +6,7 @@ module CarrierwaveStreamioFfmpeg
|
|
|
6
6
|
opts[:video_bitrate] = set_video_quality(opts, file)
|
|
7
7
|
opts[:frame_rate] = set_video_frames(opts, file)
|
|
8
8
|
opts[:audio_bitrate] = set_audio_quality(opts, file)
|
|
9
|
-
opts[:threads] =
|
|
9
|
+
opts[:threads] = 1
|
|
10
10
|
format = opts[:format]
|
|
11
11
|
opts = opts.except(:quality, :preserve_aspect_ratio, :format)
|
|
12
12
|
opts.merge!(codec(format))
|
|
@@ -14,11 +14,15 @@ module CarrierwaveStreamioFfmpeg
|
|
|
14
14
|
|
|
15
15
|
def set_video_frames(opts, file)
|
|
16
16
|
case opts[:quality]
|
|
17
|
+
when :very_low
|
|
18
|
+
15
|
|
17
19
|
when :low
|
|
18
|
-
|
|
20
|
+
24
|
|
19
21
|
when :med
|
|
20
|
-
|
|
22
|
+
25
|
|
21
23
|
when :high
|
|
24
|
+
30
|
|
25
|
+
when :very_high
|
|
22
26
|
60
|
|
23
27
|
else
|
|
24
28
|
file.frame_rate
|
|
@@ -27,12 +31,16 @@ module CarrierwaveStreamioFfmpeg
|
|
|
27
31
|
|
|
28
32
|
def set_audio_quality(opts, file)
|
|
29
33
|
case opts[:quality]
|
|
34
|
+
when :very_low
|
|
35
|
+
64
|
|
30
36
|
when :low
|
|
31
37
|
96
|
|
32
38
|
when :med
|
|
33
39
|
128
|
|
34
40
|
when :high
|
|
35
41
|
256
|
|
42
|
+
when :very_high
|
|
43
|
+
320
|
|
36
44
|
else
|
|
37
45
|
(file.audio_bitrate)/100
|
|
38
46
|
end
|
|
@@ -40,11 +48,15 @@ module CarrierwaveStreamioFfmpeg
|
|
|
40
48
|
|
|
41
49
|
def set_video_quality(opts, file)
|
|
42
50
|
case opts[:quality]
|
|
51
|
+
when :very_low
|
|
52
|
+
128
|
|
43
53
|
when :low
|
|
44
|
-
|
|
54
|
+
384
|
|
45
55
|
when :med
|
|
46
|
-
|
|
56
|
+
1250
|
|
47
57
|
when :high
|
|
58
|
+
5000
|
|
59
|
+
when :very_high
|
|
48
60
|
15000
|
|
49
61
|
else
|
|
50
62
|
(file.video_bitrate)/100
|