typed-ffmpeg-compatible 3.5.2__py3-none-any.whl → 3.6__py3-none-any.whl

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.
Files changed (71) hide show
  1. typed_ffmpeg/__init__.py +4 -1
  2. typed_ffmpeg/_version.py +2 -2
  3. typed_ffmpeg/base.py +4 -1
  4. typed_ffmpeg/codecs/__init__.py +2 -0
  5. typed_ffmpeg/codecs/decoders.py +1852 -1853
  6. typed_ffmpeg/codecs/encoders.py +2001 -1782
  7. typed_ffmpeg/codecs/schema.py +6 -12
  8. typed_ffmpeg/common/__init__.py +1 -0
  9. typed_ffmpeg/common/cache.py +9 -6
  10. typed_ffmpeg/common/schema.py +11 -0
  11. typed_ffmpeg/common/serialize.py +13 -7
  12. typed_ffmpeg/compile/__init__.py +1 -0
  13. typed_ffmpeg/compile/compile_cli.py +23 -4
  14. typed_ffmpeg/compile/compile_json.py +4 -0
  15. typed_ffmpeg/compile/compile_python.py +15 -0
  16. typed_ffmpeg/compile/context.py +15 -4
  17. typed_ffmpeg/compile/validate.py +4 -3
  18. typed_ffmpeg/dag/factory.py +2 -0
  19. typed_ffmpeg/dag/global_runnable/__init__.py +1 -0
  20. typed_ffmpeg/dag/global_runnable/global_args.py +2 -2
  21. typed_ffmpeg/dag/global_runnable/runnable.py +6 -2
  22. typed_ffmpeg/dag/io/__init__.py +1 -0
  23. typed_ffmpeg/dag/io/_input.py +20 -5
  24. typed_ffmpeg/dag/io/_output.py +24 -9
  25. typed_ffmpeg/dag/io/output_args.py +21 -7
  26. typed_ffmpeg/dag/nodes.py +20 -0
  27. typed_ffmpeg/dag/schema.py +19 -6
  28. typed_ffmpeg/dag/utils.py +2 -2
  29. typed_ffmpeg/exceptions.py +2 -1
  30. typed_ffmpeg/expressions.py +884 -0
  31. typed_ffmpeg/ffprobe/__init__.py +1 -0
  32. typed_ffmpeg/ffprobe/parse.py +7 -1
  33. typed_ffmpeg/ffprobe/probe.py +3 -1
  34. typed_ffmpeg/ffprobe/schema.py +83 -1
  35. typed_ffmpeg/ffprobe/xml2json.py +8 -2
  36. typed_ffmpeg/filters.py +540 -631
  37. typed_ffmpeg/formats/__init__.py +2 -0
  38. typed_ffmpeg/formats/demuxers.py +1869 -1921
  39. typed_ffmpeg/formats/muxers.py +1382 -1107
  40. typed_ffmpeg/formats/schema.py +6 -12
  41. typed_ffmpeg/info.py +8 -0
  42. typed_ffmpeg/options/__init__.py +15 -0
  43. typed_ffmpeg/options/codec.py +711 -0
  44. typed_ffmpeg/options/format.py +196 -0
  45. typed_ffmpeg/options/framesync.py +43 -0
  46. typed_ffmpeg/options/timeline.py +22 -0
  47. typed_ffmpeg/schema.py +15 -0
  48. typed_ffmpeg/sources.py +392 -381
  49. typed_ffmpeg/streams/__init__.py +2 -0
  50. typed_ffmpeg/streams/audio.py +1071 -882
  51. typed_ffmpeg/streams/av.py +9 -3
  52. typed_ffmpeg/streams/subtitle.py +3 -3
  53. typed_ffmpeg/streams/video.py +1873 -1725
  54. typed_ffmpeg/types.py +3 -2
  55. typed_ffmpeg/utils/__init__.py +1 -0
  56. typed_ffmpeg/utils/escaping.py +8 -4
  57. typed_ffmpeg/utils/frozendict.py +31 -1
  58. typed_ffmpeg/utils/lazy_eval/__init__.py +1 -0
  59. typed_ffmpeg/utils/lazy_eval/operator.py +75 -27
  60. typed_ffmpeg/utils/lazy_eval/schema.py +176 -4
  61. typed_ffmpeg/utils/run.py +2 -0
  62. typed_ffmpeg/utils/snapshot.py +1 -0
  63. typed_ffmpeg/utils/typing.py +2 -1
  64. typed_ffmpeg/utils/view.py +2 -1
  65. {typed_ffmpeg_compatible-3.5.2.dist-info → typed_ffmpeg_compatible-3.6.dist-info}/METADATA +1 -1
  66. typed_ffmpeg_compatible-3.6.dist-info/RECORD +73 -0
  67. typed_ffmpeg_compatible-3.5.2.dist-info/RECORD +0 -67
  68. {typed_ffmpeg_compatible-3.5.2.dist-info → typed_ffmpeg_compatible-3.6.dist-info}/WHEEL +0 -0
  69. {typed_ffmpeg_compatible-3.5.2.dist-info → typed_ffmpeg_compatible-3.6.dist-info}/entry_points.txt +0 -0
  70. {typed_ffmpeg_compatible-3.5.2.dist-info → typed_ffmpeg_compatible-3.6.dist-info}/licenses/LICENSE +0 -0
  71. {typed_ffmpeg_compatible-3.5.2.dist-info → typed_ffmpeg_compatible-3.6.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,711 @@
1
+ # NOTE: this file is auto-generated, do not modify
2
+ """FFmpeg codec options."""
3
+
4
+ from typing import Literal
5
+
6
+ from ..schema import FFMpegOptionGroup
7
+ from ..utils.frozendict import merge
8
+
9
+
10
+ class FFMpegAVCodecContextEncoderOption(FFMpegOptionGroup):
11
+ """AVCodecContext Encoder options."""
12
+
13
+
14
+ class FFMpegAVCodecContextDecoderOption(FFMpegOptionGroup):
15
+ """AVCodecContext Decoder options."""
16
+
17
+
18
+ def encoder_codec_context(
19
+ *,
20
+ b: int | None = None,
21
+ ab: int | None = None,
22
+ bt: int | None = None,
23
+ flags: str | None = None,
24
+ export_side_data: str | None = None,
25
+ g: int | None = None,
26
+ ar: int | None = None,
27
+ ac: int | None = None,
28
+ cutoff: int | None = None,
29
+ frame_size: int | None = None,
30
+ qcomp: float | None = None,
31
+ qblur: float | None = None,
32
+ qmin: int | None = None,
33
+ qmax: int | None = None,
34
+ qdiff: int | None = None,
35
+ bf: int | None = None,
36
+ b_qfactor: float | None = None,
37
+ strict: int
38
+ | None
39
+ | Literal["very", "strict", "normal", "unofficial", "experimental"] = None,
40
+ b_qoffset: float | None = None,
41
+ err_detect: str | None = None,
42
+ maxrate: int | None = None,
43
+ minrate: int | None = None,
44
+ bufsize: int | None = None,
45
+ i_qfactor: float | None = None,
46
+ i_qoffset: float | None = None,
47
+ dct: int
48
+ | None
49
+ | Literal["auto", "fastint", "int", "mmx", "altivec", "faan"] = None,
50
+ lumi_mask: float | None = None,
51
+ tcplx_mask: float | None = None,
52
+ scplx_mask: float | None = None,
53
+ p_mask: float | None = None,
54
+ dark_mask: float | None = None,
55
+ idct: int
56
+ | None
57
+ | Literal[
58
+ "auto",
59
+ "int",
60
+ "simple",
61
+ "simplemmx",
62
+ "arm",
63
+ "altivec",
64
+ "simplearm",
65
+ "simplearmv5te",
66
+ "simplearmv6",
67
+ "simpleneon",
68
+ "xvid",
69
+ "xvidmmx",
70
+ "faani",
71
+ "simpleauto",
72
+ ] = None,
73
+ aspect: str | None = None,
74
+ debug: str | None = None,
75
+ dia_size: int | None = None,
76
+ last_pred: int | None = None,
77
+ pre_dia_size: int | None = None,
78
+ subq: int | None = None,
79
+ me_range: int | None = None,
80
+ global_quality: int | None = None,
81
+ mbd: int | None | Literal["simple", "bits", "rd"] = None,
82
+ rc_init_occupancy: int | None = None,
83
+ threads: int | None | Literal["auto"] = None,
84
+ dc: int | None = None,
85
+ nssew: int | None = None,
86
+ profile: int | None | Literal["unknown", "main10"] = None,
87
+ level: int | None | Literal["unknown"] = None,
88
+ cmp: int
89
+ | None
90
+ | Literal[
91
+ "sad",
92
+ "sse",
93
+ "satd",
94
+ "dct",
95
+ "psnr",
96
+ "bit",
97
+ "rd",
98
+ "zero",
99
+ "vsad",
100
+ "vsse",
101
+ "nsse",
102
+ "w53",
103
+ "w97",
104
+ "dctmax",
105
+ "chroma",
106
+ "msad",
107
+ ] = None,
108
+ subcmp: int
109
+ | None
110
+ | Literal[
111
+ "sad",
112
+ "sse",
113
+ "satd",
114
+ "dct",
115
+ "psnr",
116
+ "bit",
117
+ "rd",
118
+ "zero",
119
+ "vsad",
120
+ "vsse",
121
+ "nsse",
122
+ "w53",
123
+ "w97",
124
+ "dctmax",
125
+ "chroma",
126
+ "msad",
127
+ ] = None,
128
+ mbcmp: int
129
+ | None
130
+ | Literal[
131
+ "sad",
132
+ "sse",
133
+ "satd",
134
+ "dct",
135
+ "psnr",
136
+ "bit",
137
+ "rd",
138
+ "zero",
139
+ "vsad",
140
+ "vsse",
141
+ "nsse",
142
+ "w53",
143
+ "w97",
144
+ "dctmax",
145
+ "chroma",
146
+ "msad",
147
+ ] = None,
148
+ ildctcmp: int
149
+ | None
150
+ | Literal[
151
+ "sad",
152
+ "sse",
153
+ "satd",
154
+ "dct",
155
+ "psnr",
156
+ "bit",
157
+ "rd",
158
+ "zero",
159
+ "vsad",
160
+ "vsse",
161
+ "nsse",
162
+ "w53",
163
+ "w97",
164
+ "dctmax",
165
+ "chroma",
166
+ "msad",
167
+ ] = None,
168
+ precmp: int
169
+ | None
170
+ | Literal[
171
+ "sad",
172
+ "sse",
173
+ "satd",
174
+ "dct",
175
+ "psnr",
176
+ "bit",
177
+ "rd",
178
+ "zero",
179
+ "vsad",
180
+ "vsse",
181
+ "nsse",
182
+ "w53",
183
+ "w97",
184
+ "dctmax",
185
+ "chroma",
186
+ "msad",
187
+ ] = None,
188
+ mblmin: int | None = None,
189
+ mblmax: int | None = None,
190
+ bidir_refine: int | None = None,
191
+ keyint_min: int | None = None,
192
+ refs: int | None = None,
193
+ trellis: int | None = None,
194
+ mv0_threshold: int | None = None,
195
+ compression_level: int | None = None,
196
+ ch_layout: str | None = None,
197
+ channel_layout: str | None = None,
198
+ rc_max_vbv_use: float | None = None,
199
+ rc_min_vbv_use: float | None = None,
200
+ ticks_per_frame: int | None = None,
201
+ color_primaries: int
202
+ | None
203
+ | Literal[
204
+ "bt709",
205
+ "unknown",
206
+ "bt470m",
207
+ "bt470bg",
208
+ "smpte170m",
209
+ "smpte240m",
210
+ "film",
211
+ "bt2020",
212
+ "smpte428",
213
+ "smpte428_1",
214
+ "smpte431",
215
+ "smpte432",
216
+ "jedec-p22",
217
+ "ebu3213",
218
+ "unspecified",
219
+ ] = None,
220
+ color_trc: int
221
+ | None
222
+ | Literal[
223
+ "bt709",
224
+ "unknown",
225
+ "gamma22",
226
+ "gamma28",
227
+ "smpte170m",
228
+ "smpte240m",
229
+ "linear",
230
+ "log100",
231
+ "log316",
232
+ "iec61966-2-4",
233
+ "bt1361e",
234
+ "iec61966-2-1",
235
+ "bt2020-10",
236
+ "bt2020-12",
237
+ "smpte2084",
238
+ "smpte428",
239
+ "arib-std-b67",
240
+ "unspecified",
241
+ "log",
242
+ "log_sqrt",
243
+ "iec61966_2_4",
244
+ "bt1361",
245
+ "iec61966_2_1",
246
+ "bt2020_10bit",
247
+ "bt2020_12bit",
248
+ "smpte428_1",
249
+ ] = None,
250
+ colorspace: int
251
+ | None
252
+ | Literal[
253
+ "rgb",
254
+ "bt709",
255
+ "unknown",
256
+ "fcc",
257
+ "bt470bg",
258
+ "smpte170m",
259
+ "smpte240m",
260
+ "ycgco",
261
+ "bt2020nc",
262
+ "bt2020c",
263
+ "smpte2085",
264
+ "chroma-derived-nc",
265
+ "chroma-derived-c",
266
+ "ictcp",
267
+ "unspecified",
268
+ "ycocg",
269
+ "bt2020_ncl",
270
+ "bt2020_cl",
271
+ ] = None,
272
+ color_range: int
273
+ | None
274
+ | Literal[
275
+ "unknown", "tv", "pc", "unspecified", "mpeg", "jpeg", "limited", "full"
276
+ ] = None,
277
+ chroma_sample_location: int
278
+ | None
279
+ | Literal[
280
+ "unknown",
281
+ "left",
282
+ "center",
283
+ "topleft",
284
+ "top",
285
+ "bottomleft",
286
+ "bottom",
287
+ "unspecified",
288
+ ] = None,
289
+ slices: int | None = None,
290
+ thread_type: str | None = None,
291
+ audio_service_type: int
292
+ | None
293
+ | Literal["ma", "ef", "vi", "hi", "di", "co", "em", "vo", "ka"] = None,
294
+ field_order: int | None | Literal["progressive", "tt", "bb", "tb", "bt"] = None,
295
+ dump_separator: str | None = None,
296
+ max_pixels: int | None = None,
297
+ max_samples: int | None = None,
298
+ ) -> FFMpegAVCodecContextEncoderOption:
299
+ """
300
+ Encoder codec context options.
301
+
302
+ Args:
303
+ b: set bitrate (in bits/s) (from 0 to I64_MAX) (default 200000),
304
+ ab: set bitrate (in bits/s) (from 0 to INT_MAX) (default 128000),
305
+ bt: Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate tolerance specifies how far ratecontrol is willing to deviate from the target average bitrate value. This is not related to minimum/maximum bitrate. Lowering tolerance too much has an adverse effect on quality. (from 0 to INT_MAX) (default 4000000),
306
+ flags: (default 0),
307
+ export_side_data: Export metadata as side data (default 0),
308
+ g: set the group of picture (GOP) size (from INT_MIN to INT_MAX) (default 12),
309
+ ar: set audio sampling rate (in Hz) (from 0 to INT_MAX) (default 0),
310
+ ac: set number of audio channels (from 0 to INT_MAX) (default 0),
311
+ cutoff: set cutoff bandwidth (from INT_MIN to INT_MAX) (default 0),
312
+ frame_size: (from 0 to INT_MAX) (default 0),
313
+ qcomp: video quantizer scale compression (VBR). Constant of ratecontrol equation. Recommended range for default rc_eq: 0.0-1.0 (from -FLT_MAX to FLT_MAX) (default 0.5),
314
+ qblur: video quantizer scale blur (VBR) (from -1 to FLT_MAX) (default 0.5),
315
+ qmin: minimum video quantizer scale (VBR) (from -1 to 69) (default 2),
316
+ qmax: maximum video quantizer scale (VBR) (from -1 to 1024) (default 31),
317
+ qdiff: maximum difference between the quantizer scales (VBR) (from INT_MIN to INT_MAX) (default 3),
318
+ bf: set maximum number of B-frames between non-B-frames (from -1 to INT_MAX) (default 0),
319
+ b_qfactor: QP factor between P- and B-frames (from -FLT_MAX to FLT_MAX) (default 1.25),
320
+ strict: how strictly to follow the standards (from INT_MIN to INT_MAX) (default normal),
321
+ b_qoffset: QP offset between P- and B-frames (from -FLT_MAX to FLT_MAX) (default 1.25),
322
+ err_detect: set error detection flags (default 0),
323
+ maxrate: maximum bitrate (in bits/s). Used for VBV together with bufsize. (from 0 to INT_MAX) (default 0),
324
+ minrate: minimum bitrate (in bits/s). Most useful in setting up a CBR encode. It is of little use otherwise. (from INT_MIN to INT_MAX) (default 0),
325
+ bufsize: set ratecontrol buffer size (in bits) (from INT_MIN to INT_MAX) (default 0),
326
+ i_qfactor: QP factor between P- and I-frames (from -FLT_MAX to FLT_MAX) (default -0.8),
327
+ i_qoffset: QP offset between P- and I-frames (from -FLT_MAX to FLT_MAX) (default 0),
328
+ dct: DCT algorithm (from 0 to INT_MAX) (default auto),
329
+ lumi_mask: compresses bright areas stronger than medium ones (from -FLT_MAX to FLT_MAX) (default 0),
330
+ tcplx_mask: temporal complexity masking (from -FLT_MAX to FLT_MAX) (default 0),
331
+ scplx_mask: spatial complexity masking (from -FLT_MAX to FLT_MAX) (default 0),
332
+ p_mask: inter masking (from -FLT_MAX to FLT_MAX) (default 0),
333
+ dark_mask: compresses dark areas stronger than medium ones (from -FLT_MAX to FLT_MAX) (default 0),
334
+ idct: select IDCT implementation (from 0 to INT_MAX) (default auto),
335
+ aspect: sample aspect ratio (from 0 to 10) (default 0/1),
336
+ debug: print specific debug info (default 0),
337
+ dia_size: diamond type & size for motion estimation (from INT_MIN to INT_MAX) (default 0),
338
+ last_pred: amount of motion predictors from the previous frame (from INT_MIN to INT_MAX) (default 0),
339
+ pre_dia_size: diamond type & size for motion estimation pre-pass (from INT_MIN to INT_MAX) (default 0),
340
+ subq: sub-pel motion estimation quality (from INT_MIN to INT_MAX) (default 8),
341
+ me_range: limit motion vectors range (1023 for DivX player) (from INT_MIN to INT_MAX) (default 0),
342
+ global_quality: (from INT_MIN to INT_MAX) (default 0),
343
+ mbd: macroblock decision algorithm (high quality mode) (from 0 to 2) (default simple),
344
+ rc_init_occupancy: number of bits which should be loaded into the rc buffer before decoding starts (from INT_MIN to INT_MAX) (default 0),
345
+ threads: set the number of threads (from 0 to INT_MAX) (default 1),
346
+ dc: intra_dc_precision (from -8 to 16) (default 0),
347
+ nssew: nsse weight (from INT_MIN to INT_MAX) (default 8),
348
+ profile: (from INT_MIN to INT_MAX) (default unknown),
349
+ level: encoding level, usually corresponding to the profile level, codec-specific (from INT_MIN to INT_MAX) (default unknown),
350
+ cmp: full-pel ME compare function (from INT_MIN to INT_MAX) (default sad),
351
+ subcmp: sub-pel ME compare function (from INT_MIN to INT_MAX) (default sad),
352
+ mbcmp: macroblock compare function (from INT_MIN to INT_MAX) (default sad),
353
+ ildctcmp: interlaced DCT compare function (from INT_MIN to INT_MAX) (default vsad),
354
+ precmp: pre motion estimation compare function (from INT_MIN to INT_MAX) (default sad),
355
+ mblmin: minimum macroblock Lagrange factor (VBR) (from 1 to 32767) (default 236),
356
+ mblmax: maximum macroblock Lagrange factor (VBR) (from 1 to 32767) (default 3658),
357
+ bidir_refine: refine the two motion vectors used in bidirectional macroblocks (from 0 to 4) (default 1),
358
+ keyint_min: minimum interval between IDR-frames (from INT_MIN to INT_MAX) (default 25),
359
+ refs: reference frames to consider for motion compensation (from INT_MIN to INT_MAX) (default 1),
360
+ trellis: rate-distortion optimal quantization (from INT_MIN to INT_MAX) (default 0),
361
+ mv0_threshold: (from 0 to INT_MAX) (default 256),
362
+ compression_level: (from INT_MIN to INT_MAX) (default -1),
363
+ ch_layout: ,
364
+ channel_layout: (default 0x0),
365
+ rc_max_vbv_use: (from 0 to FLT_MAX) (default 0),
366
+ rc_min_vbv_use: (from 0 to FLT_MAX) (default 3),
367
+ ticks_per_frame: (from 1 to INT_MAX) (default 1),
368
+ color_primaries: color primaries (from 1 to INT_MAX) (default unknown),
369
+ color_trc: color transfer characteristics (from 1 to INT_MAX) (default unknown),
370
+ colorspace: color space (from 0 to INT_MAX) (default unknown),
371
+ color_range: color range (from 0 to INT_MAX) (default unknown),
372
+ chroma_sample_location: chroma sample location (from 0 to INT_MAX) (default unknown),
373
+ slices: set the number of slices, used in parallelized encoding (from 0 to INT_MAX) (default 0),
374
+ thread_type: select multithreading type (default slice+frame),
375
+ audio_service_type: audio service type (from 0 to 8) (default ma),
376
+ field_order: Field order (from 0 to 5) (default 0),
377
+ dump_separator: set information dump field separator,
378
+ max_pixels: Maximum number of pixels (from 0 to INT_MAX) (default INT_MAX),
379
+ max_samples: Maximum number of samples (from 0 to INT_MAX) (default INT_MAX),
380
+
381
+ Returns:
382
+ FFMpegAVCodecContextEncoderOption
383
+
384
+ """
385
+ return FFMpegAVCodecContextEncoderOption(
386
+ merge({
387
+ "b": b,
388
+ "ab": ab,
389
+ "bt": bt,
390
+ "flags": flags,
391
+ "export_side_data": export_side_data,
392
+ "g": g,
393
+ "ar": ar,
394
+ "ac": ac,
395
+ "cutoff": cutoff,
396
+ "frame_size": frame_size,
397
+ "qcomp": qcomp,
398
+ "qblur": qblur,
399
+ "qmin": qmin,
400
+ "qmax": qmax,
401
+ "qdiff": qdiff,
402
+ "bf": bf,
403
+ "b_qfactor": b_qfactor,
404
+ "strict": strict,
405
+ "b_qoffset": b_qoffset,
406
+ "err_detect": err_detect,
407
+ "maxrate": maxrate,
408
+ "minrate": minrate,
409
+ "bufsize": bufsize,
410
+ "i_qfactor": i_qfactor,
411
+ "i_qoffset": i_qoffset,
412
+ "dct": dct,
413
+ "lumi_mask": lumi_mask,
414
+ "tcplx_mask": tcplx_mask,
415
+ "scplx_mask": scplx_mask,
416
+ "p_mask": p_mask,
417
+ "dark_mask": dark_mask,
418
+ "idct": idct,
419
+ "aspect": aspect,
420
+ "debug": debug,
421
+ "dia_size": dia_size,
422
+ "last_pred": last_pred,
423
+ "pre_dia_size": pre_dia_size,
424
+ "subq": subq,
425
+ "me_range": me_range,
426
+ "global_quality": global_quality,
427
+ "mbd": mbd,
428
+ "rc_init_occupancy": rc_init_occupancy,
429
+ "threads": threads,
430
+ "dc": dc,
431
+ "nssew": nssew,
432
+ "profile": profile,
433
+ "level": level,
434
+ "cmp": cmp,
435
+ "subcmp": subcmp,
436
+ "mbcmp": mbcmp,
437
+ "ildctcmp": ildctcmp,
438
+ "precmp": precmp,
439
+ "mblmin": mblmin,
440
+ "mblmax": mblmax,
441
+ "bidir_refine": bidir_refine,
442
+ "keyint_min": keyint_min,
443
+ "refs": refs,
444
+ "trellis": trellis,
445
+ "mv0_threshold": mv0_threshold,
446
+ "compression_level": compression_level,
447
+ "ch_layout": ch_layout,
448
+ "channel_layout": channel_layout,
449
+ "rc_max_vbv_use": rc_max_vbv_use,
450
+ "rc_min_vbv_use": rc_min_vbv_use,
451
+ "ticks_per_frame": ticks_per_frame,
452
+ "color_primaries": color_primaries,
453
+ "color_trc": color_trc,
454
+ "colorspace": colorspace,
455
+ "color_range": color_range,
456
+ "chroma_sample_location": chroma_sample_location,
457
+ "slices": slices,
458
+ "thread_type": thread_type,
459
+ "audio_service_type": audio_service_type,
460
+ "field_order": field_order,
461
+ "dump_separator": dump_separator,
462
+ "max_pixels": max_pixels,
463
+ "max_samples": max_samples,
464
+ })
465
+ )
466
+
467
+
468
+ def decoder_codec_context(
469
+ *,
470
+ flags: str | None = None,
471
+ export_side_data: str | None = None,
472
+ ar: int | None = None,
473
+ ac: int | None = None,
474
+ bug: str | None = None,
475
+ strict: int
476
+ | None
477
+ | Literal["very", "strict", "normal", "unofficial", "experimental"] = None,
478
+ err_detect: str | None = None,
479
+ idct: int
480
+ | None
481
+ | Literal[
482
+ "auto",
483
+ "int",
484
+ "simple",
485
+ "simplemmx",
486
+ "arm",
487
+ "altivec",
488
+ "simplearm",
489
+ "simplearmv5te",
490
+ "simplearmv6",
491
+ "simpleneon",
492
+ "xvid",
493
+ "xvidmmx",
494
+ "faani",
495
+ "simpleauto",
496
+ ] = None,
497
+ ec: str | None = None,
498
+ debug: str | None = None,
499
+ threads: int | None | Literal["auto"] = None,
500
+ skip_top: int | None = None,
501
+ skip_bottom: int | None = None,
502
+ lowres: int | None = None,
503
+ skip_loop_filter: int
504
+ | None
505
+ | Literal["none", "default", "noref", "bidir", "nointra", "nokey", "all"] = None,
506
+ skip_idct: int
507
+ | None
508
+ | Literal["none", "default", "noref", "bidir", "nointra", "nokey", "all"] = None,
509
+ skip_frame: int
510
+ | None
511
+ | Literal["none", "default", "noref", "bidir", "nointra", "nokey", "all"] = None,
512
+ ch_layout: str | None = None,
513
+ channel_layout: str | None = None,
514
+ request_channel_layout: str | None = None,
515
+ ticks_per_frame: int | None = None,
516
+ color_primaries: int
517
+ | None
518
+ | Literal[
519
+ "bt709",
520
+ "unknown",
521
+ "bt470m",
522
+ "bt470bg",
523
+ "smpte170m",
524
+ "smpte240m",
525
+ "film",
526
+ "bt2020",
527
+ "smpte428",
528
+ "smpte428_1",
529
+ "smpte431",
530
+ "smpte432",
531
+ "jedec-p22",
532
+ "ebu3213",
533
+ "unspecified",
534
+ ] = None,
535
+ color_trc: int
536
+ | None
537
+ | Literal[
538
+ "bt709",
539
+ "unknown",
540
+ "gamma22",
541
+ "gamma28",
542
+ "smpte170m",
543
+ "smpte240m",
544
+ "linear",
545
+ "log100",
546
+ "log316",
547
+ "iec61966-2-4",
548
+ "bt1361e",
549
+ "iec61966-2-1",
550
+ "bt2020-10",
551
+ "bt2020-12",
552
+ "smpte2084",
553
+ "smpte428",
554
+ "arib-std-b67",
555
+ "unspecified",
556
+ "log",
557
+ "log_sqrt",
558
+ "iec61966_2_4",
559
+ "bt1361",
560
+ "iec61966_2_1",
561
+ "bt2020_10bit",
562
+ "bt2020_12bit",
563
+ "smpte428_1",
564
+ ] = None,
565
+ colorspace: int
566
+ | None
567
+ | Literal[
568
+ "rgb",
569
+ "bt709",
570
+ "unknown",
571
+ "fcc",
572
+ "bt470bg",
573
+ "smpte170m",
574
+ "smpte240m",
575
+ "ycgco",
576
+ "bt2020nc",
577
+ "bt2020c",
578
+ "smpte2085",
579
+ "chroma-derived-nc",
580
+ "chroma-derived-c",
581
+ "ictcp",
582
+ "unspecified",
583
+ "ycocg",
584
+ "bt2020_ncl",
585
+ "bt2020_cl",
586
+ ] = None,
587
+ color_range: int
588
+ | None
589
+ | Literal[
590
+ "unknown", "tv", "pc", "unspecified", "mpeg", "jpeg", "limited", "full"
591
+ ] = None,
592
+ chroma_sample_location: int
593
+ | None
594
+ | Literal[
595
+ "unknown",
596
+ "left",
597
+ "center",
598
+ "topleft",
599
+ "top",
600
+ "bottomleft",
601
+ "bottom",
602
+ "unspecified",
603
+ ] = None,
604
+ thread_type: str | None = None,
605
+ request_sample_fmt: str | None = None,
606
+ sub_charenc: str | None = None,
607
+ sub_charenc_mode: str | None = None,
608
+ apply_cropping: bool | None = None,
609
+ skip_alpha: bool | None = None,
610
+ field_order: int | None | Literal["progressive", "tt", "bb", "tb", "bt"] = None,
611
+ dump_separator: str | None = None,
612
+ codec_whitelist: str | None = None,
613
+ max_pixels: int | None = None,
614
+ max_samples: int | None = None,
615
+ hwaccel_flags: str | None = None,
616
+ extra_hw_frames: int | None = None,
617
+ discard_damaged_percentage: int | None = None,
618
+ ) -> FFMpegAVCodecContextDecoderOption:
619
+ """
620
+ Decoder codec context options.
621
+
622
+ Args:
623
+ flags: (default 0),
624
+ export_side_data: Export metadata as side data (default 0),
625
+ ar: set audio sampling rate (in Hz) (from 0 to INT_MAX) (default 0),
626
+ ac: set number of audio channels (from 0 to INT_MAX) (default 0),
627
+ bug: work around not autodetected encoder bugs (default autodetect),
628
+ strict: how strictly to follow the standards (from INT_MIN to INT_MAX) (default normal),
629
+ err_detect: set error detection flags (default 0),
630
+ idct: select IDCT implementation (from 0 to INT_MAX) (default auto),
631
+ ec: set error concealment strategy (default guess_mvs+deblock),
632
+ debug: print specific debug info (default 0),
633
+ threads: set the number of threads (from 0 to INT_MAX) (default 1),
634
+ skip_top: number of macroblock rows at the top which are skipped (from INT_MIN to INT_MAX) (default 0),
635
+ skip_bottom: number of macroblock rows at the bottom which are skipped (from INT_MIN to INT_MAX) (default 0),
636
+ lowres: decode at 1= 1/2, 2=1/4, 3=1/8 resolutions (from 0 to INT_MAX) (default 0),
637
+ skip_loop_filter: skip loop filtering process for the selected frames (from INT_MIN to INT_MAX) (default default),
638
+ skip_idct: skip IDCT/dequantization for the selected frames (from INT_MIN to INT_MAX) (default default),
639
+ skip_frame: skip decoding for the selected frames (from INT_MIN to INT_MAX) (default default),
640
+ ch_layout: ,
641
+ channel_layout: (default 0x0),
642
+ request_channel_layout: (default 0x0),
643
+ ticks_per_frame: (from 1 to INT_MAX) (default 1),
644
+ color_primaries: color primaries (from 1 to INT_MAX) (default unknown),
645
+ color_trc: color transfer characteristics (from 1 to INT_MAX) (default unknown),
646
+ colorspace: color space (from 0 to INT_MAX) (default unknown),
647
+ color_range: color range (from 0 to INT_MAX) (default unknown),
648
+ chroma_sample_location: chroma sample location (from 0 to INT_MAX) (default unknown),
649
+ thread_type: select multithreading type (default slice+frame),
650
+ request_sample_fmt: sample format audio decoders should prefer (default none),
651
+ sub_charenc: set input text subtitles character encoding,
652
+ sub_charenc_mode: set input text subtitles character encoding mode (default 0),
653
+ apply_cropping: (default true),
654
+ skip_alpha: Skip processing alpha (default false),
655
+ field_order: Field order (from 0 to 5) (default 0),
656
+ dump_separator: set information dump field separator,
657
+ codec_whitelist: List of decoders that are allowed to be used,
658
+ max_pixels: Maximum number of pixels (from 0 to INT_MAX) (default INT_MAX),
659
+ max_samples: Maximum number of samples (from 0 to INT_MAX) (default INT_MAX),
660
+ hwaccel_flags: (default ignore_level),
661
+ extra_hw_frames: Number of extra hardware frames to allocate for the user (from -1 to INT_MAX) (default -1),
662
+ discard_damaged_percentage: Percentage of damaged samples to discard a frame (from 0 to 100) (default 95),
663
+
664
+ Returns:
665
+ FFMpegAVCodecContextDecoderOption
666
+
667
+ """
668
+ return FFMpegAVCodecContextDecoderOption(
669
+ merge({
670
+ "flags": flags,
671
+ "export_side_data": export_side_data,
672
+ "ar": ar,
673
+ "ac": ac,
674
+ "bug": bug,
675
+ "strict": strict,
676
+ "err_detect": err_detect,
677
+ "idct": idct,
678
+ "ec": ec,
679
+ "debug": debug,
680
+ "threads": threads,
681
+ "skip_top": skip_top,
682
+ "skip_bottom": skip_bottom,
683
+ "lowres": lowres,
684
+ "skip_loop_filter": skip_loop_filter,
685
+ "skip_idct": skip_idct,
686
+ "skip_frame": skip_frame,
687
+ "ch_layout": ch_layout,
688
+ "channel_layout": channel_layout,
689
+ "request_channel_layout": request_channel_layout,
690
+ "ticks_per_frame": ticks_per_frame,
691
+ "color_primaries": color_primaries,
692
+ "color_trc": color_trc,
693
+ "colorspace": colorspace,
694
+ "color_range": color_range,
695
+ "chroma_sample_location": chroma_sample_location,
696
+ "thread_type": thread_type,
697
+ "request_sample_fmt": request_sample_fmt,
698
+ "sub_charenc": sub_charenc,
699
+ "sub_charenc_mode": sub_charenc_mode,
700
+ "apply_cropping": apply_cropping,
701
+ "skip_alpha": skip_alpha,
702
+ "field_order": field_order,
703
+ "dump_separator": dump_separator,
704
+ "codec_whitelist": codec_whitelist,
705
+ "max_pixels": max_pixels,
706
+ "max_samples": max_samples,
707
+ "hwaccel_flags": hwaccel_flags,
708
+ "extra_hw_frames": extra_hw_frames,
709
+ "discard_damaged_percentage": discard_damaged_percentage,
710
+ })
711
+ )