vollbremsung 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +3 -2
- data/bin/vollbremsung +54 -46
- data/lib/vollbremsung.rb +3 -2
- data/vollbremsung.gemspec +2 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YWY1NjRkYzg4YzQ0MjA3MmQ3NmZkZDVhYWEwYWY4NTczODgwNDIzYw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NmU3ZjYzNDIyYjk4MGQ2NjhmYmQ5MWMyMWViZTM3YjZhZWM3MTkzNw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Yjg2MWViYzg0NGRhZjczZjQ4ZmY2ZGZhZjZhMjM4N2FkYmRlMDk5NjM2MTFi
|
10
|
+
MjdjNDE0NWI3Mzg0MjhjYjhiMmY0Y2Y0MTZlODgwZDE0YWI3OWM4ZjcwZmU3
|
11
|
+
NjYxYjZjMWM1YzBkNWZlYTE4OWU5M2NkY2M0MTY0NzIxYTFjZGM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MzNlYjM0Y2E2ZGMxOTE1ZmNlOWExOTI0M2ZjNDhjMDE3YmUwYmEwNDUzMmRj
|
14
|
+
NDNhZmQ2NzcyMmY5M2Y5YTQyNmYwMGZlYTAzYmIwYTM4ODBkZmViZDBjOTIz
|
15
|
+
ZTdiNzdkMzljZDI5MWQwN2QxYjYyYTE3NzgzMzBmMmI4YjBjZTQ=
|
data/README.md
CHANGED
data/bin/vollbremsung
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
require 'mkmf' # part of stdlib
|
5
5
|
require 'open3'
|
6
6
|
require 'json'
|
7
|
+
require 'optparse'
|
7
8
|
require 'handbrake'
|
8
9
|
require 'vollbremsung'
|
9
10
|
|
@@ -22,45 +23,47 @@ def ffprobe(file)
|
|
22
23
|
end
|
23
24
|
|
24
25
|
options = {}
|
25
|
-
begin
|
26
|
-
require 'optparse'
|
27
|
-
OptionParser.new do |opts|
|
28
|
-
opts.banner = Vollbremsung::USAGE
|
29
|
-
opts.separator ""
|
30
|
-
|
31
|
-
opts.on("-d", "--delete", "Delete source files after successful encoding") do |flag|
|
32
|
-
options[:delete] = true
|
33
|
-
end
|
34
26
|
|
35
|
-
|
36
|
-
|
37
|
-
|
27
|
+
OptionParser.new do |opts|
|
28
|
+
opts.banner = Vollbremsung::USAGE
|
29
|
+
opts.separator ""
|
38
30
|
|
39
|
-
|
40
|
-
|
41
|
-
|
31
|
+
opts.on("-d", "--delete", "Delete source files after successful encoding") do |flag|
|
32
|
+
options[:delete] = true
|
33
|
+
end
|
42
34
|
|
43
|
-
|
44
|
-
|
45
|
-
|
35
|
+
opts.on("--list-only", "List matching files only. Do not run processing") do |flag|
|
36
|
+
options[:list_only] = true
|
37
|
+
end
|
46
38
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
39
|
+
opts.on("-m", "--move", "Move source files to <FILENAME>.old after successful encoding") do |flag|
|
40
|
+
options[:move] = true
|
41
|
+
end
|
42
|
+
|
43
|
+
opts.on("-r", "--recursive", "Process all file in subdirectories recursively as well") do |flag|
|
44
|
+
options[:recursive] = true
|
45
|
+
end
|
46
|
+
|
47
|
+
opts.on("-t", "--title", "Set the mp4 title to the filename") do |flag|
|
48
|
+
options[:title] = true
|
49
|
+
end
|
50
|
+
|
51
|
+
opts.on("--x264-preset [PRESET]", "Set the x264-preset. Default is: #{Vollbremsung::X264_DEFAULT_PRESET}") do |preset|
|
52
|
+
options[:x264_preset] = preset
|
53
|
+
end
|
54
|
+
|
55
|
+
opts.on_tail("-h", "--help", "Show this message") do
|
56
|
+
puts opts
|
57
|
+
exit
|
58
|
+
end
|
59
|
+
end.parse! # do the parsing. do it now!
|
60
|
+
|
61
|
+
|
62
|
+
options[:x264_preset] = Vollbremsung::X264_DEFAULT_PRESET if options[:x264_preset].nil?
|
60
63
|
|
61
64
|
|
62
65
|
if ARGV[0].nil?
|
63
|
-
puts "No target
|
66
|
+
puts "No target provided."
|
64
67
|
puts Vollbremsung::USAGE
|
65
68
|
exit 1
|
66
69
|
end
|
@@ -78,21 +81,24 @@ if options[:move] && options[:delete]
|
|
78
81
|
exit 1
|
79
82
|
end
|
80
83
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
84
|
+
# probe for required executable
|
85
|
+
# only do this if not in list-only mode
|
86
|
+
unless options[:list_only]
|
87
|
+
unless find_executable('HandbrakeCLI') || find_executable('HandBrakeCLI')
|
88
|
+
puts "It seems you do not have HandbrakeCLI installed or it is not available in your $PATH."
|
89
|
+
puts "You can get the executable from http://handbrake.fr/downloads.php"
|
90
|
+
exit 1
|
91
|
+
end
|
86
92
|
|
87
|
-
unless find_executable 'ffprobe'
|
88
|
-
|
89
|
-
|
90
|
-
|
93
|
+
unless find_executable 'ffprobe'
|
94
|
+
puts "It seems you do not have ffprobe installed or it is not available in your $PATH."
|
95
|
+
puts "ffprobe is part of ffmpeg. Install it for your system and run again."
|
96
|
+
exit 1
|
97
|
+
end
|
91
98
|
end
|
92
99
|
|
93
|
-
File.delete 'mkmf.log' # find_executable seems to create such file in case executable is not found
|
94
100
|
|
95
|
-
#
|
101
|
+
File.delete 'mkmf.log' rescue nil# find_executable seems to create such file in case executable is not found
|
96
102
|
|
97
103
|
#HANDBRAKE_OPTIONS = "--encoder x264 --quality 20.0 --aencode faac -B 160 --mixdown dpl2 --arate Auto -D 0.0 --format mp4 --markers --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 --x264-preset veryfast --loose-anamorphic --modulus 2"
|
98
104
|
|
@@ -117,6 +123,8 @@ else
|
|
117
123
|
target_files << File.absolute_path(TARGET_PATH)
|
118
124
|
end
|
119
125
|
|
126
|
+
exit if options[:list_only]
|
127
|
+
|
120
128
|
target_files.each do |infile|
|
121
129
|
|
122
130
|
metadata = ffprobe(infile)
|
@@ -163,7 +171,7 @@ target_files.each do |infile|
|
|
163
171
|
begin
|
164
172
|
HandBrake::CLI.new.input(infile).encoder('x264').quality('20.0').aencoder('faac').
|
165
173
|
ab('160').mixdown('dpl2').arate('Auto').drc('0.0').format('mp4').markers.
|
166
|
-
audio_copy_mask('aac,ac3,dtshd,dts,mp3').audio_fallback('ffac3').x264_preset(
|
174
|
+
audio_copy_mask('aac,ac3,dtshd,dts,mp3').audio_fallback('ffac3').x264_preset(options[:x264_preset]).
|
167
175
|
loose_anamorphic.modulus('2').audio((1..astreams.count).to_a.join(',')).aname(astreams.names.join(',')).
|
168
176
|
subtitle((1..sstreams.count).to_a.join(',')).output(outfile)
|
169
177
|
|
@@ -181,7 +189,7 @@ target_files.each do |infile|
|
|
181
189
|
log "compression ratio: %.2f" % (outfile_size.to_f / infile_size.to_f)
|
182
190
|
|
183
191
|
if options[:title]
|
184
|
-
log "setting
|
192
|
+
log "setting MP4 title"
|
185
193
|
|
186
194
|
infile_noext = File.join( File.dirname(infile), File.basename(infile,File.extname(infile)))
|
187
195
|
tmpfile = infile_noext + ".tmp.mp4"
|
@@ -196,7 +204,7 @@ target_files.each do |infile|
|
|
196
204
|
log "ERROR: moving #{tmpfile} to #{outfile}"
|
197
205
|
end
|
198
206
|
else
|
199
|
-
log "ERROR:
|
207
|
+
log "ERROR: MP4 title could not be changed"
|
200
208
|
end
|
201
209
|
end # if options[:title]
|
202
210
|
|
data/lib/vollbremsung.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
module Vollbremsung
|
2
2
|
|
3
3
|
USAGE = "Usage: vollbremsung [options] <target>"
|
4
|
-
VERSION = '0.0.
|
5
|
-
CONVERT_TYPES = ['mkv','avi','mov','flv','mpg','wmv']
|
4
|
+
VERSION = '0.0.9'
|
5
|
+
CONVERT_TYPES = ['mkv','avi','mov','flv','mpg','wmv','ogm']
|
6
6
|
FFMPEG_OPTIONS = "-map 0 -acodec copy -vcodec copy -scodec copy"
|
7
|
+
X264_DEFAULT_PRESET = "veryfast"
|
7
8
|
|
8
9
|
class StreamDescr < Struct.new(:count,:names)
|
9
10
|
def initialize
|
data/vollbremsung.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vollbremsung
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maximilian Irro
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '0.4'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '0.4'
|
27
27
|
description: Handbrake bulk encoding tool
|
28
28
|
email: max@disposia.org
|
29
29
|
executables:
|