stack-encode 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 56f2900c4cca6a3104b99aba5136a36f65eb6a5b
4
- data.tar.gz: 5fbdafecde4ae7949c24557af9488f65ea08e099
3
+ metadata.gz: 64ccddd8fef6759a87f2f1ebd6429e81b26fe835
4
+ data.tar.gz: df45271c9a0423dbcac39ada702a4def6a401872
5
5
  SHA512:
6
- metadata.gz: 4ba7af04e39e12c2c6319c650b9966cdaed35360a7e90b8eed866e0e7619868040d1bd650b6c2898d76bc36a6726c0899b3760f976244b66f43c8b0827c04dec
7
- data.tar.gz: e9847010d1d6e85e98b0bd2fd563f690103b45fdecc5af19eda4472fb2c3f2e0de4738b4bb5b1ee495d5bacfda3f124b37022884a74e8371b757d9c980a4602f
6
+ metadata.gz: 48e0dd78a7d60f81378d3af5c60ca61a6ee04e6e3fdf2f88ae0aac5a83439229ded6fe4463757c4620d66e9558b5733caa53c36e3aa1863eeff1c8f87ea4d97d
7
+ data.tar.gz: d21335014780084563894087d0d5385b1c9fe3c13f02b420a0b9d52eec88cc0f198aae67e40e4c42b4956f8cb084aab705c8415daefb256b11dca9a057ad569d
@@ -40,8 +40,8 @@ module StackEncode
40
40
  desc: "log file path",
41
41
  aliases: '-l',
42
42
  default: '/dev/null'
43
- option :verbose,
44
- desc: "verbose mode",
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
- banner = "Encoding #{File.basename(source)} to #{dest_format.upcase}"
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}/" + File.basename(source,
61
- File.extname(source)
62
- ) + ".#{dest_format}"
62
+ "#{dest_dir}/" + filename
63
63
  )
64
- ) { |progress| print_progress(progress * 100, banner) if options[:verbose] }
65
- puts if options[:verbose]
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
@@ -1,3 +1,3 @@
1
1
  module StackEncode
2
- VERSION = "0.0.3"
2
+ VERSION = "0.1.0"
3
3
  end
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.3
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-27 00:00:00.000000000 Z
11
+ date: 2014-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor