video_transcoding 0.16.0 → 0.17.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/README.md +33 -17
- data/bin/detect-crop +31 -12
- data/bin/transcode-video +10 -10
- data/lib/video_transcoding.rb +0 -1
- data/lib/video_transcoding/crop.rb +22 -11
- data/lib/video_transcoding/version.rb +1 -1
- metadata +2 -3
- data/lib/video_transcoding/mplayer.rb +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1da5b086d8c5b40636f739394d2eaa459f3ef80e
|
4
|
+
data.tar.gz: 27dcf3f30e2fc1ec5950bf52d1b2cfa8f8cf3edd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e40027f639f12299b18d3f315441397b2c81cd537baf6c7b734ba17259e689446db1e3b1413ba1f40de7fab9d48be8b9f2116a2d18f76c1d5d71920897da7c9
|
7
|
+
data.tar.gz: 6e39b8b65e5e7f85478ec6e254ea8b66006bed22d99f8234520908a1fd4205e2f7f88068281acd5223c05bc7a2701fe0f304f4a52bb43370098a8ed1dc995b9a
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ What makes these tools unique is the [special ratecontrol system](#explanation)
|
|
10
10
|
|
11
11
|
This package is based on my original collection of [Video Transcoding Scripts](https://github.com/donmelton/video-transcoding-scripts) written in Bash. While still available online, those scripts are no longer in active development. Users are encouraged to install this Ruby Gem instead.
|
12
12
|
|
13
|
-
Most of the tools in this package are essentially intelligent wrappers around Open Source software like [HandBrake](https://handbrake.fr/), [
|
13
|
+
Most of the tools in this package are essentially intelligent wrappers around Open Source software like [HandBrake](https://handbrake.fr/), [FFmpeg](http://ffmpeg.org/), [MKVToolNix](https://www.bunkus.org/videotools/mkvtoolnix/), and [MP4v2](https://code.google.com/p/mp4v2/). And they're all designed to be executed from the command line shell:
|
14
14
|
|
15
15
|
* [`transcode-video`](#why-transcode-video)
|
16
16
|
Transcode video file or disc image directory into format and size similar to popular online downloads.
|
@@ -64,7 +64,8 @@ Most of the tools in this package require other software to function properly, s
|
|
64
64
|
* `ffmpeg`
|
65
65
|
* `mkvpropedit`
|
66
66
|
* `mp4track`
|
67
|
-
|
67
|
+
|
68
|
+
Previewing the output of `detect-crop` is optional, but doing so uses [`mpv`](https://mpv.io/), a free, Open Source, and cross-platform media player.
|
68
69
|
|
69
70
|
You can download the command line version of HandBrake, called `HandBrakeCLI`, here:
|
70
71
|
|
@@ -76,7 +77,10 @@ On macOS, `HandBrakeCLI` and all its other dependencies can be easily installed
|
|
76
77
|
brew install ffmpeg
|
77
78
|
brew install mkvtoolnix
|
78
79
|
brew install mp4v2
|
79
|
-
|
80
|
+
|
81
|
+
The optional crop previewing package can also be installed via Homebrew:
|
82
|
+
|
83
|
+
brew install mpv
|
80
84
|
|
81
85
|
On Linux, package management systems vary so it's best consult the indexes for those systems. But there's a Homebrew port available called [Linuxbrew](http://linuxbrew.sh/) and it doesn't require root access.
|
82
86
|
|
@@ -124,7 +128,7 @@ HandBrake applies automatic crop detection by default. While it's usually correc
|
|
124
128
|
|
125
129
|
This is why `transcode-video` doesn't allow HandBrake to apply cropping by default.
|
126
130
|
|
127
|
-
Instead, the `detect-crop` tool leverages both HandBrake and
|
131
|
+
Instead, the `detect-crop` tool leverages both HandBrake and FFmpeg to find the video cropping bounds. It then indicates whether those two programs agree. To aid in review, this tool prints commands to the terminal console allowing the recommended (or disputed) crop to be displayed, as well as a sample command line for `transcode-video` itself.
|
128
132
|
|
129
133
|
### Why `convert-video`?
|
130
134
|
|
@@ -222,7 +226,7 @@ You can also call the `detect-crop` logic from `transcode-video` with the single
|
|
222
226
|
|
223
227
|
transcode-video --crop detect "/path/to/Movie.mkv"
|
224
228
|
|
225
|
-
However, be aware that `detect` can fail if HandBrake and
|
229
|
+
However, be aware that `detect` can fail if HandBrake and FFmpeg disagree about the cropping values.
|
226
230
|
|
227
231
|
#### Understanding audio
|
228
232
|
|
@@ -318,34 +322,34 @@ The command to find the video cropping bounds is as simple as:
|
|
318
322
|
|
319
323
|
Which prints out something like this:
|
320
324
|
|
321
|
-
|
322
|
-
|
325
|
+
mpv --no-audio --vf lavfi=[drawbox=0:132:1920:816:invert:1] '/path/to/Movie.mkv'
|
326
|
+
mpv --no-audio --vf crop=1920:816:0:132 '/path/to/Movie.mkv'
|
323
327
|
|
324
328
|
transcode-video --crop 132:132:0:0 '/path/to/Movie.mkv'
|
325
329
|
|
326
330
|
Just copy and paste the sample commands to preview or transcode.
|
327
331
|
|
328
|
-
If HandBrake and
|
332
|
+
If HandBrake and FFmpeg disagree about the cropping values, then `detect-crop` prints out something like this:
|
329
333
|
|
330
334
|
Results differ...
|
331
335
|
|
332
336
|
# From HandBrakeCLI:
|
333
337
|
|
334
|
-
|
335
|
-
|
338
|
+
mpv --no-audio --vf lavfi=[drawbox=0:132:1920:816:invert:1] '/path/to/Movie.mkv'
|
339
|
+
mpv --no-audio --vf crop=1920:816:0:132 '/path/to/Movie.mkv'
|
336
340
|
|
337
341
|
transcode-video --crop 132:132:0:0 '/path/to/Movie.mkv'
|
338
342
|
|
339
|
-
# From
|
343
|
+
# From ffmpeg:
|
340
344
|
|
341
|
-
|
342
|
-
|
345
|
+
mpv --no-audio --vf lavfi=[drawbox=0:130:1920:820:invert:1] '/path/to/Movie.mkv'
|
346
|
+
mpv --no-audio --vf crop=1920:820:0:130 '/path/to/Movie.mkv'
|
343
347
|
|
344
348
|
transcode-video --crop 130:130:0:0 '/path/to/Movie.mkv'
|
345
349
|
|
346
350
|
You'll then need to preview both and decide which to use.
|
347
351
|
|
348
|
-
When input is a disc image directory instead of a single file, the `detect-crop` tool doesn't use
|
352
|
+
When input is a disc image directory instead of a single file, the `detect-crop` tool doesn't use FFmpeg, nor does it print out commands to preview the crop.
|
349
353
|
|
350
354
|
### Using `convert-video`
|
351
355
|
|
@@ -420,7 +424,7 @@ I have four rules when preparing my own media for transcoding:
|
|
420
424
|
|
421
425
|
#### Why a single `.mkv` file?
|
422
426
|
|
423
|
-
* Many automatic behaviors and other features in both `transcode-video` and `detect-crop` are not available when input is a disc image directory. This is because that format limits the ability of `HandBrakeCLI` and `
|
427
|
+
* Many automatic behaviors and other features in both `transcode-video` and `detect-crop` are not available when input is a disc image directory. This is because that format limits the ability of `HandBrakeCLI` and `ffmpeg` to detect or manipulate certain information about the video.
|
424
428
|
|
425
429
|
* Both forced subtitle extraction and lossless audio conversion, detailed below, are not possible when input is a disc image directory.
|
426
430
|
|
@@ -646,7 +650,7 @@ What I don't use are [peak signal-to-noise ratios](https://en.wikipedia.org/wiki
|
|
646
650
|
|
647
651
|
I use the default settings. That's why they're the defaults.
|
648
652
|
|
649
|
-
I never use the `--crop detect` function of `transcode-video` because I don't trust either `HandBrakeCLI` or `
|
653
|
+
I never use the `--crop detect` function of `transcode-video` because I don't trust either `HandBrakeCLI` or `ffmpeg` to always get it right without supervision. Instead, I use the separate `detect-crop` tool before transcoding to manually review and apply the best crop values.
|
650
654
|
|
651
655
|
I let `transcode-video` automatically burn any forced subtitles into the output video track when the "forced" flag is enabled in the original.
|
652
656
|
|
@@ -656,11 +660,23 @@ For a few problematic videos, I have to apply options like `--force-rate 23.976
|
|
656
660
|
|
657
661
|
## History
|
658
662
|
|
663
|
+
### [0.17.0](https://github.com/donmelton/video_transcoding/releases/tag/0.17.0)
|
664
|
+
|
665
|
+
Thursday, February 16, 2017
|
666
|
+
|
667
|
+
* Remove all dependencies on `mplayer`, via #[ #120](https://github.com/donmelton/video_transcoding/issues/120) and #[ #123](https://github.com/donmelton/video_transcoding/issues/123):
|
668
|
+
* Modify `detect-crop` and `transcode-video` to use `ffmpeg` for crop detection instead of `mplayer`.
|
669
|
+
* Modify `detect-crop` to use [`mpv`](https://mpv.io/), a free cross-platform media player, for optional crop preview instead of `mplayer`.
|
670
|
+
* Add a `--player` option to `detect-crop` so `mplayer` can still be used for crop preview commands. Warning: this feature will be deprecated soon.
|
671
|
+
* Update the "README" document to:
|
672
|
+
* Remove any mention of `mplayer` and list `mpv` as an optional package.
|
673
|
+
* Fix typo in version 0.16.0 release information. Thanks, [@samhutchins](https://github.com/samhutchins)!
|
674
|
+
|
659
675
|
### [0.16.0](https://github.com/donmelton/video_transcoding/releases/tag/0.16.0)
|
660
676
|
|
661
677
|
Friday, January 20, 2017
|
662
678
|
|
663
|
-
* Add a `--cvbr` option to `transcode-video`. This is essentially the same as the experimental option of the same name which was removed on February 25, 2016, but now it doesn't have a bitrate argument. It enables a _simple_ constrained variable bitrate (CVBR) ratecontrol system, less constrained the default, producing a more predictable output size while avoiding `VBV underflow` warnings. Use it with `--target big` for the best results.
|
679
|
+
* Add a `--cvbr` option to `transcode-video`. This is essentially the same as the experimental option of the same name which was removed on February 25, 2016, but now it doesn't have a bitrate argument. It enables a _simple_ constrained variable bitrate (CVBR) ratecontrol system, less constrained than the default, producing a more predictable output size while avoiding `VBV underflow` warnings. Use it with `--target big` for the best results.
|
664
680
|
* Modify the `--abr` option in `transcode-video` to no longer use a bitrate argument. Instead, it relies on the `--target` option to control bitrate, just like the default ratecontrol system and the new `--cvbr` option. So, passing a bitrate argument is now an error. But you should consider using `--cvbr` instead of `--abr` anyway since the former is almost always higher quality.
|
665
681
|
* Remove the deprecated `--no-constrain` option from `detect-crop` and the `--no-constrain-crop` option from `transcode-video`.
|
666
682
|
* Modify `convert-video` to allow HEVC format video along with H.264.
|
data/bin/detect-crop
CHANGED
@@ -31,6 +31,8 @@ Usage: #{$PROGRAM_NAME} [OPTION]... [FILE|DIRECTORY]...
|
|
31
31
|
(default: main feature or first listed)
|
32
32
|
--constrain constrain crop to optimal shape
|
33
33
|
--values-only output only unambiguous crop values, not commands
|
34
|
+
--player mpv|mplayer
|
35
|
+
select player for preview commands (default: mpv)
|
34
36
|
|
35
37
|
-v, --verbose increase diagnostic information
|
36
38
|
-q, --quiet decrease " "
|
@@ -38,7 +40,7 @@ Usage: #{$PROGRAM_NAME} [OPTION]... [FILE|DIRECTORY]...
|
|
38
40
|
-h, --help display this help and exit
|
39
41
|
--version output version information and exit
|
40
42
|
|
41
|
-
Requires `HandBrakeCLI` and `
|
43
|
+
Requires `HandBrakeCLI` and `ffmpeg`.
|
42
44
|
HERE
|
43
45
|
end
|
44
46
|
|
@@ -48,6 +50,7 @@ HERE
|
|
48
50
|
@title = nil
|
49
51
|
@constrain = false
|
50
52
|
@values_only = false
|
53
|
+
@player = :mpv
|
51
54
|
end
|
52
55
|
|
53
56
|
def define_options(opts)
|
@@ -55,11 +58,20 @@ HERE
|
|
55
58
|
opts.on('--title ARG', Integer) { |arg| @title = arg }
|
56
59
|
opts.on('--constrain') { @constrain = true }
|
57
60
|
opts.on('--values-only') { @values_only = true }
|
61
|
+
|
62
|
+
opts.on '--player ARG' do |arg|
|
63
|
+
@player = case arg
|
64
|
+
when 'mpv', 'mplayer'
|
65
|
+
arg.to_sym
|
66
|
+
else
|
67
|
+
fail UsageError, "invalid player argument: #{arg}"
|
68
|
+
end
|
69
|
+
end
|
58
70
|
end
|
59
71
|
|
60
72
|
def configure
|
61
73
|
HandBrake.setup
|
62
|
-
|
74
|
+
FFmpeg.setup
|
63
75
|
end
|
64
76
|
|
65
77
|
def process_input(arg)
|
@@ -89,10 +101,17 @@ HERE
|
|
89
101
|
end
|
90
102
|
|
91
103
|
print_all = ->(crop) do
|
92
|
-
str = Crop.mplayer_string(crop, width, height)
|
93
104
|
puts
|
94
|
-
|
95
|
-
|
105
|
+
|
106
|
+
if @player == :mpv
|
107
|
+
puts "mpv --no-audio --vf lavfi=[drawbox=#{Crop.drawbox_string(crop, width, height)}:invert:1] #{shell_path}"
|
108
|
+
puts "mpv --no-audio --vf crop=#{Crop.player_string(crop, width, height)} #{shell_path}"
|
109
|
+
else
|
110
|
+
str = Crop.player_string(crop, width, height)
|
111
|
+
puts "mplayer -really-quiet -nosound -vf rectangle=#{str} #{shell_path}"
|
112
|
+
puts "mplayer -really-quiet -nosound -vf crop=#{str} #{shell_path}"
|
113
|
+
end
|
114
|
+
|
96
115
|
print_transcode.call crop
|
97
116
|
end
|
98
117
|
|
@@ -103,24 +122,24 @@ HERE
|
|
103
122
|
print_transcode.call hb_crop
|
104
123
|
end
|
105
124
|
else
|
106
|
-
|
107
|
-
|
125
|
+
ff_crop = Crop.detect(arg, media.info[:duration], width, height)
|
126
|
+
ff_crop = Crop.constrain(ff_crop, width, height) if @constrain
|
108
127
|
|
109
|
-
if hb_crop ==
|
128
|
+
if hb_crop == ff_crop
|
110
129
|
if @values_only
|
111
130
|
puts Crop.handbrake_string(hb_crop)
|
112
131
|
else
|
113
|
-
Console.info 'Results from HandBrakeCLI and
|
132
|
+
Console.info 'Results from HandBrakeCLI and ffmpeg are identical...'
|
114
133
|
print_all.call hb_crop
|
115
134
|
end
|
116
135
|
else
|
117
|
-
fail "results from HandBrakeCLI and
|
136
|
+
fail "results from HandBrakeCLI and ffmpeg differ: #{arg}" if @values_only
|
118
137
|
Console.warn 'Results differ...'
|
119
138
|
puts
|
120
139
|
puts '# From HandBrakeCLI:'
|
121
140
|
print_all.call hb_crop
|
122
|
-
puts '# From
|
123
|
-
print_all.call
|
141
|
+
puts '# From ffmpeg:'
|
142
|
+
print_all.call ff_crop
|
124
143
|
end
|
125
144
|
end
|
126
145
|
end
|
data/bin/transcode-video
CHANGED
@@ -80,7 +80,7 @@ Video options:
|
|
80
80
|
(use `--crop auto` for `HandBrakeCLI` behavior)
|
81
81
|
--constrain-crop
|
82
82
|
constrain `--crop detect` to optimal shape
|
83
|
-
--fallback-crop handbrake|
|
83
|
+
--fallback-crop handbrake|ffmpeg|none
|
84
84
|
select fallback crop values if `--crop detect` fails
|
85
85
|
--720p fit video within 1280x720 pixel bounds
|
86
86
|
--max-width WIDTH, --max-height HEIGHT
|
@@ -217,7 +217,7 @@ Other options:
|
|
217
217
|
-h, --help display this help and exit
|
218
218
|
--version output version information and exit
|
219
219
|
|
220
|
-
Requires `HandBrakeCLI`, `mp4track`, `
|
220
|
+
Requires `HandBrakeCLI`, `mp4track`, `ffmpeg` and `mkvpropedit`.
|
221
221
|
HERE
|
222
222
|
end
|
223
223
|
|
@@ -405,7 +405,7 @@ HERE
|
|
405
405
|
|
406
406
|
opts.on '--fallback-crop ARG' do |arg|
|
407
407
|
@fallback_crop = case arg
|
408
|
-
when 'handbrake', 'mplayer', 'none'
|
408
|
+
when 'handbrake', 'ffmpeg', 'mplayer', 'none'
|
409
409
|
arg.to_sym
|
410
410
|
else
|
411
411
|
fail UsageError, "invalid fallback crop argument: #{arg}"
|
@@ -787,7 +787,7 @@ HERE
|
|
787
787
|
@disable_handbrake_options.uniq!
|
788
788
|
HandBrake.setup
|
789
789
|
MP4track.setup
|
790
|
-
|
790
|
+
FFmpeg.setup
|
791
791
|
MKVpropedit.setup
|
792
792
|
end
|
793
793
|
|
@@ -989,21 +989,21 @@ HERE
|
|
989
989
|
crop = hb_crop
|
990
990
|
|
991
991
|
unless media.info[:directory]
|
992
|
-
|
993
|
-
|
992
|
+
ff_crop = Crop.detect(media.path, media.info[:duration], width, height)
|
993
|
+
ff_crop = Crop.constrain(ff_crop, width, height) if @constrain_crop
|
994
994
|
|
995
|
-
if hb_crop !=
|
995
|
+
if hb_crop != ff_crop
|
996
996
|
crop = case @fallback_crop
|
997
997
|
when :handbrake
|
998
998
|
hb_crop
|
999
|
-
when :mplayer
|
1000
|
-
|
999
|
+
when :ffmpeg, :mplayer
|
1000
|
+
ff_crop
|
1001
1001
|
when :none
|
1002
1002
|
{:top => 0, :bottom => 0, :left => 0, :right => 0}
|
1003
1003
|
else
|
1004
1004
|
Console.error 'Results differ...'
|
1005
1005
|
Console.error "From HandBrakeCLI: #{Crop.handbrake_string(hb_crop)}"
|
1006
|
-
Console.error "From
|
1006
|
+
Console.error "From ffmpeg: #{Crop.handbrake_string(ff_crop)}"
|
1007
1007
|
fail "crop detection failed: #{media.path}"
|
1008
1008
|
end
|
1009
1009
|
end
|
data/lib/video_transcoding.rb
CHANGED
@@ -15,6 +15,5 @@ require 'video_transcoding/handbrake'
|
|
15
15
|
require 'video_transcoding/media'
|
16
16
|
require 'video_transcoding/mkvpropedit'
|
17
17
|
require 'video_transcoding/mp4track'
|
18
|
-
require 'video_transcoding/mplayer'
|
19
18
|
require 'video_transcoding/tool'
|
20
19
|
require 'video_transcoding/version'
|
@@ -9,7 +9,7 @@ module VideoTranscoding
|
|
9
9
|
extend self
|
10
10
|
|
11
11
|
def detect(path, duration, width, height)
|
12
|
-
Console.info "Detecting crop with
|
12
|
+
Console.info "Detecting crop with ffmpeg..."
|
13
13
|
fail "media duration too short: #{duration} second(s)" if duration < 2
|
14
14
|
steps = 10
|
15
15
|
interval = duration / (steps + 1)
|
@@ -29,15 +29,19 @@ module VideoTranscoding
|
|
29
29
|
(1..steps).each do |step|
|
30
30
|
begin
|
31
31
|
IO.popen([
|
32
|
-
|
33
|
-
'-
|
34
|
-
'-
|
35
|
-
'-
|
36
|
-
'-ao', 'null',
|
37
|
-
'-vf', 'cropdetect=24:2',
|
38
|
-
path,
|
32
|
+
FFmpeg.command_name,
|
33
|
+
'-hide_banner',
|
34
|
+
'-nostdin',
|
35
|
+
'-noaccurate_seek',
|
39
36
|
'-ss', (interval * step).to_s,
|
40
|
-
'-
|
37
|
+
'-i', path,
|
38
|
+
'-frames:v', '10',
|
39
|
+
'-filter:v', 'cropdetect=24:2',
|
40
|
+
'-an',
|
41
|
+
'-sn',
|
42
|
+
'-ignore_unknown',
|
43
|
+
'-f', 'null',
|
44
|
+
'-'
|
41
45
|
], :err=>[:child, :out]) do |io|
|
42
46
|
io.each do |line|
|
43
47
|
seconds = Time.now.tv_sec
|
@@ -47,7 +51,7 @@ module VideoTranscoding
|
|
47
51
|
last_seconds = seconds
|
48
52
|
end
|
49
53
|
|
50
|
-
if line =~
|
54
|
+
if line =~ / crop=([0-9]+):([0-9]+):([0-9]+):([0-9]+)$/
|
51
55
|
d_width, d_height, d_x, d_y = $1.to_i, $2.to_i, $3.to_i, $4.to_i
|
52
56
|
crop_width = d_width if crop_width < d_width
|
53
57
|
crop_height = d_height if crop_height < d_height
|
@@ -100,11 +104,18 @@ module VideoTranscoding
|
|
100
104
|
"#{crop[:top]}:#{crop[:bottom]}:#{crop[:left]}:#{crop[:right]}"
|
101
105
|
end
|
102
106
|
|
103
|
-
def
|
107
|
+
def player_string(crop, width, height)
|
104
108
|
"#{width - (crop[:left] + crop[:right])}:" +
|
105
109
|
"#{height - (crop[:top] + crop[:bottom])}:" +
|
106
110
|
"#{crop[:left]}:" +
|
107
111
|
"#{crop[:top]}"
|
108
112
|
end
|
113
|
+
|
114
|
+
def drawbox_string(crop, width, height)
|
115
|
+
"#{crop[:left]}:" +
|
116
|
+
"#{crop[:top]}:" +
|
117
|
+
"#{width - (crop[:left] + crop[:right])}:" +
|
118
|
+
"#{height - (crop[:top] + crop[:bottom])}"
|
119
|
+
end
|
109
120
|
end
|
110
121
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: video_transcoding
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Don Melton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
Video Transcoding is a package of tools to transcode, inspect
|
@@ -41,7 +41,6 @@ files:
|
|
41
41
|
- lib/video_transcoding/media.rb
|
42
42
|
- lib/video_transcoding/mkvpropedit.rb
|
43
43
|
- lib/video_transcoding/mp4track.rb
|
44
|
-
- lib/video_transcoding/mplayer.rb
|
45
44
|
- lib/video_transcoding/tool.rb
|
46
45
|
- lib/video_transcoding/version.rb
|
47
46
|
- video_transcoding.gemspec
|
@@ -1,28 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# mplayer.rb
|
3
|
-
#
|
4
|
-
# Copyright (c) 2013-2017 Don Melton
|
5
|
-
#
|
6
|
-
|
7
|
-
module VideoTranscoding
|
8
|
-
module MPlayer
|
9
|
-
extend self
|
10
|
-
|
11
|
-
COMMAND_NAME = 'mplayer'
|
12
|
-
|
13
|
-
def setup
|
14
|
-
Tool.provide(COMMAND_NAME, ['-version']) do |output, _, _|
|
15
|
-
unless output =~ /^MPlayer [^ ]+/
|
16
|
-
Console.debug output
|
17
|
-
fail "#{COMMAND_NAME} version unknown"
|
18
|
-
end
|
19
|
-
|
20
|
-
Console.info "#{$MATCH} found..."
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def command_name
|
25
|
-
Tool.use(COMMAND_NAME)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|