video_transcoding 0.3.1 → 0.4.0
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 +32 -15
- 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: cc73a9cc2f744752ca69d781ba9dc91ba0c98b4a
|
4
|
+
data.tar.gz: 701979c5a46294e460f81ae71523f84e03964339
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad694a5a4863f258323f8055bee826b2622dc161ca96c087fc21ddbee6448c31a2bce8304215a6e43b8e50b2b0ebef3fee7c0d855e60c3508fd34f9e7f0f4676
|
7
|
+
data.tar.gz: aac9551f8d8f191d6012b553f877f377c8f102b218062e223bb0376d4b315dd633eb594ef8aef2925752c81cc6d0c198e35ce4af7dc13084043c4c2705d75046
|
data/bin/transcode-video
CHANGED
@@ -164,8 +164,9 @@ External subtitle options:
|
|
164
164
|
(can be used multiple times)
|
165
165
|
|
166
166
|
Alternate ratecontrol options:
|
167
|
-
--
|
168
|
-
--
|
167
|
+
--cvbr BITRATE use Constrained VBR ratecontrol at target video bitrate
|
168
|
+
--abr BITRATE use modified ABR ratecontrol at average video bitrate
|
169
|
+
--vbr QUALITY use true VBR ratecontrol at constant video quality (0-51)
|
169
170
|
|
170
171
|
Advanced options:
|
171
172
|
-E, --encoder-option NAME=VALUE|_NAME
|
@@ -230,6 +231,7 @@ HERE
|
|
230
231
|
@srt_language = {}
|
231
232
|
@srt_encoding = {}
|
232
233
|
@srt_offset = {}
|
234
|
+
@cvbr_bitrate = nil
|
233
235
|
@abr_bitrate = nil
|
234
236
|
@vbr_quality = nil
|
235
237
|
@encoder_options = {}
|
@@ -591,13 +593,21 @@ HERE
|
|
591
593
|
@srt_offset[@srt_file.size - 1] = arg
|
592
594
|
end
|
593
595
|
|
596
|
+
opts.on '--cvbr ARG', Integer do |arg|
|
597
|
+
@cvbr_bitrate = arg
|
598
|
+
@abr_bitrate = nil
|
599
|
+
@vbr_quality = nil
|
600
|
+
end
|
601
|
+
|
594
602
|
opts.on '--abr ARG', Integer do |arg|
|
595
603
|
@abr_bitrate = arg
|
604
|
+
@cvbr_bitrate = nil
|
596
605
|
@vbr_quality = nil
|
597
606
|
end
|
598
607
|
|
599
608
|
opts.on '--vbr ARG', Float do |arg|
|
600
609
|
@vbr_quality = arg
|
610
|
+
@cvbr_bitrate = nil
|
601
611
|
@abr_bitrate = nil
|
602
612
|
end
|
603
613
|
|
@@ -790,25 +800,32 @@ HERE
|
|
790
800
|
handbrake_options['encoder-level'] = 'auto'
|
791
801
|
end
|
792
802
|
|
793
|
-
|
803
|
+
if @cvbr_bitrate.nil?
|
804
|
+
handbrake_options['quality'] = '16'
|
794
805
|
|
795
|
-
|
796
|
-
|
806
|
+
unless media.info[:directory]
|
807
|
+
bitrate = ((((media.info[:size] * 8) / media.info[:duration]) / 1000) / 1000) * 1000
|
797
808
|
|
798
|
-
|
799
|
-
|
809
|
+
if bitrate < vbv_maxrate
|
810
|
+
min_bitrate = vbv_maxrate / 2
|
800
811
|
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
812
|
+
if bitrate < min_bitrate
|
813
|
+
vbv_maxrate = min_bitrate
|
814
|
+
else
|
815
|
+
vbv_maxrate = bitrate
|
816
|
+
end
|
805
817
|
end
|
806
818
|
end
|
807
|
-
end
|
808
819
|
|
809
|
-
|
810
|
-
|
811
|
-
|
820
|
+
encoder_options['vbv-maxrate'] = vbv_maxrate.to_s
|
821
|
+
encoder_options['vbv-bufsize'] = (@encoder_options.fetch('vbv-maxrate', vbv_maxrate).to_i / 2).to_s
|
822
|
+
encoder_options['crf-max'] = '25'
|
823
|
+
else
|
824
|
+
handbrake_options['quality'] = '1'
|
825
|
+
encoder_options['vbv-maxrate'] = @cvbr_bitrate.to_s
|
826
|
+
encoder_options['vbv-bufsize'] = (@cvbr_bitrate / 2).to_s
|
827
|
+
encoder_options['crf-max'] = '30'
|
828
|
+
end
|
812
829
|
else
|
813
830
|
unless @abr_bitrate.nil?
|
814
831
|
handbrake_options['vb'] = @abr_bitrate.to_s
|
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.4.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: 2016-01-
|
11
|
+
date: 2016-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
Video Transcoding is a package of tools to transcode, inspect
|