diff --git a/transcoder/src/identify.rs b/transcoder/src/identify.rs index 958da9b7..199f0b20 100644 --- a/transcoder/src/identify.rs +++ b/transcoder/src/identify.rs @@ -2,7 +2,39 @@ use serde::Serialize; #[derive(Serialize)] pub struct MediaInfo { + container: String, + video_codec: String, + audios: Vec, + subtitles: Vec, + fonts: Vec, + chapters: Vec, +} +#[derive(Serialize)] +pub struct Track { + /// The index of this track on the media. + index: u32, + /// The title of the stream. + title: String, + /// The language of this stream (as a ISO-639-2 language code) + language: String, + /// The codec of this stream. + codec: String, + /// Is this stream the default one of it's type? + default: bool, + /// Is this stream tagged as forced? (useful only for subtitles) + forced: bool, +} + +#[derive(Serialize)] +pub struct Chapter { + /// The start time of the chapter (in second from the start of the episode). + start: f32, + /// The end time of the chapter (in second from the start of the episode). + end: f32, + /// The name of this chapter. This should be a human-readable name that could be presented to the user. + name: String + // TODO: add a type field for Opening, Credits... } pub fn identify(path: String) -> Result {