forked from mlsmithjr/transcoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtranscode.yml
More file actions
342 lines (313 loc) · 9.02 KB
/
transcode.yml
File metadata and controls
342 lines (313 loc) · 9.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
##
# NOTE: This file is a sample configuration starting point. Copy it to customize.
##
##########################################
# global configuration section
##########################################
config:
default_queue_file: '/volume1/config/sonarr/transcode_queue.txt'
ffmpeg: '/usr/bin/ffmpeg'
queues:
qsv: 1
cuda: 1
colorize: yes
fls_path: '/tmp'
#
# Cluster machine definitions (optional).
# You can omit this entire section if you don't use clustering
#
clusters:
home:
workstation:
type: local
ffmpeg: '/usr/bin/ffmpeg'
queues:
qsv: 1
cuda: 1
status: 'enabled'
chrispc:
os: win10
type: mounted
ip: 192.168.2.66
user: mark
ffmpeg: '/mnt/c/ffmpeg/bin/ffmpeg.exe'
profiles:
- hevc_cuda
queues:
qsv: 1
cuda: 1
working_dir: 'c:\temp'
path-substitutions:
- '/tv/ m:Video\Television\'
- '/downloads/ n:\'
status: enabled
homeserver:
os: linux
type: mounted
working_dir: /tmp
ip: 192.168.2.61
user: mark
ffmpeg: '/home/mark/ffmpeg_sources/ffmpeg/ffmpeg'
queues:
cuda: 1
profiles:
- hevc_cuda
- hevc_cuda_10bit
status: 'enabled'
macpro:
os: linux
type: mounted
ip: 192.168.2.64
user: mark
ffmpeg: '/usr/bin/ffmpeg'
profiles:
- hevc
status: 'enabled'
#######################################################
# Profile definitions section
# You can model all your transcoding combinations here.
#######################################################
profiles:
#
# Common options for all encodes, included in other
# profiles as defaults (but can be overridden)
# (for include-use only)
#
base:
#
# ffmpeg output-related options
#
output_options:
- "-f matroska" # mkv format
- "-max_muxing_queue_size 1024"
output_options_subtitle:
- "-c:s copy" # copy all subtitles as-is
output_options_audio:
- "-c:a copy" # copy all audio as-is
extension: '.mkv'
threshold: 18 # minimum of 18% compression required
threshold_check: 20 # start checking threshold at 20% complete
#
# audio drop/keep handling
#
audio:
#
# Included languages take precedent. By default all languages are retained.
# Any specifically included languages here automatically discard all others.
#
include_languages:
- "eng"
default_language: eng
#
# subtitle drop/keep handling
#
subtitle:
# see audio comment above
include_languages:
- "eng"
default_language: eng
############################################
# nVidia CUDA-specific common options
# (for include-use only)
############################################
cuda:
input_options:
# optionally you can enable hardware decoding here
output_options_video:
- "-cq:v 19" # crf option passed to CUDA engine
- "-rc vbr_hq" # variable bit-rate, high quality
- "-rc-lookahead 20"
- "-bufsize 5M"
- "-b:v 7M"
- "-profile:v main"
- "-maxrate:v 7M"
- "-c:v hevc_nvenc"
- "-preset slow"
- "-pix_fmt yuv420p"
##############################################
# nVidia CUDA-specific for 10bit video support
# (Pascal-based cards or newer)
##############################################
hevc_cuda_10bit:
include: "base cuda" # include "base" and "cuda" definitions
output_options:
- "-pix_fmt yuv420p10le"
- "-profile:v main10" # redefine the profile:v value from "base" options
###############################################
# HEVC CUDA high quality, for just about
# everything.
###############################################
hevc_cuda:
include: "base cuda" # include "base" and "cuda" definitions
queue: 'cuda'
###############################################
# Intel QSV common options
###############################################
qsv:
input_options:
# enable hardware decoding
- "-init_hw_device vaapi=intel:/dev/dri/renderD128"
- "-hwaccel vaapi"
- "-hwaccel_output_format vaapi"
- "-hwaccel_device intel"
output_options_video:
- "-vf format=vaapi,hwupload"
- "-preset slow"
- "-rc_mode 1"
- "-qp 20"
- "-b:v 7M"
output_options_subtitle:
- "-c:s copy"
output_options_audio:
- "-c:a copy"
###############################################
# Intel QSV (HEVC)
###############################################
hevc_qsv:
include: "base qsv"
output_options_video:
- "-c:v hevc_vaapi"
- "-max_muxing_queue_size 1024"
queue: 'qsv'
###############################################
# Intel QSV (x264)
###############################################
x264_qsv:
include: "base qsv"
output_options_video:
- "-c:v h264_vaapi"
queue: 'qsv'
threshold: 20
###############################################
# Finally, come CPU-only profiles. Not sure
# why you would use if you have hardware
# support, but including for documentation.
###############################################
#
x264_mp4:
include: "base"
output_options:
- "-f mp4"
output_options_video:
- "-threads 4"
- "-c:v h264"
- "-crf 18"
output_options_audio:
- "-c:a copy"
output_options_subtitle:
- "-c:s copy"
threshold: 15
threshold_check: 30
copy_mp4: # mostly used to fix badly formatted files
output_options_video:
- "-c:v copy"
output_options_audio:
- "-c:a copy"
output_options_subtitle:
- "-c:s copy"
- "-f mp4"
extension: '.mp4'
#
# example audio-only partial profiles, to be used as mixins.
#
mp3_hq:
output_options_audio:
- "-c:a libmp3lame"
- "-q:a 330"
aac_hq:
output_options_audio:
- "-c:a libfdk_aac"
- "-b:a 384k"
#################################################
# The following are scenario-specific profiles.
# They are examples of how to treat various
# media differently from the generic ones above.
#################################################
#
# For the series Dark, don't transcode but do
# strip out non-preferred languages
#
dark_passthru:
output_options:
- "-c:v copy"
- "-c:a copy"
- "-c:s copy"
- "-f matroska"
audio:
include_languages:
- "ger"
- "eng"
subtitle:
include_languages:
- "eng"
extension: ".mkv"
#
# Anime - keep Japanese language track and English subtitles
# English subtitles already included in base profile
#
anime:
include: "base cuda"
audio:
include_languages:
- "eng"
- "jpn"
#
# When you get those oddball encodes with a stupid high
# frame rate (Alan Partridge comes to mind)
#
hevc_cuda_30fps:
include: "base cuda"
output_options:
- "-r 30"
queue: 'cuda'
#
# Automatching happens when a profile isn't provided on the command line. These rules are evalulated to find the
# most appropriate profile for each video to be transcoded.
#
# rule predicates:
#
# vcodec Video codec of the source ('ffmpeg -codecs' to see full list), may preceed with ! for not-equal test
# res_height Source video resolution height, operators < and > allowed
# res_width Source video resolution width, operators < and > allowed
# filesize_mb Size of the source file (in megabytes), operators allowed
# runtime Source runtime in minutes, operators allowed
# fps Framerate of the source
# path Full path of the source file. Value can be a regular expression (ie. '.*/Television/.*').
#
# Rules are evaluated in order. First matching rule wins so order wisely.
# Rules with a profile of "SKIP" mean to skip processing of the matched video
#
rules:
'skip video if already encoded in hevc/h265':
profile: SKIP
criteria:
vcodec: 'hevc'
'small enough already':
profile: SKIP
criteria:
filesize_mb: '<2000'
res_height: '721-1081'
runtime: '30-65'
'special HD higher quality, keep original':
profile: SKIP
criteria:
filesize_mb: '<3500'
runtime: '45-65'
path: 'Westworld|Walking|Vikings|Expanse'
'high frame rate':
profile: hevc_cuda_30fps
criteria:
fps: '>30'
filesize_mb: '>500'
'skip video if resolution < 700':
profile: SKIP
criteria:
res_height: '<700'
'anime':
profile: anime
criteria:
path: '.*/anime/.*'
'default':
profile: hevc_cuda
criteria:
vcodec: '!hevc'