Skip to content

Admin Config F Fmpeg Dto

immichpy.client.generated.models.admin_config_f_fmpeg_dto.AdminConfigFFmpegDto pydantic-model

Bases: BaseModel

AdminConfigFFmpegDto

Show JSON schema:
{
  "$defs": {
    "AdminConfigFFmpegRealtimeDto": {
      "description": "AdminConfigFFmpegRealtimeDto",
      "properties": {
        "enabled": {
          "description": "Enable real-time HLS transcoding (alpha)",
          "title": "Enabled",
          "type": "boolean"
        },
        "resolutions": {
          "description": "Resolutions to use for real-time HLS transcoding",
          "items": {
            "$ref": "#/$defs/HlsVideoResolution"
          },
          "title": "Resolutions",
          "type": "array"
        },
        "videoCodecs": {
          "description": "Video codecs to use for real-time HLS transcoding",
          "items": {
            "$ref": "#/$defs/VideoCodec"
          },
          "title": "Videocodecs",
          "type": "array"
        }
      },
      "required": [
        "enabled",
        "resolutions",
        "videoCodecs"
      ],
      "title": "AdminConfigFFmpegRealtimeDto",
      "type": "object"
    },
    "AudioCodec": {
      "description": "Target audio codec",
      "enum": [
        "mp3",
        "aac",
        "opus",
        "pcm_s16le"
      ],
      "title": "AudioCodec",
      "type": "string"
    },
    "CQMode": {
      "description": "CQ mode",
      "enum": [
        "auto",
        "cqp",
        "icq"
      ],
      "title": "CQMode",
      "type": "string"
    },
    "HlsVideoResolution": {
      "description": "HLS video resolution",
      "enum": [
        480,
        720,
        1080,
        1440,
        2160
      ],
      "title": "HlsVideoResolution",
      "type": "integer"
    },
    "ToneMapping": {
      "description": "Tone mapping",
      "enum": [
        "hable",
        "mobius",
        "reinhard",
        "disabled"
      ],
      "title": "ToneMapping",
      "type": "string"
    },
    "TranscodeHWAccel": {
      "description": "Transcode hardware acceleration",
      "enum": [
        "nvenc",
        "qsv",
        "vaapi",
        "rkmpp",
        "disabled"
      ],
      "title": "TranscodeHWAccel",
      "type": "string"
    },
    "TranscodePolicy": {
      "description": "Transcode policy",
      "enum": [
        "all",
        "optimal",
        "bitrate",
        "required",
        "disabled"
      ],
      "title": "TranscodePolicy",
      "type": "string"
    },
    "VideoCodec": {
      "description": "Target video codec",
      "enum": [
        "h264",
        "hevc",
        "vp9",
        "av1"
      ],
      "title": "VideoCodec",
      "type": "string"
    },
    "VideoContainer": {
      "description": "Accepted video containers",
      "enum": [
        "mov",
        "mp4",
        "ogg",
        "webm"
      ],
      "title": "VideoContainer",
      "type": "string"
    }
  },
  "description": "AdminConfigFFmpegDto",
  "properties": {
    "accel": {
      "$ref": "#/$defs/TranscodeHWAccel"
    },
    "accelDecode": {
      "description": "Accelerated decode",
      "title": "Acceldecode",
      "type": "boolean"
    },
    "acceptedAudioCodecs": {
      "description": "Accepted audio codecs",
      "items": {
        "$ref": "#/$defs/AudioCodec"
      },
      "title": "Acceptedaudiocodecs",
      "type": "array"
    },
    "acceptedContainers": {
      "description": "Accepted containers",
      "items": {
        "$ref": "#/$defs/VideoContainer"
      },
      "title": "Acceptedcontainers",
      "type": "array"
    },
    "acceptedVideoCodecs": {
      "description": "Accepted video codecs",
      "items": {
        "$ref": "#/$defs/VideoCodec"
      },
      "title": "Acceptedvideocodecs",
      "type": "array"
    },
    "bframes": {
      "description": "B-frames",
      "maximum": 16,
      "minimum": -1,
      "title": "Bframes",
      "type": "integer"
    },
    "cqMode": {
      "$ref": "#/$defs/CQMode"
    },
    "crf": {
      "description": "CRF",
      "maximum": 51,
      "minimum": 0,
      "title": "Crf",
      "type": "integer"
    },
    "gopSize": {
      "description": "GOP size",
      "maximum": 9007199254740991,
      "minimum": 0,
      "title": "Gopsize",
      "type": "integer"
    },
    "maxBitrate": {
      "description": "Max bitrate",
      "title": "Maxbitrate",
      "type": "string"
    },
    "preferredHwDevice": {
      "description": "Preferred hardware device",
      "title": "Preferredhwdevice",
      "type": "string"
    },
    "preset": {
      "description": "Preset",
      "title": "Preset",
      "type": "string"
    },
    "realtime": {
      "$ref": "#/$defs/AdminConfigFFmpegRealtimeDto"
    },
    "refs": {
      "description": "References",
      "maximum": 6,
      "minimum": 0,
      "title": "Refs",
      "type": "integer"
    },
    "targetAudioCodec": {
      "$ref": "#/$defs/AudioCodec"
    },
    "targetResolution": {
      "description": "Target resolution",
      "title": "Targetresolution",
      "type": "string"
    },
    "targetVideoCodec": {
      "$ref": "#/$defs/VideoCodec"
    },
    "temporalAQ": {
      "description": "Temporal AQ",
      "title": "Temporalaq",
      "type": "boolean"
    },
    "threads": {
      "description": "Threads",
      "maximum": 9007199254740991,
      "minimum": 0,
      "title": "Threads",
      "type": "integer"
    },
    "tonemap": {
      "$ref": "#/$defs/ToneMapping"
    },
    "transcode": {
      "$ref": "#/$defs/TranscodePolicy"
    },
    "twoPass": {
      "description": "Two pass",
      "title": "Twopass",
      "type": "boolean"
    }
  },
  "required": [
    "accel",
    "accelDecode",
    "acceptedAudioCodecs",
    "acceptedContainers",
    "acceptedVideoCodecs",
    "bframes",
    "cqMode",
    "crf",
    "gopSize",
    "maxBitrate",
    "preferredHwDevice",
    "preset",
    "realtime",
    "refs",
    "targetAudioCodec",
    "targetResolution",
    "targetVideoCodec",
    "temporalAQ",
    "threads",
    "tonemap",
    "transcode",
    "twoPass"
  ],
  "title": "AdminConfigFFmpegDto",
  "type": "object"
}

Config:

  • validate_by_name: True
  • validate_by_alias: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

accel_decode pydantic-field

accel_decode: StrictBool

Accelerated decode

accepted_audio_codecs pydantic-field

accepted_audio_codecs: List[AudioCodec]

Accepted audio codecs

accepted_containers pydantic-field

accepted_containers: List[VideoContainer]

Accepted containers

accepted_video_codecs pydantic-field

accepted_video_codecs: List[VideoCodec]

Accepted video codecs

bframes pydantic-field

bframes: Annotated[int, Field(le=16, strict=True, ge=-1)]

B-frames

crf pydantic-field

crf: Annotated[int, Field(le=51, strict=True, ge=0)]

CRF

gop_size pydantic-field

gop_size: Annotated[int, Field(le=9007199254740991, strict=True, ge=0)]

GOP size

max_bitrate pydantic-field

max_bitrate: StrictStr

Max bitrate

preferred_hw_device pydantic-field

preferred_hw_device: StrictStr

Preferred hardware device

preset pydantic-field

preset: StrictStr

Preset

refs pydantic-field

refs: Annotated[int, Field(le=6, strict=True, ge=0)]

References

target_resolution pydantic-field

target_resolution: StrictStr

Target resolution

temporal_aq pydantic-field

temporal_aq: StrictBool

Temporal AQ

threads pydantic-field

threads: Annotated[int, Field(le=9007199254740991, strict=True, ge=0)]

Threads

two_pass pydantic-field

two_pass: StrictBool

Two pass

from_dict classmethod

from_dict(obj: Optional[Dict[str, Any]]) -> Optional[Self]

Create an instance of AdminConfigFFmpegDto from a dict

Source code in immichpy/client/generated/models/admin_config_f_fmpeg_dto.py
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
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of AdminConfigFFmpegDto from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate(
        {
            "accel": obj.get("accel"),
            "accelDecode": obj.get("accelDecode"),
            "acceptedAudioCodecs": obj.get("acceptedAudioCodecs"),
            "acceptedContainers": obj.get("acceptedContainers"),
            "acceptedVideoCodecs": obj.get("acceptedVideoCodecs"),
            "bframes": obj.get("bframes"),
            "cqMode": obj.get("cqMode"),
            "crf": obj.get("crf"),
            "gopSize": obj.get("gopSize"),
            "maxBitrate": obj.get("maxBitrate"),
            "preferredHwDevice": obj.get("preferredHwDevice"),
            "preset": obj.get("preset"),
            "realtime": AdminConfigFFmpegRealtimeDto.from_dict(obj["realtime"])
            if obj.get("realtime") is not None
            else None,
            "refs": obj.get("refs"),
            "targetAudioCodec": obj.get("targetAudioCodec"),
            "targetResolution": obj.get("targetResolution"),
            "targetVideoCodec": obj.get("targetVideoCodec"),
            "temporalAQ": obj.get("temporalAQ"),
            "threads": obj.get("threads"),
            "tonemap": obj.get("tonemap"),
            "transcode": obj.get("transcode"),
            "twoPass": obj.get("twoPass"),
        }
    )
    return _obj

from_json classmethod

from_json(json_str: str) -> Optional[Self]

Create an instance of AdminConfigFFmpegDto from a JSON string

Source code in immichpy/client/generated/models/admin_config_f_fmpeg_dto.py
124
125
126
127
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of AdminConfigFFmpegDto from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict

to_dict() -> Dict[str, Any]

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in immichpy/client/generated/models/admin_config_f_fmpeg_dto.py
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # override the default output from pydantic by calling `to_dict()` of realtime
    if self.realtime:
        _dict["realtime"] = self.realtime.to_dict()
    return _dict

to_json

to_json() -> str

Returns the JSON representation of the model using alias

Source code in immichpy/client/generated/models/admin_config_f_fmpeg_dto.py
120
121
122
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    return json.dumps(to_jsonable_python(self.to_dict()))

to_str

to_str() -> str

Returns the string representation of the model using alias

Source code in immichpy/client/generated/models/admin_config_f_fmpeg_dto.py
116
117
118
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))