Add a video field to the identify

This commit is contained in:
Zoe Roux 2023-04-27 17:55:30 +09:00
parent 9a125e0359
commit 98f6fda99f
No known key found for this signature in database

View File

@ -1,16 +1,30 @@
use serde::Serialize;
use utoipa::ToSchema;
use crate::transcode::Quality;
#[derive(Serialize, ToSchema)]
pub struct MediaInfo {
/// The length of the media in seconds.
length: f32,
container: String,
video_codec: String,
video: VideoTrack,
audios: Vec<Track>,
subtitles: Vec<Track>,
fonts: Vec<String>,
chapters: Vec<Chapter>,
}
#[derive(Serialize, ToSchema)]
pub struct VideoTrack {
/// The codec of this stream.
codec: String,
/// The language of this stream (as a ISO-639-2 language code)
language: String,
/// The max quality of this video track.
quality: Quality,
}
#[derive(Serialize, ToSchema)]
pub struct Track {
/// The index of this track on the media.