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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1091a510ba22d9f6993cbf6d771543a0ac6186c8
4
- data.tar.gz: 54b715df7da3d45652cd61616c38baa27439fa58
3
+ metadata.gz: cc73a9cc2f744752ca69d781ba9dc91ba0c98b4a
4
+ data.tar.gz: 701979c5a46294e460f81ae71523f84e03964339
5
5
  SHA512:
6
- metadata.gz: f8d958cd7f52b285858f6ec472bd30ed56ba56f6f075f6445cb280a69abac6e6febfa5a173e25cba0fc0abb3c251e91bcfa15d4a925ea67f4ebce89873738dd4
7
- data.tar.gz: bcba09ac273d476e03b4d7d5196511a3e38d0fba14bf7cbe215d0c978861a6da7b21cb25e81837445aa256eda9082448c3d894647089ee2cc96fbc06ca480724
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
- --abr BITRATE use modified ABR ratecontrol with average video bitrate
168
- --vbr QUALITY use true VBR ratecontrol with constant video quality (0-51)
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
- handbrake_options['quality'] = '16'
803
+ if @cvbr_bitrate.nil?
804
+ handbrake_options['quality'] = '16'
794
805
 
795
- unless media.info[:directory]
796
- bitrate = ((((media.info[:size] * 8) / media.info[:duration]) / 1000) / 1000) * 1000
806
+ unless media.info[:directory]
807
+ bitrate = ((((media.info[:size] * 8) / media.info[:duration]) / 1000) / 1000) * 1000
797
808
 
798
- if bitrate < vbv_maxrate
799
- min_bitrate = vbv_maxrate / 2
809
+ if bitrate < vbv_maxrate
810
+ min_bitrate = vbv_maxrate / 2
800
811
 
801
- if bitrate < min_bitrate
802
- vbv_maxrate = min_bitrate
803
- else
804
- vbv_maxrate = bitrate
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
- encoder_options['vbv-maxrate'] = vbv_maxrate.to_s
810
- encoder_options['vbv-bufsize'] = (@encoder_options.fetch('vbv-maxrate', vbv_maxrate).to_i / 2).to_s
811
- encoder_options['crf-max'] = '25'
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
@@ -5,5 +5,5 @@
5
5
  #
6
6
 
7
7
  module VideoTranscoding
8
- VERSION = '0.3.1'
8
+ VERSION = '0.4.0'
9
9
  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.3.1
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-09 00:00:00.000000000 Z
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