video_transcoding 0.6.0 → 0.7.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 +10 -12
- data/bin/transcode-video +40 -30
- 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: 8e3606bdc98fafac3af50e6871e4c8c1f0852e58
|
4
|
+
data.tar.gz: e6db68299ae0058840579164d9cc53dd3f14e38c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6625c65ce512c52d2e8891e6fe4aa95295f3ca421174e8de2f29abd63b85548cd0a62adb62b3deaa55d6145fdf24e8c0749b63c244efdcbb98384a14c7051fb7
|
7
|
+
data.tar.gz: c6c84e5819aa65257b32728005c57bec07b8269f0832a37a14f839bec1570c82b096d1fe2e08bf5f73d5888852729dca5bde1347e47b193d8caf80ba2d220e88
|
data/README.md
CHANGED
@@ -94,8 +94,8 @@ So, the `transcode-video` tool configures the [x264 video encoder](http://www.vi
|
|
94
94
|
Input resolution | Target video bitrate
|
95
95
|
--- | ---
|
96
96
|
1080p or Blu-ray video | 8000 Kbps
|
97
|
-
720p |
|
98
|
-
480i, 576p or DVD video |
|
97
|
+
720p | 4000 Kbps
|
98
|
+
480i, 576p or DVD video | 2000 Kbps
|
99
99
|
|
100
100
|
When audio transcoding is required, it's done in [AAC format](https://en.wikipedia.org/wiki/Advanced_Audio_Coding) and, if the original is [multi-channel surround sound](https://en.wikipedia.org/wiki/Surround_sound), in [Dolby Digital AC-3 format](https://en.wikipedia.org/wiki/Dolby_Digital). Meaning the output can contain two tracks from the same source in different formats. And mono, stereo and surround inputs are all handled differently.
|
101
101
|
|
@@ -202,8 +202,8 @@ Video bitrate targets are lowered 33-37% depending upon the video resolution of
|
|
202
202
|
Input resolution | Target video bitrate with `--small`
|
203
203
|
--- | ---
|
204
204
|
1080p or Blu-ray video | 5000 Kbps
|
205
|
-
720p |
|
206
|
-
480i, 576p or DVD video |
|
205
|
+
720p | 3000 Kbps
|
206
|
+
480i, 576p or DVD video | 1600 Kbps
|
207
207
|
|
208
208
|
Dolby Digital AC-3 audio bitrate limits are lowered 40%. However, there's no impact on the bitrate of mono and stereo AAC audio tracks.
|
209
209
|
|
@@ -213,8 +213,6 @@ Mono | AAC only | 80 Kbps | none
|
|
213
213
|
Stereo | AAC only | 160 Kbps | none
|
214
214
|
Surround | AC-3 only, up to 448 Kbps | 160 Kbps | 384 Kbps with 5.1 channels
|
215
215
|
|
216
|
-
This makes the output of `transcode-video` very near the same size as videos from the iTunes Store, including their audio tracks.
|
217
|
-
|
218
216
|
With `--small`, noisy video and complex surround audio have the most potential for perceptible quality loss.
|
219
217
|
|
220
218
|
#### Improving performance
|
@@ -459,14 +457,14 @@ Preset name | Note
|
|
459
457
|
`faster` | use with caution
|
460
458
|
`fast` | good but you might want to use `--quick` instead
|
461
459
|
`medium` | default
|
462
|
-
`slow` |
|
463
|
-
`slower` |
|
464
|
-
`veryslow` |
|
460
|
+
`slow` | smaller but not obviously higher quality
|
461
|
+
`slower` | smaller but not obviously higher quality
|
462
|
+
`veryslow` | smaller but not obviously higher quality
|
465
463
|
`placebo` | not recommended
|
466
464
|
|
467
465
|
Presets faster than `medium` trade precision for more speed. That tradeoff is acceptable for the `fast` preset. But you may notice occasional quality loss problems when using the `faster` or `veryfast` presets.
|
468
466
|
|
469
|
-
Presets slower than `medium` trade encoding speed for more compression efficiency. Any quality improvement using these presets may not be perceptible for most input.
|
467
|
+
Presets slower than `medium` trade encoding speed for more compression efficiency. Any quality improvement using these presets may not be perceptible for most input.
|
470
468
|
|
471
469
|
### Recommended `transcode-video` usage
|
472
470
|
|
@@ -474,9 +472,9 @@ Use the default settings whenever possible.
|
|
474
472
|
|
475
473
|
Use the `--mp4` or `--m4v` options if your target player can't handle Matroska format.
|
476
474
|
|
477
|
-
Use the `--small` option if you're short on storage space
|
475
|
+
Use the `--small` option if you're short on storage space.
|
478
476
|
|
479
|
-
Use the `--quick` option if you're in a hurry
|
477
|
+
Use the `--quick` option if you're in a hurry.
|
480
478
|
|
481
479
|
Apply unambiguous crop values from `detect-crop` after review.
|
482
480
|
|
data/bin/transcode-video
CHANGED
@@ -56,9 +56,9 @@ Output options:
|
|
56
56
|
--dry-run don't transcode, just show `HandBrakeCLI` command and exit
|
57
57
|
|
58
58
|
Quality options:
|
59
|
-
--small
|
60
|
-
|
61
|
-
|
59
|
+
--small lower video bitrate target and AC-3 audio bitrate limits,
|
60
|
+
trading some quality for reduced size
|
61
|
+
--small-video lower video bitrate target only
|
62
62
|
--quick trade some precision for 45-50% increase in encoding speed
|
63
63
|
(more than 15% speedier than x264 encoder "fast" preset)
|
64
64
|
(avoids quality loss of "faster" and "veryfast" presets)
|
@@ -75,6 +75,9 @@ Video options:
|
|
75
75
|
--pixel-aspect X:Y
|
76
76
|
set pixel aspect ratio (default: 1:1)
|
77
77
|
(e.g.: make X larger than Y to stretch horizontally)
|
78
|
+
--target BITRATE
|
79
|
+
set video bitrate target (default: based on input)
|
80
|
+
(can be exceeded to maintain video quality)
|
78
81
|
--force-rate FPS
|
79
82
|
force constant video frame rate
|
80
83
|
(`23.976` applied automatically for some inputs)
|
@@ -165,7 +168,6 @@ External subtitle options:
|
|
165
168
|
(can be used multiple times)
|
166
169
|
|
167
170
|
Advanced options:
|
168
|
-
--old-behavior use old ratecontrol system and video bitrate limits
|
169
171
|
--abr BITRATE use modified ABR ratecontrol at average video bitrate
|
170
172
|
--vbr QUALITY use true VBR ratecontrol at constant video quality (0-51)
|
171
173
|
-E, --encoder-option NAME=VALUE|_NAME
|
@@ -206,10 +208,11 @@ HERE
|
|
206
208
|
@dry_run = false
|
207
209
|
@vbv_maxrate_2160p = 16000
|
208
210
|
@vbv_maxrate_1080p = 8000
|
209
|
-
@vbv_maxrate_720p =
|
210
|
-
@vbv_maxrate_480p =
|
211
|
+
@vbv_maxrate_720p = 4000
|
212
|
+
@vbv_maxrate_480p = 2000
|
211
213
|
@quick = false
|
212
214
|
@crop = {:top => 0, :bottom => 0, :left => 0, :right => 0}
|
215
|
+
@target_bitrate = nil
|
213
216
|
@main_audio = nil
|
214
217
|
@extra_audio = []
|
215
218
|
@audio_name = {}
|
@@ -290,8 +293,8 @@ HERE
|
|
290
293
|
opts.on '--small' do
|
291
294
|
@vbv_maxrate_2160p = 10000
|
292
295
|
@vbv_maxrate_1080p = 5000
|
293
|
-
@vbv_maxrate_720p = 4000
|
294
|
-
@vbv_maxrate_480p = 2000
|
296
|
+
@vbv_maxrate_720p = @old_behavior ? 4000 : 3000
|
297
|
+
@vbv_maxrate_480p = @old_behavior ? 2000 : 1600
|
295
298
|
@ac3_bitrate = 384
|
296
299
|
@pass_ac3_bitrate = 448
|
297
300
|
end
|
@@ -299,18 +302,8 @@ HERE
|
|
299
302
|
opts.on '--small-video' do
|
300
303
|
@vbv_maxrate_2160p = 10000
|
301
304
|
@vbv_maxrate_1080p = 5000
|
302
|
-
@vbv_maxrate_720p = 4000
|
303
|
-
@vbv_maxrate_480p = 2000
|
304
|
-
end
|
305
|
-
|
306
|
-
opts.on '--big' do
|
307
|
-
Console.warn 'Using deprecated option: --big'
|
308
|
-
@vbv_maxrate_2160p = 16000
|
309
|
-
@vbv_maxrate_1080p = 8000
|
310
|
-
@vbv_maxrate_720p = @old_behavior ? 6000 : 5000
|
311
|
-
@vbv_maxrate_480p = @old_behavior ? 3000 : 2500
|
312
|
-
@ac3_bitrate = 640
|
313
|
-
@pass_ac3_bitrate = 640
|
305
|
+
@vbv_maxrate_720p = @old_behavior ? 4000 : 3000
|
306
|
+
@vbv_maxrate_480p = @old_behavior ? 2000 : 1600
|
314
307
|
end
|
315
308
|
|
316
309
|
opts.on '--quick' do
|
@@ -374,6 +367,12 @@ HERE
|
|
374
367
|
end
|
375
368
|
end
|
376
369
|
|
370
|
+
opts.on '--target ARG', Integer do |arg|
|
371
|
+
@target_bitrate = arg
|
372
|
+
@abr_bitrate = nil
|
373
|
+
@vbr_quality = nil
|
374
|
+
end
|
375
|
+
|
377
376
|
opts.on '--force-rate ARG' do |arg|
|
378
377
|
unless arg =~ /^[1-9][0-9]*(?:\.[0-9]+)?$/
|
379
378
|
fail UsageError, "invalid force rate argument: #{arg}"
|
@@ -610,9 +609,10 @@ HERE
|
|
610
609
|
end
|
611
610
|
|
612
611
|
opts.on '--old-behavior' do
|
612
|
+
Console.warn 'Using deprecated option: --old-behavior'
|
613
613
|
@old_behavior = true
|
614
|
-
@vbv_maxrate_720p = 6000
|
615
|
-
@vbv_maxrate_480p = 3000
|
614
|
+
@vbv_maxrate_720p = 6000
|
615
|
+
@vbv_maxrate_480p = 3000
|
616
616
|
@abr_bitrate = nil
|
617
617
|
@vbr_quality = nil
|
618
618
|
end
|
@@ -818,18 +818,28 @@ HERE
|
|
818
818
|
|
819
819
|
handbrake_options['quality'] = @old_behavior ? '16' : '1'
|
820
820
|
|
821
|
-
|
822
|
-
|
821
|
+
if @target_bitrate.nil?
|
822
|
+
unless media.info[:directory]
|
823
|
+
bitrate = ((((media.info[:size] * 8) / media.info[:duration]) / 1000) / 1000) * 1000
|
823
824
|
|
824
|
-
|
825
|
-
|
825
|
+
if bitrate < vbv_maxrate
|
826
|
+
min_bitrate = vbv_maxrate / 2
|
826
827
|
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
828
|
+
if bitrate < min_bitrate
|
829
|
+
vbv_maxrate = min_bitrate
|
830
|
+
else
|
831
|
+
vbv_maxrate = bitrate
|
832
|
+
end
|
831
833
|
end
|
832
834
|
end
|
835
|
+
else
|
836
|
+
if @target_bitrate < 2
|
837
|
+
vbv_maxrate = 2
|
838
|
+
elsif @target_bitrate > 300000
|
839
|
+
vbv_maxrate = 300000
|
840
|
+
else
|
841
|
+
vbv_maxrate = @target_bitrate
|
842
|
+
end
|
833
843
|
end
|
834
844
|
|
835
845
|
encoder_options['vbv-maxrate'] = vbv_maxrate.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.7.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-04-
|
11
|
+
date: 2016-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
Video Transcoding is a package of tools to transcode, inspect
|