other_video_transcoding 0.3.2 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +84 -0
- data/LICENSE +1 -1
- data/README.md +1 -3
- data/bin/ask-ffmpeg-log +3 -3
- data/bin/other-transcode +256 -165
- data/other_video_transcoding-0.3.2.gem +0 -0
- data/other_video_transcoding-0.4.0.gem +0 -0
- data/other_video_transcoding-0.5.0.gem +0 -0
- data/other_video_transcoding-0.6.0.gem +0 -0
- data/other_video_transcoding-0.7.0.gem +0 -0
- data/other_video_transcoding.gemspec +1 -1
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b33c51af021fb92ec9d41e7b4b95e92740b9c15832f276a471d6ecd8a92abe4
|
4
|
+
data.tar.gz: c3e030f58c77f2cce69cd02a3563428f4a0f6dbed0b6216928f4c40c6b2f3d73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f5e7f4135a53ed651720e0803f605a52768cb12758fcb9c13c15c4d8cc59ec94340f02aab11d9c3db9b390bf296c51b9fb7f49c8314bbf4906352252dbc4942
|
7
|
+
data.tar.gz: 8df50e3a3be13cb47483fd5b0ce9b2c9e97b3b4fe6755e5843e450bf177709df070e82e2ba18ab79c76d5f30172d588b9407b6aec25757ffcb0fd6e45e180881
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,90 @@
|
|
2
2
|
|
3
3
|
This single document contains all of the notes created for each [release](https://github.com/donmelton/other_video_transcoding/releases).
|
4
4
|
|
5
|
+
## [0.8.0](https://github.com/donmelton/other_video_transcoding/releases/tag/0.8.0)
|
6
|
+
|
7
|
+
Saturday, February 13, 2021
|
8
|
+
|
9
|
+
* Modify `other-transcode` to:
|
10
|
+
* No longer automatically deinterlace video with a frame rate of 29.97 FPS.
|
11
|
+
* No longer change the frame rate of any video in MPEG-2 format which was automatically deinterlaced.
|
12
|
+
* Only automatically deinterlace non-progressive video.
|
13
|
+
* Apply any automatic or explicit deinterlacing to all frames of the video, not just the interlaced frames.
|
14
|
+
* Force a constant frame rate for any video in MPEG-2 format at 29.97 FPS.
|
15
|
+
* Add a `--yadif-params` option to `other-transcode` to allow customization of the `yadif` filter used for deinterlacing.
|
16
|
+
* Remove the deprecated `--all-eac3` option of `other-transcode`.
|
17
|
+
|
18
|
+
## [0.7.0](https://github.com/donmelton/other_video_transcoding/releases/tag/0.7.0)
|
19
|
+
|
20
|
+
Monday, January 4, 2021
|
21
|
+
|
22
|
+
* Modify `other-transcode` to lower default target bitrates in order to significantly reduce the size of transcoded output at the risk of a slight reduction in perceived quality. Via [ #89](https://github.com/donmelton/other_video_transcoding/issues/89).
|
23
|
+
|
24
|
+
H.264 video:
|
25
|
+
|
26
|
+
Resolution | old | new
|
27
|
+
--- | --- | ---
|
28
|
+
1080p (Blu-ray video) | 8000 Kbps | 6000 Kbps
|
29
|
+
720p | 4000 Kbps | 3000 Kbps
|
30
|
+
480p (DVD video) | 2000 Kbps | 1500 Kbps
|
31
|
+
|
32
|
+
HEVC video:
|
33
|
+
|
34
|
+
Resolution | old | new
|
35
|
+
--- | --- | ---
|
36
|
+
1080p (Blu-ray video) | 6000 Kbps | 4000 Kbps
|
37
|
+
720p | 3000 Kbps | 2000 Kbps
|
38
|
+
480p (DVD video) | 1500 Kbps | 1000 Kbps
|
39
|
+
|
40
|
+
Dolby Digital Plus (Enhanced AC-3) audio:
|
41
|
+
|
42
|
+
Channels | old | new
|
43
|
+
--- | --- | ---
|
44
|
+
Surround | 640 Kbps | 384 Kbps
|
45
|
+
Stereo | 256 Kbps | 192 Kbps
|
46
|
+
Mono | 128 Kbps | 96 Kbps
|
47
|
+
|
48
|
+
Note: There are no changes to default target bitrates for Dolby Digital (AC-3) and AAC audio formats.
|
49
|
+
|
50
|
+
* Change the `--eac3` option in `other-transcode` to use Dolby Digital Plus format for _all_ transcoded audio instead of just surround output.
|
51
|
+
* Deprecate the `--all-eac3` option in `other-transcode` since the `--eac3` option now has the same behavior.
|
52
|
+
* Add a `--aac-stereo` option to `other-transcode`. This uses AAC format for transcoded stereo audio output so it can be paired with `--eac3` to get that option's old behavior.
|
53
|
+
* Add a `--8-bit-vc1` option. When the color depth is currently 10-bit, this option uses an 8-bit color depth _for video inputs in VC-1 format only_.
|
54
|
+
|
55
|
+
## [0.6.0](https://github.com/donmelton/other_video_transcoding/releases/tag/0.6.0)
|
56
|
+
|
57
|
+
Tuesday, December 22, 2020
|
58
|
+
|
59
|
+
* Lower the default target bitrates for 8-bit HEVC video in `other-transcode` to match the defaults for 10-bit HEVC video. This means, for example, the default target for HEVC at a 1080p resolution will be 6000 Kbps no matter the output bit depth.
|
60
|
+
* Modify `other-transcode` to set the video buffer size equal to the maximum video bitrate when using an Nvidia encoder, essentially adding `--rc-bufsize 3` to the command line. Previously the buffer size was never explicitly set so `ffmpeg` would use a default value of twice the target bitrate. Since the maximum bitrate is normally three times the target bitrate this meant the buffer size was actually smaller than the maximum. While this didn't cause any known problems, Nvidia recommends a larger buffer size to improve quality. However, using `--rc-bufsize 0` will restore the old behavior and the default value from `ffmpeg`.
|
61
|
+
* Ignore the `--nvenc-lookahead` option in `other-transcode` when the argument is `0` since such a value won't change the behavior of an Nvidia encoder anyway.
|
62
|
+
* Add a `--limit-ac3-surround` option to `other-transcode` which prevents surround audio in AC-3 or Dolby Digital Plus (Enhanced AC-3) format from being copied instead of transcoded when the orginal bitrate is above the transcoding bitrate. This allows setting a lower target with the `--surround-bitrate` option in order to force higher-bitrate tracks to be transcoded instead of copied.
|
63
|
+
* Reduce the minimum bitrates for Dolby Digital Plus audio in `other-transcode` from 256, 128 and 64 Kbps for surround, stereo and mono layouts to 192, 96 and 48 Kbps. The default bitrates for Dolby Digital Plus audio remain the same and this change does not affect audio output in AC-3 or AAC formats.
|
64
|
+
|
65
|
+
## [0.5.0](https://github.com/donmelton/other_video_transcoding/releases/tag/0.5.0)
|
66
|
+
|
67
|
+
Tuesday, November 24, 2020
|
68
|
+
|
69
|
+
* Add `--qsv-decoder` and `--qsv-device` options to `other-transcode`, both of which enable the scoped use of the Intel Quick Sync Video (QSV) decoder instead of the generic hardware decoder. These options can significantly speed operation of the QSV encoder, invoked via `--qsv`. It's recommended that `--decode all` be included when using these options to decode all video input formats. The `--qsv-device` option allows selection of specific hardware by number or path depending on platform. Please note that deinterlacing, cropping, scaling or using other filters will disable QSV's format-specific decoders.
|
70
|
+
* Remove all deprecated options and arguments from `other-transcode`.
|
71
|
+
|
72
|
+
## [0.4.0](https://github.com/donmelton/other_video_transcoding/releases/tag/0.4.0)
|
73
|
+
|
74
|
+
Sunday, November 1, 2020
|
75
|
+
|
76
|
+
* Modify the behavior and augment the capabilities of both encoding and decoding when using Nvidia hardware with `other-transcode`. This is necessary for compatibility with unleased versions of `ffmpeg` which are now built using the new Nvidia Software Development Kit (SDK) version 11.0. This SDK changes default encoder behavior and adds new presets which allow finer control of the performance/quality trade-off when transcoding video. To allow maximum performance, `other-transcode` no longer enables some quality settings by default:
|
77
|
+
* Multipass mode, now accessible via a new `--nvenc-multipass` option. Be advised that any improved quality from enabling multipass mode is probably not worth the performance impact.
|
78
|
+
* Spatial and temporal adaptive quantization (AQ), accessible via the `--nvenc-spatial-aq` and `--nvenc-temporal-aq` options. While enabling spatial AQ is still useful in reducing color banding for some inputs, be advised that enabling temporal AQ is probably not necessary and can cause some other side effects.
|
79
|
+
* Add support for seven new Nvidia encoder presets to `other-transcode`. Use `--preset p1` for best performance and `--preset p7` for best quality. It's not necessary to use `--preset p4` since that's the default. See the [Nvidia preset migration guide](https://docs.nvidia.com/video-technologies/video-codec-sdk/nvenc-preset-migration-guide/index.html) to understand how these presets work and how they map to older behavior.
|
80
|
+
* Add a `--nvenc-rc-mode` option to `other-transcode` for backward comaptibility with `ffmpeg` version 4.3.1 and older.
|
81
|
+
* Add `--cuda` and `--no-cuda` options to `other-transcode`. These options enable or disable the scoped use of the Nvidia CUDA hardware decoder instead of the generic hardware decoder. By default the CUDA _decoder_ is enabled when using the Nvidia video _encoder_, but disabled when using other encoders.
|
82
|
+
* Deprecate the `--cuvid` option in `other-transcode` because the CUDA decoder is faster and more flexible.
|
83
|
+
* Deprecate `--preset none` in `other-transcode` because it's no longer necessary.
|
84
|
+
* Always use hyphen-based spellings of Nvidia AQ options in `ffmpeg` commands generated by `other-transcode`.
|
85
|
+
* Add `--x264-params` and `--x265-params` options to `other-transcode` for _very_ advanced manipulation of the `x264` and `x265` software encoders.
|
86
|
+
* Modify `other-transcode` to assume a video input without a `field_order` tag is progressive instead of interlaced so a deinterlace fliter is not automatically and incorrectly applied to that video. This avoids problems with some 4K Ultra HD Blu-ray rips.
|
87
|
+
* Update the link to Docker containers for Linux in the "README" document. Thanks, @ttyS0!
|
88
|
+
|
5
89
|
## [0.3.2](https://github.com/donmelton/other_video_transcoding/releases/tag/0.3.2)
|
6
90
|
|
7
91
|
Friday, September 11, 2020
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -64,9 +64,7 @@ Additional documentation for installing these programs on Windows is available i
|
|
64
64
|
|
65
65
|
[Docker](https://en.wikipedia.org/wiki/Docker_(software)) containers for Linux, including installation instructions, are available here:
|
66
66
|
|
67
|
-
https://github.com/ttyS0/docker-transcode
|
68
|
-
|
69
|
-
https://github.com/ttyS0/docker-transcode-vaapi
|
67
|
+
https://github.com/ttyS0/docker-other-transcode
|
70
68
|
|
71
69
|
On macOS, all of these programs can be easily installed via [Homebrew](http://brew.sh/), an optional package manager:
|
72
70
|
|
data/bin/ask-ffmpeg-log
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
#
|
3
3
|
# ask-ffmpeg-log
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Don Melton
|
6
6
|
#
|
7
7
|
|
8
8
|
require 'abbrev'
|
@@ -16,8 +16,8 @@ module Transcoding
|
|
16
16
|
class Command
|
17
17
|
def about
|
18
18
|
<<-HERE
|
19
|
-
ask-ffmpeg-log 0.
|
20
|
-
Copyright (c) 2019-
|
19
|
+
ask-ffmpeg-log 0.8.0
|
20
|
+
Copyright (c) 2019-2021 Don Melton
|
21
21
|
HERE
|
22
22
|
end
|
23
23
|
|
data/bin/other-transcode
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
#
|
3
3
|
# other-transcode
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Don Melton
|
6
6
|
#
|
7
7
|
|
8
8
|
require 'English'
|
@@ -18,8 +18,8 @@ module Transcoding
|
|
18
18
|
class Command
|
19
19
|
def about
|
20
20
|
<<-HERE
|
21
|
-
other-transcode 0.
|
22
|
-
Copyright (c) 2019-
|
21
|
+
other-transcode 0.8.0
|
22
|
+
Copyright (c) 2019-2021 Don Melton
|
23
23
|
HERE
|
24
24
|
end
|
25
25
|
|
@@ -91,16 +91,22 @@ Video options:
|
|
91
91
|
--x264 use x264 software video encoder
|
92
92
|
--x265 use x265 " " "
|
93
93
|
--10-bit, --no-10-bit
|
94
|
-
use 10-bit
|
94
|
+
use 10-bit color depth (default: not used for H.264,
|
95
95
|
used for HEVC with Nvidia, Intel and x265 encoders)
|
96
|
-
--
|
97
|
-
|
96
|
+
--8-bit-vc1 use 8-bit color depth for VC-1 format only
|
97
|
+
--preset NAME apply video encoder preset
|
98
98
|
--decode vc1|all|none
|
99
99
|
set scope of automatic hardware decoder acceleration
|
100
100
|
(default: vc1 for VC-1 format only)
|
101
|
-
--
|
102
|
-
|
103
|
-
|
101
|
+
--cuda, --no-cuda
|
102
|
+
enable or disable scoped use of Nvidia video decoder
|
103
|
+
instead of generic hardware decoder
|
104
|
+
(default: enabled when using Nvidia video encoder,
|
105
|
+
disabled when using other encoders)
|
106
|
+
--qsv-decoder enable scoped use of Intel Quick Sync video decoder
|
107
|
+
instead of generic hardware decoder
|
108
|
+
--qsv-device DEVICE
|
109
|
+
enable scoped use of QSV decoder for specific device
|
104
110
|
HERE
|
105
111
|
end
|
106
112
|
|
@@ -122,7 +128,7 @@ Video options:
|
|
122
128
|
--deinterlace reduce interlace artifacts without changing frame rate
|
123
129
|
(applied automatically for some inputs)
|
124
130
|
--rate FPS force constant video frame rate
|
125
|
-
(
|
131
|
+
(disables automatic deinterlacing)
|
126
132
|
--detelecine drop duplicate frames to restore original frame rate
|
127
133
|
(disables any deinterlacing and forced frame rate)
|
128
134
|
--no-filters disable any automatic adjustments via filters
|
@@ -131,6 +137,8 @@ Video options:
|
|
131
137
|
|
132
138
|
def usage10
|
133
139
|
<<-HERE
|
140
|
+
--yadif-params KEY=VALUE[:KEY=VALUE]...
|
141
|
+
override yadif deinterlace filter configuration
|
134
142
|
--rc-maxrate FACTOR, --rc-bufsize FACTOR
|
135
143
|
set ratecontrol maximum rate and/or buffer size
|
136
144
|
as multiple of video bitrate target
|
@@ -140,17 +148,20 @@ Apple Video Toolbox encoder options:
|
|
140
148
|
--vt-allow-sw allow software encoding
|
141
149
|
|
142
150
|
Nvidia video encoder options:
|
143
|
-
--nvenc-spatial-aq
|
144
|
-
enable
|
145
|
-
--nvenc-temporal-aq
|
146
|
-
enable
|
147
|
-
(default: enabled for H.264, disabled for HEVC)
|
151
|
+
--nvenc-spatial-aq
|
152
|
+
enable spatial adaptive quantization (AQ)
|
153
|
+
--nvenc-temporal-aq
|
154
|
+
enable temporal adaptive quantization (AQ)
|
148
155
|
--nvenc-lookahead FRAMES
|
149
156
|
set number of frames to look ahead for ratecontrol
|
157
|
+
--nvenc-multipass qres|fullres
|
158
|
+
set multipass encoding resolution
|
150
159
|
--nvenc-refs FRAMES
|
151
160
|
set number of reference frames
|
152
161
|
--nvenc-bframes FRAMES
|
153
162
|
set maximum number of B-frames
|
163
|
+
--nvenc-rc-mode vbr|vbr_hq
|
164
|
+
set ratecontrol mode (default: vbr)
|
154
165
|
|
155
166
|
Intel Quick Sync video encoder options:
|
156
167
|
--qsv-refs FRAMES
|
@@ -179,6 +190,12 @@ x264 software video encoder options:
|
|
179
190
|
--x264-quick increase encoding speed by 70-80%
|
180
191
|
with no easily perceptible loss in video quality
|
181
192
|
(avoids quality problems with some encoder presets)
|
193
|
+
--x264-params KEY=VALUE[:KEY=VALUE]...
|
194
|
+
override x264 configuration (disables other x264 options)
|
195
|
+
|
196
|
+
x265 software video encoder options:
|
197
|
+
--x265-params KEY=VALUE[:KEY=VALUE]...
|
198
|
+
override x265 configuration
|
182
199
|
HERE
|
183
200
|
end
|
184
201
|
|
@@ -239,13 +256,17 @@ Audio options:
|
|
239
256
|
|
240
257
|
def usage17
|
241
258
|
<<-HERE
|
242
|
-
--eac3 use
|
259
|
+
--eac3 use Dolby Digital Plus (E-AC-3) format for all audio
|
260
|
+
(default bitrates: 384 for surround, 192 for stereo)
|
243
261
|
HERE
|
244
262
|
end
|
245
263
|
|
246
264
|
def usage18
|
247
265
|
<<-HERE
|
248
|
-
--
|
266
|
+
--aac-stereo use AAC format for stereo audio
|
267
|
+
--limit-ac3-surround
|
268
|
+
don't copy surround audio in AC-3 format
|
269
|
+
when orginal bitrate is above transcoding bitrate
|
249
270
|
--keep-ac3-stereo
|
250
271
|
copy stereo and mono audio in AC-3 format
|
251
272
|
even when orginal bitrate is above transcoding bitrate
|
@@ -297,9 +318,11 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
297
318
|
@hevc = false
|
298
319
|
@encoder = nil
|
299
320
|
@ten_bit = nil
|
321
|
+
@eight_bit_vc1 = false
|
300
322
|
@preset = nil
|
301
323
|
@decode_scope = :vc1
|
302
|
-
@
|
324
|
+
@decode_method = nil
|
325
|
+
@qsv_device = nil
|
303
326
|
@target_2160p = nil
|
304
327
|
@target_1080p = nil
|
305
328
|
@target_720p = nil
|
@@ -312,14 +335,17 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
312
335
|
@rate = nil
|
313
336
|
@detelecine = false
|
314
337
|
@enable_filters = true
|
338
|
+
@yadif_params = nil
|
315
339
|
@maxrate = nil
|
316
340
|
@bufsize = nil
|
317
341
|
@vt_allow_sw = false
|
318
|
-
@nvenc_spatial_aq =
|
319
|
-
@nvenc_temporal_aq =
|
342
|
+
@nvenc_spatial_aq = false
|
343
|
+
@nvenc_temporal_aq = false
|
320
344
|
@nvenc_lookahead = nil
|
345
|
+
@nvenc_multipass = nil
|
321
346
|
@nvenc_refs = nil
|
322
347
|
@nvenc_bframes = nil
|
348
|
+
@nvenc_rc_mode = 'vbr'
|
323
349
|
@qsv_refs = nil
|
324
350
|
@qsv_bframes = nil
|
325
351
|
@amf_quality = nil
|
@@ -331,17 +357,20 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
331
357
|
@x264_avbr = false
|
332
358
|
@x264_mbtree = false
|
333
359
|
@x264_quick = false
|
360
|
+
@x264_params = nil
|
361
|
+
@x265_params = nil
|
334
362
|
@audio_selections = [{
|
335
363
|
:track => 1,
|
336
364
|
:language => nil,
|
337
365
|
:title => nil,
|
338
366
|
:width => :surround
|
339
367
|
}]
|
340
|
-
@surround_bitrate =
|
341
|
-
@stereo_bitrate =
|
368
|
+
@surround_bitrate = nil
|
369
|
+
@stereo_bitrate = nil
|
342
370
|
@mono_bitrate = nil
|
343
371
|
@surround_encoder = 'ac3'
|
344
372
|
@stereo_encoder = nil
|
373
|
+
@keep_ac3_surround = true
|
345
374
|
@keep_ac3_stereo = false
|
346
375
|
@pass_dts = false
|
347
376
|
@subtitle_selections = []
|
@@ -479,6 +508,12 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
479
508
|
|
480
509
|
opts.on '--[no-]10-bit' do |arg|
|
481
510
|
@ten_bit = arg
|
511
|
+
@eight_bit_vc1 = false
|
512
|
+
@encoder = nil if @encoder == 'copy'
|
513
|
+
end
|
514
|
+
|
515
|
+
opts.on '--8-bit-vc1' do
|
516
|
+
@eight_bit_vc1 = true
|
482
517
|
@encoder = nil if @encoder == 'copy'
|
483
518
|
end
|
484
519
|
|
@@ -496,8 +531,17 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
496
531
|
end
|
497
532
|
end
|
498
533
|
|
499
|
-
opts.on '--
|
500
|
-
@
|
534
|
+
opts.on '--[no-]cuda' do |arg|
|
535
|
+
@decode_method = arg ? 'cuda' : 'auto'
|
536
|
+
end
|
537
|
+
|
538
|
+
opts.on '--qsv-decoder' do
|
539
|
+
@decode_method = 'qsv'
|
540
|
+
end
|
541
|
+
|
542
|
+
opts.on '--qsv-device ARG' do |arg|
|
543
|
+
@qsv_device = arg
|
544
|
+
@decode_method = 'qsv'
|
501
545
|
end
|
502
546
|
|
503
547
|
opts.on '--target ARG' do |arg|
|
@@ -554,7 +598,7 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
554
598
|
@deinterlace = true
|
555
599
|
@detelecine = false
|
556
600
|
@enable_filters = false
|
557
|
-
@encoder = nil if @encoder == 'copy'
|
601
|
+
@encoder = nil if @encoder == 'copy'
|
558
602
|
end
|
559
603
|
|
560
604
|
opts.on '--rate ARG' do |arg|
|
@@ -592,6 +636,14 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
592
636
|
@enable_filters = false
|
593
637
|
end
|
594
638
|
|
639
|
+
opts.on '--yadif-params ARG' do |arg|
|
640
|
+
arg.split ':' do |param|
|
641
|
+
fail UsageError, "invalid argument: #{arg}" unless param =~ /^[\w\-]+=[\w\-\.,]+$/
|
642
|
+
end
|
643
|
+
|
644
|
+
@yadif_params = arg
|
645
|
+
end
|
646
|
+
|
595
647
|
opts.on '--rc-maxrate ARG', Float do |arg|
|
596
648
|
@maxrate = arg
|
597
649
|
@encoder = nil if @encoder == 'copy'
|
@@ -620,19 +672,35 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
620
672
|
@vt_allow_sw = true
|
621
673
|
end
|
622
674
|
|
623
|
-
opts.on '--
|
675
|
+
opts.on '--nvenc-spatial-aq' do
|
624
676
|
@encoder = @hevc ? 'hevc_nvenc' : 'h264_nvenc'
|
625
|
-
@nvenc_spatial_aq =
|
677
|
+
@nvenc_spatial_aq = true
|
626
678
|
end
|
627
679
|
|
628
|
-
opts.on '--
|
680
|
+
opts.on '--nvenc-temporal-aq' do
|
629
681
|
@encoder = @hevc ? 'hevc_nvenc' : 'h264_nvenc'
|
630
|
-
@nvenc_temporal_aq =
|
682
|
+
@nvenc_temporal_aq = true
|
631
683
|
end
|
632
684
|
|
633
685
|
opts.on '--nvenc-lookahead ARG', Integer do |arg|
|
634
686
|
@encoder = @hevc ? 'hevc_nvenc' : 'h264_nvenc'
|
635
|
-
|
687
|
+
|
688
|
+
if arg > 0
|
689
|
+
@nvenc_lookahead = [arg, 32].min
|
690
|
+
else
|
691
|
+
@nvenc_lookahead = nil
|
692
|
+
end
|
693
|
+
end
|
694
|
+
|
695
|
+
opts.on '--nvenc-multipass ARG' do |arg|
|
696
|
+
@encoder = @hevc ? 'hevc_nvenc' : 'h264_nvenc'
|
697
|
+
|
698
|
+
@nvenc_multipass = case arg
|
699
|
+
when 'qres', 'fullres'
|
700
|
+
arg
|
701
|
+
else
|
702
|
+
fail UsageError, "invalid multipass resolution argument: #{arg}"
|
703
|
+
end
|
636
704
|
end
|
637
705
|
|
638
706
|
opts.on '--nvenc-refs ARG', Integer do |arg|
|
@@ -645,6 +713,17 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
645
713
|
@nvenc_bframes = [[arg, 0].max, 4].min
|
646
714
|
end
|
647
715
|
|
716
|
+
opts.on '--nvenc-rc-mode ARG' do |arg|
|
717
|
+
@encoder = @hevc ? 'hevc_nvenc' : 'h264_nvenc'
|
718
|
+
|
719
|
+
@nvenc_rc_mode = case arg
|
720
|
+
when 'vbr', 'vbr_hq'
|
721
|
+
arg
|
722
|
+
else
|
723
|
+
fail UsageError, "invalid rate control argument: #{arg}"
|
724
|
+
end
|
725
|
+
end
|
726
|
+
|
648
727
|
opts.on '--qsv-refs ARG', Integer do |arg|
|
649
728
|
@encoder = @hevc ? 'hevc_qsv' : 'h264_qsv'
|
650
729
|
@qsv_refs = [arg, 0].max
|
@@ -696,6 +775,7 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
696
775
|
@hevc = false
|
697
776
|
@x264_avbr = true
|
698
777
|
@x264_mbtree = false
|
778
|
+
@x264_params = nil
|
699
779
|
end
|
700
780
|
|
701
781
|
opts.on '--x264-mbtree' do
|
@@ -703,15 +783,40 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
703
783
|
@hevc = false
|
704
784
|
@x264_mbtree = true
|
705
785
|
@x264_avbr = false
|
786
|
+
@x264_params = nil
|
706
787
|
end
|
707
788
|
|
708
789
|
opts.on '--x264-quick' do
|
709
790
|
@encoder = 'libx264'
|
710
791
|
@hevc = false
|
711
792
|
@x264_quick = true
|
793
|
+
@x264_params = nil
|
712
794
|
@preset = nil
|
713
795
|
end
|
714
796
|
|
797
|
+
opts.on '--x264-params ARG' do |arg|
|
798
|
+
arg.split ':' do |param|
|
799
|
+
fail UsageError, "invalid argument: #{arg}" unless param =~ /^[\w\-]+=[\w\-\.,]+$/
|
800
|
+
end
|
801
|
+
|
802
|
+
@encoder = 'libx264'
|
803
|
+
@hevc = false
|
804
|
+
@x264_params = arg
|
805
|
+
@x264_avbr = false
|
806
|
+
@x264_mbtree = true
|
807
|
+
@x264_quick = false
|
808
|
+
end
|
809
|
+
|
810
|
+
opts.on '--x265-params ARG' do |arg|
|
811
|
+
arg.split ':' do |param|
|
812
|
+
fail UsageError, "invalid argument: #{arg}" unless param =~ /^[\w\-]+=[\w\-\.,]+$/
|
813
|
+
end
|
814
|
+
|
815
|
+
@encoder = 'libx265'
|
816
|
+
@hevc = true
|
817
|
+
@x265_params = arg
|
818
|
+
end
|
819
|
+
|
715
820
|
opts.on '--main-audio ARG' do |arg|
|
716
821
|
if arg =~ /^([0-9]+)(?:=(stereo|surround|original))?$/
|
717
822
|
@audio_selections[0][:track] = $1.to_i
|
@@ -763,11 +868,15 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
763
868
|
|
764
869
|
opts.on '--eac3' do
|
765
870
|
@surround_encoder = 'eac3'
|
871
|
+
@stereo_encoder = 'eac3'
|
766
872
|
end
|
767
873
|
|
768
|
-
opts.on '--
|
769
|
-
@
|
770
|
-
|
874
|
+
opts.on '--aac-stereo' do
|
875
|
+
@stereo_encoder = nil
|
876
|
+
end
|
877
|
+
|
878
|
+
opts.on '--limit-ac3-surround' do
|
879
|
+
@keep_ac3_surround = false
|
771
880
|
end
|
772
881
|
|
773
882
|
opts.on '--keep-ac3-stereo' do
|
@@ -828,13 +937,31 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
828
937
|
def configure(path)
|
829
938
|
@audio_selections.uniq!
|
830
939
|
@subtitle_selections.uniq!
|
831
|
-
|
832
|
-
|
940
|
+
|
941
|
+
if @surround_encoder == 'eac3'
|
942
|
+
@surround_bitrate ||= 384
|
943
|
+
@surround_bitrate = [[@surround_bitrate, 192].max, 768].min
|
944
|
+
else
|
945
|
+
@surround_bitrate ||= 640
|
946
|
+
@surround_bitrate = [[@surround_bitrate, 256].max, 640].min
|
947
|
+
end
|
948
|
+
|
949
|
+
if @stereo_encoder == 'eac3'
|
950
|
+
@stereo_bitrate ||= 192
|
951
|
+
@stereo_bitrate = [[@stereo_bitrate, 96].max, 768].min
|
952
|
+
else
|
953
|
+
@stereo_bitrate ||= 256
|
954
|
+
@stereo_bitrate = [[@stereo_bitrate, 128].max, 320].min
|
955
|
+
end
|
833
956
|
|
834
957
|
if @mono_bitrate.nil?
|
835
958
|
@mono_bitrate = @stereo_bitrate / 2
|
836
959
|
else
|
837
|
-
|
960
|
+
if @stereo_encoder == 'eac3'
|
961
|
+
@mono_bitrate = [[@mono_bitrate, 48].max, 768].min
|
962
|
+
else
|
963
|
+
@mono_bitrate = [[@mono_bitrate, 64].max, 256].min
|
964
|
+
end
|
838
965
|
end
|
839
966
|
|
840
967
|
[
|
@@ -876,10 +1003,11 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
876
1003
|
end
|
877
1004
|
|
878
1005
|
@ten_bit = (@hevc and @encoder =~ /(nvenc|qsv|x265)$/ ? true : false) if @ten_bit.nil?
|
879
|
-
@target_2160p ||=
|
880
|
-
@target_1080p ||=
|
881
|
-
@target_720p ||=
|
882
|
-
@target_480p ||=
|
1006
|
+
@target_2160p ||= @hevc ? 8000 : 12000
|
1007
|
+
@target_1080p ||= @hevc ? 4000 : 6000
|
1008
|
+
@target_720p ||= @hevc ? 2000 : 3000
|
1009
|
+
@target_480p ||= @hevc ? 1000 : 1500
|
1010
|
+
@decode_method ||= @encoder =~ /nvenc$/ ? 'cuda' : 'auto'
|
883
1011
|
|
884
1012
|
if @stereo_encoder.nil?
|
885
1013
|
if encoders =~ /aac_at/ or encoders =~ /libfdk_aac/
|
@@ -948,8 +1076,7 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
948
1076
|
] + (encoder =~ /vaapi$/ ? ['-filter:v', 'format=nv12,hwupload'] : []) + [
|
949
1077
|
'-c:v', encoder,
|
950
1078
|
'-b:v', '1000k'
|
951
|
-
] + (encoder =~ /nvenc$/ ? ['-rc:v',
|
952
|
-
(encoder == 'h264_nvenc' ? ['-temporal-aq:v', '1'] : []) +
|
1079
|
+
] + (encoder =~ /nvenc$/ ? ['-rc:v', @nvenc_rc_mode] : []) +
|
953
1080
|
(encoder == 'h264_qsv' ? ['-look_ahead:v', '1'] : []) +
|
954
1081
|
(encoder == 'hevc_qsv' ? ['-load_plugin:v', 'hevc_hw'] : []) +
|
955
1082
|
(encoder =~ /amf$/ ? ['-rc:v', 'vbr_latency'] : []) + [
|
@@ -1473,72 +1600,33 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
1473
1600
|
end
|
1474
1601
|
|
1475
1602
|
def get_video_options(media_info, video, burn_subtitle, crop)
|
1476
|
-
if @decoder_type == :cuvid
|
1477
|
-
cuvid_decoder = case video['codec_name']
|
1478
|
-
when 'mpeg1video'
|
1479
|
-
'mpeg1_cuvid'
|
1480
|
-
when 'mpeg2video'
|
1481
|
-
'mpeg2_cuvid'
|
1482
|
-
when 'mjpeg'
|
1483
|
-
'mjpeg_cuvid'
|
1484
|
-
when 'mpeg4'
|
1485
|
-
'mpeg4_cuvid'
|
1486
|
-
when 'h264'
|
1487
|
-
'h264_cuvid'
|
1488
|
-
when 'vc1'
|
1489
|
-
'vc1_cuvid'
|
1490
|
-
when 'vp8'
|
1491
|
-
'vp8_cuvid'
|
1492
|
-
when 'vp9'
|
1493
|
-
'vp9_cuvid'
|
1494
|
-
when 'hevc'
|
1495
|
-
'hevc_cuvid'
|
1496
|
-
end
|
1497
|
-
else
|
1498
|
-
cuvid_decoder = nil
|
1499
|
-
end
|
1500
|
-
|
1501
|
-
cuvid_options = []
|
1502
|
-
|
1503
1603
|
if burn_subtitle.nil?
|
1504
1604
|
overlay_filter = nil
|
1505
1605
|
else
|
1506
1606
|
overlay_filter = "[0:#{burn_subtitle['index']}]overlay"
|
1507
|
-
cuvid_decoder = nil
|
1508
1607
|
end
|
1509
1608
|
|
1510
1609
|
deinterlace = @deinterlace
|
1511
|
-
rate = @rate
|
1512
1610
|
|
1513
|
-
if @enable_filters
|
1514
|
-
|
1515
|
-
deinterlace = true
|
1516
|
-
|
1517
|
-
if video['codec_name'] == 'mpeg2video' and video['avg_frame_rate'] != '25/1'
|
1518
|
-
rate = '24000/1001'
|
1519
|
-
end
|
1520
|
-
end
|
1611
|
+
if @enable_filters and video.fetch('field_order', 'progressive') != 'progressive'
|
1612
|
+
deinterlace = true
|
1521
1613
|
end
|
1522
1614
|
|
1523
1615
|
frame_rate_filter = nil
|
1524
1616
|
|
1525
|
-
if deinterlace
|
1526
|
-
|
1527
|
-
|
1528
|
-
else
|
1529
|
-
cuvid_options += ['-deint:v', 'adaptive']
|
1530
|
-
end
|
1617
|
+
if deinterlace and @encoder != 'copy'
|
1618
|
+
frame_rate_filter = 'yadif'
|
1619
|
+
frame_rate_filter += "=#{@yadif_params}" unless @yadif_params.nil?
|
1531
1620
|
end
|
1532
1621
|
|
1533
|
-
unless rate.nil?
|
1622
|
+
unless @rate.nil?
|
1534
1623
|
frame_rate_filter = '' if frame_rate_filter.nil?
|
1535
1624
|
frame_rate_filter += ',' unless frame_rate_filter.empty?
|
1536
|
-
frame_rate_filter += "fps=#{rate}"
|
1625
|
+
frame_rate_filter += "fps=#{@rate}"
|
1537
1626
|
end
|
1538
1627
|
|
1539
1628
|
if @detelecine
|
1540
1629
|
frame_rate_filter = 'fieldmatch=order=tff:combmatch=none,decimate'
|
1541
|
-
cuvid_decoder = nil
|
1542
1630
|
end
|
1543
1631
|
|
1544
1632
|
width = video['width'].to_i
|
@@ -1553,21 +1641,9 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
1553
1641
|
if crop.nil? or (crop == {:width => width, :height => height, :x => 0, :y => 0})
|
1554
1642
|
crop_filter = nil
|
1555
1643
|
else
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
height = crop[:height]
|
1560
|
-
|
1561
|
-
if cuvid_decoder.nil?
|
1562
|
-
crop_filter = "crop=#{width}:#{height}:#{crop[:x]}:#{crop[:y]}"
|
1563
|
-
else
|
1564
|
-
crop_filter = nil
|
1565
|
-
top = crop[:y]
|
1566
|
-
bottom = media_height - (top + height)
|
1567
|
-
left = crop[:x]
|
1568
|
-
right = media_width - (left + width)
|
1569
|
-
cuvid_options += ['-crop:v', "#{top}x#{bottom}x#{left}x#{right}"]
|
1570
|
-
end
|
1644
|
+
width = crop[:width]
|
1645
|
+
height = crop[:height]
|
1646
|
+
crop_filter = "crop=#{width}:#{height}:#{crop[:x]}:#{crop[:y]}"
|
1571
1647
|
end
|
1572
1648
|
|
1573
1649
|
if @hevc
|
@@ -1582,14 +1658,8 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
1582
1658
|
scale = [(max_width.to_f / width), (max_height.to_f / height)].min
|
1583
1659
|
width = ((width * scale).ceil / 2) * 2
|
1584
1660
|
height = ((height * scale).ceil / 2) * 2
|
1585
|
-
|
1586
|
-
|
1587
|
-
scale_filter = "scale=#{width}:#{height}"
|
1588
|
-
scale_filter += ':flags=bicubic' unless overlay_filter.nil?
|
1589
|
-
else
|
1590
|
-
scale_filter = nil
|
1591
|
-
cuvid_options += ['-resize:v', "#{width}x#{height}"]
|
1592
|
-
end
|
1661
|
+
scale_filter = "scale=#{width}:#{height}"
|
1662
|
+
scale_filter += ':flags=bicubic' unless overlay_filter.nil?
|
1593
1663
|
else
|
1594
1664
|
scale_filter = nil
|
1595
1665
|
end
|
@@ -1600,24 +1670,52 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
1600
1670
|
decode_options = []
|
1601
1671
|
end
|
1602
1672
|
|
1603
|
-
if
|
1604
|
-
if
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1673
|
+
if (@decode_scope == :vc1 and video['codec_name'] == 'vc1') or @decode_scope == :all
|
1674
|
+
if @encoder =~ /vaapi$/
|
1675
|
+
decode_options = [
|
1676
|
+
'-hwaccel', 'vaapi',
|
1677
|
+
'-hwaccel_device', '/dev/dri/renderD128',
|
1678
|
+
'-hwaccel_output_format', 'vaapi'
|
1679
|
+
]
|
1680
|
+
else
|
1681
|
+
if @decode_method == 'qsv' and @encoder != 'h264_qsv'
|
1682
|
+
decode_method = 'auto'
|
1611
1683
|
else
|
1612
|
-
|
1684
|
+
decode_method = @decode_method
|
1613
1685
|
end
|
1614
|
-
end
|
1615
|
-
else
|
1616
|
-
Kernel.warn "video decoder = #{cuvid_decoder}"
|
1617
1686
|
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1687
|
+
decode_options += ['-hwaccel', decode_method]
|
1688
|
+
|
1689
|
+
if decode_method == 'qsv' and
|
1690
|
+
overlay_filter.nil? and
|
1691
|
+
frame_rate_filter.nil? and
|
1692
|
+
crop_filter.nil? and
|
1693
|
+
scale_filter.nil?
|
1694
|
+
qsv_decoder = case video['codec_name']
|
1695
|
+
when 'av1'
|
1696
|
+
'av1_qsv'
|
1697
|
+
when 'h264'
|
1698
|
+
'h264_qsv'
|
1699
|
+
when 'hevc'
|
1700
|
+
'hevc_qsv'
|
1701
|
+
when 'mjpeg'
|
1702
|
+
'mjpeg_qsv'
|
1703
|
+
when 'mpeg2video'
|
1704
|
+
'mpeg2_qsv'
|
1705
|
+
when 'vc1'
|
1706
|
+
'vc1_qsv'
|
1707
|
+
when 'vp8'
|
1708
|
+
'vp8_qsv'
|
1709
|
+
when 'vp9'
|
1710
|
+
'vp9_qsv'
|
1711
|
+
else
|
1712
|
+
nil
|
1713
|
+
end
|
1714
|
+
|
1715
|
+
decode_options += ['-qsv_device', @qsv_device] unless @qsv_device.nil?
|
1716
|
+
decode_options += ['-c:v', qsv_decoder] unless qsv_decoder.nil?
|
1717
|
+
end
|
1718
|
+
end
|
1621
1719
|
end
|
1622
1720
|
|
1623
1721
|
if @encoder =~ /vaapi$/ and not decode_options.include?('-hwaccel')
|
@@ -1626,9 +1724,15 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
1626
1724
|
conversion_filter = nil
|
1627
1725
|
end
|
1628
1726
|
|
1727
|
+
encode_options = []
|
1728
|
+
|
1629
1729
|
if @encoder == 'copy'
|
1630
1730
|
filter = ''
|
1631
1731
|
else
|
1732
|
+
if video['codec_name'] == 'mpeg2video' and video['avg_frame_rate'] == '30000/1001'
|
1733
|
+
encode_options += ['-vsync', 'cfr']
|
1734
|
+
end
|
1735
|
+
|
1632
1736
|
filter = overlay_filter.nil? ? '' : overlay_filter
|
1633
1737
|
filter += frame_rate_filter.nil? ? '' : ",#{frame_rate_filter}"
|
1634
1738
|
filter += crop_filter.nil? ? '' : ",#{crop_filter}"
|
@@ -1638,7 +1742,7 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
1638
1742
|
end
|
1639
1743
|
|
1640
1744
|
if overlay_filter.nil?
|
1641
|
-
encode_options
|
1745
|
+
encode_options += [
|
1642
1746
|
'-map', "0:#{video['index']}"
|
1643
1747
|
]
|
1644
1748
|
|
@@ -1648,13 +1752,14 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
1648
1752
|
]
|
1649
1753
|
end
|
1650
1754
|
else
|
1651
|
-
encode_options
|
1755
|
+
encode_options += [
|
1652
1756
|
'-filter_complex', "[0:#{video['index']}]#{filter}[v]",
|
1653
1757
|
'-map', '[v]'
|
1654
1758
|
]
|
1655
1759
|
end
|
1656
1760
|
|
1657
|
-
|
1761
|
+
ten_bit = (@ten_bit ? (@eight_bit_vc1 ? (video['codec_name'] != 'vc1') : true) : false)
|
1762
|
+
hdr = ((video.fetch('pix_fmt', 'yuv420p') == 'yuv420p10le') and ten_bit)
|
1658
1763
|
|
1659
1764
|
if hdr
|
1660
1765
|
color_primaries = 'bt2020'
|
@@ -1702,21 +1807,21 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
1702
1807
|
end
|
1703
1808
|
|
1704
1809
|
if @bufsize.nil?
|
1705
|
-
bufsize = maxrate if @encoder =~
|
1810
|
+
bufsize = maxrate if @encoder =~ /(nvenc|libx26[45])$/
|
1706
1811
|
else
|
1707
|
-
bufsize
|
1812
|
+
unless @bufsize == 0 and @encoder =~ /nvenc$/
|
1813
|
+
bufsize = [[(bitrate * @bufsize).to_i, bitrate].max, bitrate * 4].min
|
1814
|
+
end
|
1708
1815
|
end
|
1709
1816
|
end
|
1710
1817
|
|
1711
|
-
|
1712
|
-
preset = nil
|
1713
|
-
else
|
1818
|
+
unless @preset.nil?
|
1714
1819
|
valid = false
|
1715
1820
|
|
1716
1821
|
case @encoder
|
1717
1822
|
when /nvenc$/
|
1718
1823
|
case @preset
|
1719
|
-
when 'fast', 'medium', 'slow'
|
1824
|
+
when 'fast', 'medium', 'slow', /^p[1-7]$/
|
1720
1825
|
valid = true
|
1721
1826
|
end
|
1722
1827
|
when /qsv$/
|
@@ -1733,8 +1838,6 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
1733
1838
|
end
|
1734
1839
|
|
1735
1840
|
fail "invalid preset for encoder: #{@preset}" unless valid
|
1736
|
-
|
1737
|
-
preset = @preset
|
1738
1841
|
end
|
1739
1842
|
|
1740
1843
|
Kernel.warn 'Stream mapping:'
|
@@ -1742,7 +1845,7 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
1742
1845
|
|
1743
1846
|
unless @encoder == 'copy'
|
1744
1847
|
text += " / #{bitrate} Kbps"
|
1745
|
-
text += " / #{preset}" unless preset.nil?
|
1848
|
+
text += " / #{@preset}" unless @preset.nil?
|
1746
1849
|
end
|
1747
1850
|
|
1748
1851
|
unless burn_subtitle.nil?
|
@@ -1751,37 +1854,19 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
1751
1854
|
|
1752
1855
|
Kernel.warn text
|
1753
1856
|
encode_options += ['-c:v', @encoder]
|
1754
|
-
encode_options += ['-pix_fmt:v', (@encoder =~ /(nvenc|qsv)$/ ? 'p010le' : 'yuv420p10le')] if
|
1857
|
+
encode_options += ['-pix_fmt:v', (@encoder =~ /(nvenc|qsv)$/ ? 'p010le' : 'yuv420p10le')] if ten_bit
|
1755
1858
|
encode_options += ['-b:v', "#{bitrate}k"] unless @encoder == 'copy'
|
1756
1859
|
encode_options += ['-maxrate:v', "#{maxrate}k"] if maxrate > 0
|
1757
1860
|
encode_options += ['-bufsize:v', "#{bufsize}k"] if bufsize > 0
|
1758
|
-
encode_options += ['-preset:v', preset] unless preset.nil?
|
1861
|
+
encode_options += ['-preset:v', @preset] unless @preset.nil?
|
1759
1862
|
encode_options += ['-allow_sw:v', '1'] if @encoder =~ /videotoolbox$/ and @vt_allow_sw
|
1760
1863
|
|
1761
1864
|
if @encoder =~ /nvenc$/
|
1762
|
-
|
1763
|
-
|
1764
|
-
|
1765
|
-
if @hevc
|
1766
|
-
spatial_aq_option = '-spatial_aq:v'
|
1767
|
-
temporal_aq_option = '-temporal_aq:v'
|
1768
|
-
else
|
1769
|
-
spatial_aq_option = '-spatial-aq:v'
|
1770
|
-
temporal_aq_option = '-temporal-aq:v'
|
1771
|
-
end
|
1772
|
-
|
1773
|
-
if @preset.nil?
|
1774
|
-
encode_options += ['-rc:v', 'vbr_hq']
|
1775
|
-
spatial_aq = true if @nvenc_spatial_aq.nil?
|
1776
|
-
|
1777
|
-
unless @hevc
|
1778
|
-
temporal_aq = true if @nvenc_temporal_aq.nil?
|
1779
|
-
end
|
1780
|
-
end
|
1781
|
-
|
1782
|
-
encode_options += [spatial_aq_option, '1'] if spatial_aq
|
1783
|
-
encode_options += [temporal_aq_option, '1'] if temporal_aq
|
1865
|
+
encode_options += ['-rc:v', @nvenc_rc_mode]
|
1866
|
+
encode_options += ['-spatial-aq:v', '1'] if @nvenc_spatial_aq
|
1867
|
+
encode_options += ['-temporal-aq:v', '1'] if @nvenc_temporal_aq
|
1784
1868
|
encode_options += ['-rc-lookahead:v', @nvenc_lookahead.to_s] unless @nvenc_lookahead.nil?
|
1869
|
+
encode_options += ['-multipass:v', @nvenc_multipass] unless @nvenc_multipass.nil?
|
1785
1870
|
encode_options += ['-refs:v', @nvenc_refs.to_s] unless @nvenc_refs.nil?
|
1786
1871
|
encode_options += ['-bf:v', @nvenc_bframes.to_s] unless @nvenc_bframes.nil?
|
1787
1872
|
end
|
@@ -1834,9 +1919,15 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
1834
1919
|
|
1835
1920
|
encode_options += ['-refs:v', max_refs.to_s] if refs > max_refs
|
1836
1921
|
end
|
1922
|
+
|
1923
|
+
encode_options += ['-x264-params:v', @x264_params] unless @x264_params.nil?
|
1924
|
+
end
|
1925
|
+
|
1926
|
+
if @encoder == 'libx265'
|
1927
|
+
encode_options += ['-x265-params:v', @x265_params] unless @x265_params.nil?
|
1837
1928
|
end
|
1838
1929
|
|
1839
|
-
unless
|
1930
|
+
unless ten_bit
|
1840
1931
|
encode_options += ['-profile:v', 'high'] if @encoder =~ /^(h264_nvenc|h264_amf|libx264)$/
|
1841
1932
|
end
|
1842
1933
|
|
@@ -1985,8 +2076,8 @@ Requires `ffprobe`, `ffmpeg` and `mkvpropedit`.
|
|
1985
2076
|
dts = (codec_name == 'dts' and track[:stream].fetch('profile', 'DTS') =~ /^DTS(?:-ES)?$/)
|
1986
2077
|
|
1987
2078
|
if track[:width] == :surround
|
1988
|
-
if codec_name == @surround_encoder or
|
1989
|
-
|
2079
|
+
if ((codec_name == @surround_encoder or codec_name == 'ac3') and
|
2080
|
+
(@keep_ac3_surround or (track[:stream]['bit_rate'].to_i / 1000) <= @surround_bitrate)) or
|
1990
2081
|
(@pass_dts and dts)
|
1991
2082
|
encoder = 'copy'
|
1992
2083
|
elsif input_channels > 2
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: other_video_transcoding
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.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:
|
11
|
+
date: 2021-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: " Other Video Transcoding is a package of tools to transcode videos.\n"
|
14
14
|
email: don@blivet.com
|
@@ -30,6 +30,11 @@ files:
|
|
30
30
|
- other_video_transcoding-0.2.0.gem
|
31
31
|
- other_video_transcoding-0.3.0.gem
|
32
32
|
- other_video_transcoding-0.3.1.gem
|
33
|
+
- other_video_transcoding-0.3.2.gem
|
34
|
+
- other_video_transcoding-0.4.0.gem
|
35
|
+
- other_video_transcoding-0.5.0.gem
|
36
|
+
- other_video_transcoding-0.6.0.gem
|
37
|
+
- other_video_transcoding-0.7.0.gem
|
33
38
|
- other_video_transcoding.gemspec
|
34
39
|
homepage: https://github.com/donmelton/other_video_transcoding
|
35
40
|
licenses:
|
@@ -50,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
50
55
|
- !ruby/object:Gem::Version
|
51
56
|
version: '0'
|
52
57
|
requirements: []
|
53
|
-
rubygems_version: 3.1.
|
58
|
+
rubygems_version: 3.1.4
|
54
59
|
signing_key:
|
55
60
|
specification_version: 4
|
56
61
|
summary: Other tools to transcode videos.
|