video_transcoding 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/transcode-video +13 -30
- data/lib/video_transcoding/ffmpeg.rb +1 -6
- data/lib/video_transcoding/mplayer.rb +2 -8
- data/lib/video_transcoding/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: c228704a28bdfc0fcc86e1bab03106c34c7b92cd
|
4
|
+
data.tar.gz: 6d86557aae17cce47fc0db4692d72bc0cc0ff8bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6230729bd71adb9bd9b7bfe85ce26d1528c32d23409fdecf1a75178a8e38307c52bffd7b0d35451402502723bd98cca34116f85005490e77ab36d8f91b96c7b2
|
7
|
+
data.tar.gz: cdaf3c5804952e883bc897e6462f851b34ff156c8fda5603ead93c299047363a00b2dc424b5e4167d8e44436a1270f8d54421f80dd3cfc4cd00818b2a6f1214c
|
data/bin/transcode-video
CHANGED
@@ -231,7 +231,6 @@ HERE
|
|
231
231
|
@srt_offset = {}
|
232
232
|
@abr_bitrate = nil
|
233
233
|
@vbr_quality = nil
|
234
|
-
@cvbr_bitrate = nil
|
235
234
|
@encoder_options = {}
|
236
235
|
@disable_encoder_options = []
|
237
236
|
@handbrake_options = {'encoder-preset' => 'medium', 'encoder-profile' => 'high'}
|
@@ -610,23 +609,14 @@ HERE
|
|
610
609
|
|
611
610
|
opts.on '--abr ARG', Integer do |arg|
|
612
611
|
@abr_bitrate = arg
|
613
|
-
@cvbr_bitrate = nil
|
614
612
|
@vbr_quality = nil
|
615
613
|
end
|
616
614
|
|
617
615
|
opts.on '--vbr ARG', Float do |arg|
|
618
616
|
@vbr_quality = arg
|
619
|
-
@cvbr_bitrate = nil
|
620
617
|
@abr_bitrate = nil
|
621
618
|
end
|
622
619
|
|
623
|
-
opts.on '--cvbr ARG', Integer do |arg|
|
624
|
-
Console.warn 'Using experimental option: --cvbr'
|
625
|
-
@cvbr_bitrate = arg
|
626
|
-
@abr_bitrate = nil
|
627
|
-
@vbr_quality = nil
|
628
|
-
end
|
629
|
-
|
630
620
|
opts.on '-E', '--encoder-option ARG' do |arg|
|
631
621
|
if arg =~ /^([a-z0-9][a-z0-9_-]+)=([^ :]+)$/
|
632
622
|
@encoder_options[$1] = $2
|
@@ -816,32 +806,25 @@ HERE
|
|
816
806
|
handbrake_options['encoder-level'] = 'auto'
|
817
807
|
end
|
818
808
|
|
819
|
-
|
820
|
-
handbrake_options['quality'] = '16'
|
809
|
+
handbrake_options['quality'] = '16'
|
821
810
|
|
822
|
-
|
823
|
-
|
811
|
+
unless media.info[:directory]
|
812
|
+
bitrate = ((((media.info[:size] * 8) / media.info[:duration]) / 1000) / 1000) * 1000
|
824
813
|
|
825
|
-
|
826
|
-
|
814
|
+
if bitrate < vbv_maxrate
|
815
|
+
min_bitrate = vbv_maxrate / 2
|
827
816
|
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
end
|
817
|
+
if bitrate < min_bitrate
|
818
|
+
vbv_maxrate = min_bitrate
|
819
|
+
else
|
820
|
+
vbv_maxrate = bitrate
|
833
821
|
end
|
834
822
|
end
|
835
|
-
|
836
|
-
encoder_options['vbv-maxrate'] = vbv_maxrate.to_s
|
837
|
-
encoder_options['vbv-bufsize'] = (@encoder_options.fetch('vbv-maxrate', vbv_maxrate).to_i / 2).to_s
|
838
|
-
encoder_options['crf-max'] = '25'
|
839
|
-
else
|
840
|
-
handbrake_options['quality'] = '1'
|
841
|
-
encoder_options['vbv-maxrate'] = @cvbr_bitrate.to_s
|
842
|
-
encoder_options['vbv-bufsize'] = (@cvbr_bitrate / 2).to_s
|
843
|
-
encoder_options['crf-max'] = '30'
|
844
823
|
end
|
824
|
+
|
825
|
+
encoder_options['vbv-maxrate'] = vbv_maxrate.to_s
|
826
|
+
encoder_options['vbv-bufsize'] = (@encoder_options.fetch('vbv-maxrate', vbv_maxrate).to_i / 2).to_s
|
827
|
+
encoder_options['crf-max'] = '25'
|
845
828
|
else
|
846
829
|
unless @abr_bitrate.nil?
|
847
830
|
handbrake_options['vb'] = @abr_bitrate.to_s
|
@@ -14,18 +14,13 @@ module VideoTranscoding
|
|
14
14
|
Tool.provide(COMMAND_NAME, ['-version']) do |output, status, properties|
|
15
15
|
fail "#{COMMAND_NAME} failed during execution" unless status == 0
|
16
16
|
|
17
|
-
unless output =~ /^ffmpeg version
|
17
|
+
unless output =~ /^ffmpeg version [^ ]+/
|
18
18
|
Console.debug output
|
19
19
|
fail "#{COMMAND_NAME} version unknown"
|
20
20
|
end
|
21
21
|
|
22
|
-
version = $1
|
23
22
|
Console.info "#{$MATCH} found..."
|
24
23
|
|
25
|
-
unless version =~ /^([0-9]+)\.([0-9]+)/ and (($1.to_i * 100) + $2.to_i) >= 205
|
26
|
-
fail "#{COMMAND_NAME} version 2.5.0 or later required"
|
27
|
-
end
|
28
|
-
|
29
24
|
if output =~ /--enable-libfdk-aac/
|
30
25
|
properties[:aac_encoder] = 'libfdk_aac'
|
31
26
|
elsif output =~ /--enable-libfaac/
|
@@ -12,18 +12,12 @@ module VideoTranscoding
|
|
12
12
|
|
13
13
|
def setup
|
14
14
|
Tool.provide(COMMAND_NAME, ['-version']) do |output, _, _|
|
15
|
-
unless output =~ /^MPlayer
|
15
|
+
unless output =~ /^MPlayer [^ ]+/
|
16
16
|
Console.debug output
|
17
17
|
fail "#{COMMAND_NAME} version unknown"
|
18
18
|
end
|
19
19
|
|
20
|
-
|
21
|
-
minor_version = $2.to_i
|
22
|
-
Console.info "#{$MATCH}found..."
|
23
|
-
|
24
|
-
unless ((major_version * 100) + minor_version) >= 402
|
25
|
-
fail "#{COMMAND_NAME} version 4.2 or later required"
|
26
|
-
end
|
20
|
+
Console.info "#{$MATCH} found..."
|
27
21
|
end
|
28
22
|
end
|
29
23
|
|
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.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Don Melton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
Video Transcoding is a package of tools to transcode, inspect
|