split out media data

This commit is contained in:
JasonLandbridge
2025-06-08 12:06:25 +02:00
parent cedee51d01
commit 8c1ba403db
86 changed files with 795 additions and 13 deletions

View File

@@ -179,19 +179,22 @@ items:
example: 1002625 example: 1002625
streamType: streamType:
type: integer type: integer
format: int32 oneOf:
- title: VIDEO
const: 1
description: Video stream
- title: AUDIO
const: 2
description: Audio stream
- title: SUBTITLE
const: 3
description: Subtitle stream
example: 1
description: | description: |
Stream type: Stream type:
- 1 = video - VIDEO = 1
- 2 = audio - AUDIO = 2
- 3 = subtitle - SUBTITLE = 3
enum: [1, 2, 3]
example: 1
x-speakeasy-unknown-values: allow
x-speakeasy-enums:
- VIDEO
- AUDIO
- SUBTITLE
format: format:
type: string type: string
description: "Format of the stream (e.g., srt)." description: "Format of the stream (e.g., srt)."

View File

@@ -0,0 +1,10 @@
type: object
required:
- aspectRatio
description: "Aspect ratio of the video."
properties:
aspectRatio:
type: number
format: float
description: "Aspect ratio of the video."
example: 2.35

View File

@@ -0,0 +1,10 @@
type: object
required:
- audioChannels
description: "Number of audio channels."
properties:
audioChannels:
type: integer
format: int32
description: "Number of audio channels."
example: 6

View File

@@ -0,0 +1,9 @@
type: object
required:
- audioCodec
description: "Audio codec used."
properties:
audioCodec:
type: string
description: "Audio codec used."
example: "eac3"

View File

@@ -0,0 +1,9 @@
type: object
required:
- audioProfile
description: "The audio profile used for the media."
properties:
audioProfile:
type: string
description: "The audio profile used for the media (e.g., DTS, Dolby Digital, etc.)."
example: "dts"

View File

@@ -0,0 +1,10 @@
type: object
required:
- bitrate
description: "Bitrate in bits per second."
properties:
bitrate:
type: integer
format: int32
description: "Bitrate in bits per second."
example: 25512

View File

@@ -0,0 +1,9 @@
type: object
required:
- container
description: "File container type."
properties:
container:
type: string
description: "File container type."
example: "mkv"

View File

@@ -0,0 +1,9 @@
type: object
required:
- displayOffset
description: "Display offset value."
properties:
displayOffset:
type: integer
format: int32
example: 50

View File

@@ -0,0 +1,10 @@
type: object
required:
- duration
description: "Duration of the media in milliseconds."
properties:
duration:
type: integer
format: int32
description: "Duration of the media in milliseconds."
example: 9610350

View File

@@ -0,0 +1,8 @@
type: object
required:
- has64bitOffsets
description: "Indicates whether the media has 64-bit offsets."
properties:
has64bitOffsets:
type: boolean
example: false

View File

@@ -0,0 +1,9 @@
type: object
required:
- hasVoiceActivity
description: "Indicates whether voice activity is detected."
properties:
hasVoiceActivity:
type: boolean
description: "Indicates whether voice activity is detected."
example: false

View File

@@ -0,0 +1,10 @@
type: object
required:
- height
description: "Video height in pixels."
properties:
height:
type: integer
format: int32
description: "Video height in pixels."
example: 1602

9
src/models/media/id.yaml Normal file
View File

@@ -0,0 +1,9 @@
type: object
required:
- id
description: "Unique media identifier."
properties:
id:
type: integer
description: "Unique media identifier."
example: 387322

View File

@@ -0,0 +1,13 @@
type: object
required:
- optimizedForStreaming
description: "Has this media been optimized for streaming."
properties:
optimizedForStreaming:
description: "Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true"
oneOf:
- type: integer
format: int32
enum: [0, 1]
- type: boolean
enum: [true, false]

View File

@@ -0,0 +1,9 @@
type: object
required:
- accessible
description: "Indicates if the part is accessible."
properties:
accessible:
type: boolean
description: "Indicates if the part is accessible."
example: true

View File

@@ -0,0 +1,9 @@
type: object
required:
- audioProfile
description: "The audio profile used for the media."
properties:
audioProfile:
type: string
description: "The audio profile used for the media (e.g., DTS, Dolby Digital, etc.)."
example: "dts"

View File

@@ -0,0 +1,9 @@
type: object
required:
- container
description: "Container format of the part."
properties:
container:
type: string
description: "Container format of the part."
example: "mkv"

View File

@@ -0,0 +1,10 @@
type: object
required:
- duration
description: "Duration of the part in milliseconds."
properties:
duration:
type: integer
format: int32
description: "Duration of the part in milliseconds."
example: 9610350

View File

@@ -0,0 +1,6 @@
type: object
properties:
exists:
type: boolean
description: "Indicates if the part exists."
example: true

View File

@@ -0,0 +1,9 @@
type: object
required:
- file
description: "File path for the part."
properties:
file:
type: string
description: "File path for the part."
example: "/mnt/Movies_1/W/Wicked (2024).mkv"

View File

@@ -0,0 +1,8 @@
type: object
required:
- has64bitOffsets
description: "Indicates whether the part has 64-bit offsets."
properties:
has64bitOffsets:
type: boolean
example: false

View File

@@ -0,0 +1,9 @@
type: object
required:
- hasThumbnail
description: "Indicates if the part has a thumbnail."
properties:
hasThumbnail:
allOf:
- description: "Indicates if the part has a thumbnail."
- $ref: "../models/common/PlexBooleanString.yaml"

View File

@@ -0,0 +1,9 @@
type: object
required:
- id
description: "Unique part identifier."
properties:
id:
type: integer
description: "Unique part identifier."
example: 418385

View File

@@ -0,0 +1,8 @@
type: object
required:
- indexes
description: "Indexes for the part."
properties:
indexes:
type: string
example: "sd"

View File

@@ -0,0 +1,9 @@
type: object
required:
- key
description: "Key to access this part."
properties:
key:
type: string
description: "Key to access this part."
example: "/library/parts/418385/1735864239/file.mkv"

View File

@@ -0,0 +1,13 @@
type: object
required:
- optimizedForStreaming
description: "Has this part been optimized for streaming."
properties:
optimizedForStreaming:
description: "Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true"
oneOf:
- type: integer
format: int32
enum: [0, 1]
- type: boolean
enum: [true, false]

View File

@@ -0,0 +1,9 @@
type: object
required:
- packetLength
description: "Packet length for the part."
properties:
packetLength:
type: integer
format: int32
example: 188

View File

@@ -0,0 +1,9 @@
type: object
required:
- size
description: "File size in bytes."
properties:
size:
description: "File size in bytes."
type: integer
example: 30649952104

View File

@@ -0,0 +1,7 @@
type: object
description: "Audio channel layout information."
properties:
audioChannelLayout:
type: string
description: "Audio channel layout."
example: "5.1(side)"

View File

@@ -0,0 +1,8 @@
type: object
description: "Bit depth information."
properties:
bitDepth:
type: integer
format: int32
description: "Bit depth of the video stream."
example: 10

View File

@@ -0,0 +1,8 @@
type: object
description: "Stream bitrate information."
properties:
bitrate:
type: integer
format: int32
description: "Bitrate of the stream."
example: 24743

View File

@@ -0,0 +1,6 @@
type: object
properties:
canAutoSync:
type: boolean
description: "Indicates if the stream can auto-sync."
example: false

View File

@@ -0,0 +1,8 @@
type: object
description: "Audio channels information."
properties:
channels:
type: integer
format: int32
description: "Number of audio channels (for audio streams)."
example: 6

View File

@@ -0,0 +1,7 @@
type: object
description: "Chroma location information."
properties:
chromaLocation:
type: string
description: "Chroma sample location."
example: "topleft"

View File

@@ -0,0 +1,7 @@
type: object
description: "Chroma subsampling information."
properties:
chromaSubsampling:
type: string
description: "Chroma subsampling format."
example: "4:2:0"

View File

@@ -0,0 +1,6 @@
type: object
description: "Closed captions information."
properties:
closedCaptions:
type: boolean
example: true

View File

@@ -0,0 +1,7 @@
type: object
description: "Codec information."
properties:
codec:
type: string
description: "Codec used by the stream."
example: "hevc"

View File

@@ -0,0 +1,8 @@
type: object
description: "Coded height information."
properties:
codedHeight:
type: integer
format: int32
description: "Coded video height."
example: 1608

View File

@@ -0,0 +1,8 @@
type: object
description: "Coded width information."
properties:
codedWidth:
type: integer
format: int32
description: "Coded video width."
example: 3840

View File

@@ -0,0 +1,7 @@
type: object
description: "Color primaries information."
properties:
colorPrimaries:
type: string
description: "Color primaries used."
example: "bt2020"

View File

@@ -0,0 +1,7 @@
type: object
description: "Color range information."
properties:
colorRange:
type: string
description: "Color range (e.g., tv)."
example: "tv"

View File

@@ -0,0 +1,7 @@
type: object
description: "Color space information."
properties:
colorSpace:
type: string
description: "Color space."
example: "bt2020nc"

View File

@@ -0,0 +1,7 @@
type: object
description: "Color transfer characteristics information."
properties:
colorTrc:
type: string
description: "Color transfer characteristics."
example: "smpte2084"

View File

@@ -0,0 +1,7 @@
type: object
description: "Default stream indicator."
properties:
default:
type: boolean
description: "Indicates if this stream is default."
example: true

View File

@@ -0,0 +1,7 @@
type: object
description: "Display title information."
properties:
displayTitle:
type: string
description: "Display title for the stream."
example: "4K DoVi/HDR10 (HEVC Main 10)"

View File

@@ -0,0 +1,8 @@
type: object
description: "Dolby Vision BL compatibility ID information."
properties:
DOVIBLCompatID:
type: integer
format: int32
description: "Dolby Vision BL compatibility ID."
example: 1

View File

@@ -0,0 +1,7 @@
type: object
description: "Dolby Vision BL presence information."
properties:
DOVIBLPresent:
type: boolean
description: "Indicates if Dolby Vision BL is present."
example: true

View File

@@ -0,0 +1,7 @@
type: object
description: "Dolby Vision EL presence information."
properties:
DOVIELPresent:
type: boolean
description: "Indicates if Dolby Vision EL is present."
example: false

View File

@@ -0,0 +1,8 @@
type: object
description: "Dolby Vision level information."
properties:
DOVILevel:
type: integer
format: int32
description: "Dolby Vision level."
example: 6

View File

@@ -0,0 +1,7 @@
type: object
description: "Dolby Vision presence information."
properties:
DOVIPresent:
type: boolean
description: "Indicates if Dolby Vision is present."
example: true

View File

@@ -0,0 +1,8 @@
type: object
description: "Dolby Vision profile information."
properties:
DOVIProfile:
type: integer
format: int32
description: "Dolby Vision profile."
example: 8

View File

@@ -0,0 +1,7 @@
type: object
description: "Dolby Vision RPU presence information."
properties:
DOVIRPUPresent:
type: boolean
description: "Indicates if Dolby Vision RPU is present."
example: true

View File

@@ -0,0 +1,7 @@
type: object
description: "Dolby Vision version information."
properties:
DOVIVersion:
type: string
description: "Dolby Vision version."
example: "1.0"

View File

@@ -0,0 +1,7 @@
type: object
description: "Dub information."
properties:
dub:
type: boolean
description: "Indicates if the stream is a dub."
example: true

View File

@@ -0,0 +1,6 @@
type: object
description: "Embedded in video information."
properties:
embeddedInVideo:
type: string
example: "progressive"

View File

@@ -0,0 +1,7 @@
type: object
description: "Extended display title information."
properties:
extendedDisplayTitle:
type: string
description: "Extended display title for the stream."
example: "4K DoVi/HDR10 (HEVC Main 10)"

View File

@@ -0,0 +1,6 @@
type: object
description: "Forced stream information."
properties:
forced:
type: boolean
example: true

View File

@@ -0,0 +1,7 @@
type: object
description: "Format of the stream."
properties:
format:
type: string
description: "Format of the stream (e.g., srt)."
example: "srt"

View File

@@ -0,0 +1,8 @@
type: object
description: "Frame rate information."
properties:
frameRate:
type: number
format: float
description: "Frame rate of the stream."
example: 23.976

View File

@@ -0,0 +1,6 @@
type: object
description: "Scaling matrix information."
properties:
hasScalingMatrix:
type: boolean
example: false

View File

@@ -0,0 +1,7 @@
type: object
description: "Header compression information."
properties:
headerCompression:
type: boolean
description: "Indicates whether header compression is enabled."
example: true

View File

@@ -0,0 +1,6 @@
type: object
properties:
hearingImpaired:
type: boolean
description: "Indicates if the stream is for the hearing impaired."
example: true

View File

@@ -0,0 +1,8 @@
type: object
description: "Stream height information."
properties:
height:
type: integer
format: int32
description: "Height of the video stream."
example: 1602

View File

@@ -0,0 +1,7 @@
type: object
description: "Unique stream identifier."
properties:
id:
type: integer
description: "Unique stream identifier."
example: 1002625

View File

@@ -0,0 +1,8 @@
type: object
description: "Stream index information."
properties:
index:
type: integer
format: int32
description: "Index of the stream."
example: 0

View File

@@ -0,0 +1,7 @@
type: object
description: "Stream key information."
properties:
key:
type: string
description: "Key to access this stream part."
example: "/library/streams/216389"

View File

@@ -0,0 +1,7 @@
type: object
description: "Stream language code information."
properties:
languageCode:
type: string
description: "ISO language code."
example: "eng"

View File

@@ -0,0 +1,7 @@
type: object
description: "Stream language tag information."
properties:
languageTag:
type: string
description: "Language tag (e.g., en)."
example: "en"

View File

@@ -0,0 +1,7 @@
type: object
description: "Stream language information."
properties:
language:
type: string
description: "Language of the stream."
example: "English"

View File

@@ -0,0 +1,8 @@
type: object
description: "Video level information."
properties:
level:
type: integer
format: int32
description: "Video level."
example: 150

View File

@@ -0,0 +1,7 @@
type: object
description: "Original stream information."
properties:
original:
type: boolean
description: "Indicates if this is the original stream."
example: true

View File

@@ -0,0 +1,7 @@
type: object
description: "Video profile information."
properties:
profile:
type: string
description: "Video profile."
example: "main 10"

View File

@@ -0,0 +1,8 @@
type: object
description: "Reference frames information."
properties:
refFrames:
type: integer
format: int32
description: "Number of reference frames."
example: 1

View File

@@ -0,0 +1,8 @@
type: object
description: "Sampling rate information."
properties:
samplingRate:
type: integer
format: int32
description: "Sampling rate for the audio stream."
example: 48000

View File

@@ -0,0 +1,6 @@
type: object
description: "Scan type information."
properties:
scanType:
type: string
example: "progressive"

View File

@@ -0,0 +1,7 @@
type: object
description: "Stream selection information."
properties:
selected:
type: boolean
description: "Indicates if this stream is selected (applicable for audio streams)."
example: true

View File

@@ -0,0 +1,21 @@
type: object
description: "Stream type definition."
properties:
streamType:
type: integer
oneOf:
- title: VIDEO
const: 1
description: Video stream
- title: AUDIO
const: 2
description: Audio stream
- title: SUBTITLE
const: 3
description: Subtitle stream
example: 1
description: |
Stream type:
- VIDEO = 1
- AUDIO = 2
- SUBTITLE = 3

View File

@@ -0,0 +1,6 @@
type: object
properties:
title:
type: string
description: "Optional title for the stream (e.g., language variant)."
example: "SDH"

View File

@@ -0,0 +1,8 @@
type: object
description: "Stream width information."
properties:
width:
type: integer
format: int32
description: "Width of the video stream."
example: 3840

View File

@@ -0,0 +1,6 @@
type: object
properties:
videoProfile:
type: string
description: "Video profile for the part."
example: "main 10"

View File

@@ -0,0 +1,9 @@
type: object
required:
- videoCodec
description: "Video codec used."
properties:
videoCodec:
type: string
description: "Video codec used."
example: "hevc"

View File

@@ -0,0 +1,10 @@
type: object
required:
- videoFrameRate
description: "Frame rate of the video."
properties:
videoFrameRate:
type: string
description: |
Frame rate of the video. Values found include NTSC, PAL, 24p
example: "24p"

View File

@@ -0,0 +1,9 @@
type: object
required:
- videoProfile
description: "Video profile (e.g., main 10)."
properties:
videoProfile:
type: string
description: "Video profile (e.g., main 10)."
example: "main 10"

View File

@@ -0,0 +1,9 @@
type: object
required:
- videoResolution
description: "Video resolution (e.g., 4k)."
properties:
videoResolution:
type: string
description: "Video resolution (e.g., 4k)."
example: "4k"

View File

@@ -0,0 +1,10 @@
type: object
required:
- width
description: "Video width in pixels."
properties:
width:
type: integer
format: int32
description: "Video width in pixels."
example: 3840

View File

@@ -198,8 +198,105 @@ get:
- type: object - type: object
properties: properties:
Media: Media:
allOf: type: array
- $ref: "../../../../models/Media-data.yaml" items:
allOf:
- $ref: "../../../../models/media/id.yaml"
- $ref: "../../../../models/media/duration.yaml"
- $ref: "../../../../models/media/bitrate.yaml"
- $ref: "../../../../models/media/width.yaml"
- $ref: "../../../../models/media/height.yaml"
- $ref: "../../../../models/media/aspect-ratio.yaml"
- $ref: "../../../../models/media/audio-channels.yaml"
- $ref: "../../../../models/media/display-offset.yaml"
- $ref: "../../../../models/media/audio-codec.yaml"
- $ref: "../../../../models/media/video-codec.yaml"
- $ref: "../../../../models/media/video-resolution.yaml"
- $ref: "../../../../models/media/container.yaml"
- $ref: "../../../../models/media/video-frame-rate.yaml"
- $ref: "../../../../models/media/video-profile.yaml"
- $ref: "../../../../models/media/has-voice-activity.yaml"
- $ref: "../../../../models/media/audio-profile.yaml"
- $ref: "../../../../models/media/optimized-for-streaming.yaml"
- $ref: "../../../../models/media/has-64bit-offsets.yaml"
- type: object
properties:
Part:
type: array
items:
allOf:
- $ref: "../../../../models/media/part/accessible.yaml"
- $ref: "../../../../models/media/part/exists.yaml"
- $ref: "../../../../models/media/part/id.yaml"
- $ref: "../../../../models/media/part/key.yaml"
- $ref: "../../../../models/media/part/indexes.yaml"
- $ref: "../../../../models/media/part/duration.yaml"
- $ref: "../../../../models/media/part/file.yaml"
- $ref: "../../../../models/media/part/size.yaml"
- $ref: "../../../../models/media/part/packet-length.yaml"
- $ref: "../../../../models/media/part/container.yaml"
- $ref: "../../../../models/media/part/video-profile.yaml"
- $ref: "../../../../models/media/part/audio-profile.yaml"
- $ref: "../../../../models/media/part/has-64bit-offsets.yaml"
- $ref: "../../../../models/media/part/optimized-for-streaming.yaml"
- $ref: "../../../../models/media/part/has-thumbnail.yaml"
- type: object
properties:
Stream:
type: array
items:
allOf:
- $ref: "../../../../models/media/part/stream/id.yaml"
- $ref: "../../../../models/media/part/stream/stream-type.yaml"
- $ref: "../../../../models/media/part/stream/format.yaml"
- $ref: "../../../../models/media/part/stream/default.yaml"
- $ref: "../../../../models/media/part/stream/codec.yaml"
- $ref: "../../../../models/media/part/stream/index.yaml"
- $ref: "../../../../models/media/part/stream/bitrate.yaml"
- $ref: "../../../../models/media/part/stream/language.yaml"
- $ref: "../../../../models/media/part/stream/language-tag.yaml"
- $ref: "../../../../models/media/part/stream/language-code.yaml"
- $ref: "../../../../models/media/part/stream/header-compression.yaml"
- $ref: "../../../../models/media/part/stream/dovi-bl-compat-id.yaml"
- $ref: "../../../../models/media/part/stream/dovi-bl-present.yaml"
- $ref: "../../../../models/media/part/stream/dovi-el-present.yaml"
- $ref: "../../../../models/media/part/stream/dovi-level.yaml"
- $ref: "../../../../models/media/part/stream/dovi-present.yaml"
- $ref: "../../../../models/media/part/stream/dovi-profile.yaml"
- $ref: "../../../../models/media/part/stream/dovi-rpu-present.yaml"
- $ref: "../../../../models/media/part/stream/dovi-version.yaml"
- $ref: "../../../../models/media/part/stream/bit-depth.yaml"
- $ref: "../../../../models/media/part/stream/chroma-location.yaml"
- $ref: "../../../../models/media/part/stream/chroma-subsampling.yaml"
- $ref: "../../../../models/media/part/stream/coded-height.yaml"
- $ref: "../../../../models/media/part/stream/coded-width.yaml"
- $ref: "../../../../models/media/part/stream/closed-captions.yaml"
- $ref: "../../../../models/media/part/stream/color-primaries.yaml"
- $ref: "../../../../models/media/part/stream/color-range.yaml"
- $ref: "../../../../models/media/part/stream/color-space.yaml"
- $ref: "../../../../models/media/part/stream/color-trc.yaml"
- $ref: "../../../../models/media/part/stream/frame-rate.yaml"
- $ref: "../../../../models/media/part/stream/key.yaml"
- $ref: "../../../../models/media/part/stream/height.yaml"
- $ref: "../../../../models/media/part/stream/level.yaml"
- $ref: "../../../../models/media/part/stream/original.yaml"
- $ref: "../../../../models/media/part/stream/has-scaling-matrix.yaml"
- $ref: "../../../../models/media/part/stream/profile.yaml"
- $ref: "../../../../models/media/part/stream/scan-type.yaml"
- $ref: "../../../../models/media/part/stream/embedded-in-video.yaml"
- $ref: "../../../../models/media/part/stream/ref-frames.yaml"
- $ref: "../../../../models/media/part/stream/width.yaml"
- $ref: "../../../../models/media/part/stream/display-title.yaml"
- $ref: "../../../../models/media/part/stream/extended-display-title.yaml"
- $ref: "../../../../models/media/part/stream/selected.yaml"
- $ref: "../../../../models/media/part/stream/forced.yaml"
- $ref: "../../../../models/media/part/stream/channels.yaml"
- $ref: "../../../../models/media/part/stream/audio-channel-layout.yaml"
- $ref: "../../../../models/media/part/stream/sampling-rate.yaml"
- $ref: "../../../../models/media/part/stream/can-auto-sync.yaml"
- $ref: "../../../../models/media/part/stream/hearing-impaired.yaml"
- $ref: "../../../../models/media/part/stream/dub.yaml"
- $ref: "../../../../models/media/part/stream/title.yaml"
Genre: Genre:
type: array type: array
items: items: