stack-encode 0.0.3 → 0.1.0
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/lib/stack-encode/cli.rb +12 -9
- data/lib/stack-encode/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64ccddd8fef6759a87f2f1ebd6429e81b26fe835
|
4
|
+
data.tar.gz: df45271c9a0423dbcac39ada702a4def6a401872
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48e0dd78a7d60f81378d3af5c60ca61a6ee04e6e3fdf2f88ae0aac5a83439229ded6fe4463757c4620d66e9558b5733caa53c36e3aa1863eeff1c8f87ea4d97d
|
7
|
+
data.tar.gz: d21335014780084563894087d0d5385b1c9fe3c13f02b420a0b9d52eec88cc0f198aae67e40e4c42b4956f8cb084aab705c8415daefb256b11dca9a057ad569d
|
data/lib/stack-encode/cli.rb
CHANGED
@@ -40,8 +40,8 @@ module StackEncode
|
|
40
40
|
desc: "log file path",
|
41
41
|
aliases: '-l',
|
42
42
|
default: '/dev/null'
|
43
|
-
option :
|
44
|
-
desc: "
|
43
|
+
option :progress,
|
44
|
+
desc: "show encoding progress",
|
45
45
|
type: :boolean,
|
46
46
|
default: true
|
47
47
|
def encode(*files)
|
@@ -54,15 +54,19 @@ module StackEncode
|
|
54
54
|
movie = FFMPEG::Movie.new(source)
|
55
55
|
dest_format = movie.video_stream ? options[:video_format] : options[:audio_format]
|
56
56
|
dest_dir = options[:destination] || File.dirname(source)
|
57
|
-
|
57
|
+
filename = File.basename(source, File.extname(source)) + ".#{dest_format}"
|
58
|
+
banner = "Encoding #{File.basename(source)} to #{dest_format.upcase} ==> #{filename}"
|
59
|
+
puts banner unless options[:progress]
|
58
60
|
transcoded_movie = movie.transcode(
|
59
61
|
File.expand_path(
|
60
|
-
"#{dest_dir}/" +
|
61
|
-
File.extname(source)
|
62
|
-
) + ".#{dest_format}"
|
62
|
+
"#{dest_dir}/" + filename
|
63
63
|
)
|
64
|
-
)
|
65
|
-
|
64
|
+
) do |progress|
|
65
|
+
if options[:progress]
|
66
|
+
print_progress(progress * 100, banner)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
puts if options[:progress]
|
66
70
|
transcoded_movie
|
67
71
|
end
|
68
72
|
end
|
@@ -74,7 +78,6 @@ module StackEncode
|
|
74
78
|
printf (progress < 100 ? " %02d\%" : " %3d\%"), progress
|
75
79
|
$stdout.flush
|
76
80
|
end
|
77
|
-
|
78
81
|
end
|
79
82
|
end
|
80
83
|
end
|
data/lib/stack-encode/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stack-encode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nik Wolfgramm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|