Skip to main content

Video File

Video File

Video File is an input node which will scan a file and load the Video Information (codecs/tracks etc) for processing in the flow.

Variables

VariableDescriptionTypeExample
vi.VideoInfoVideoInfo objectobjectSee Below
vi.WidthWidth of videonumber1920
vi.HeightHeight of videonumber1080
vi.DurationDuration of video in secondsnumber60
vi.Video.CodecCodec of videostringhevc
vi.Audio.CodecCodec of audiostringeac3
vi.Audio.ChannelsNumber of audio channels of first audio tracknumber5.1
vi.Audio.LanguageLanguage of audio of first audio trackstringen
vi.Audio.CodecsList of all audio of audio tracksstringeac3, ac3, aac, dts
vi.Audio.LanguagesList of all of audio track languagesstringen, deu, mao
vi.ResolutionComputed resolution of file (4K, 1080p, 720p, 480p, SD)string4K

class VideoInfo
{
    FileName: string;
    Bitrate: number;
    VideoStreams: VideoStream[];
    AudioStreams: AudioStream[];
    SubtitleStreams: SubtitleStream[];
    Chapters: Chapter[];
}

class VideoFileStream
{
    // overall index of this stream
    Index: number;
    // the index relative to the stream type
    TypeIndex: number;
    // the title of hte video
    Title: string;
    // the video bitrate
    Bitrate: number;
    // the codec used
    Codec: string;
    // if this stream is an image stream
    IsImage: boolean;
    // the formated index as a FFmpeg string
    IndexString: string;
    // the index of the input file
    InputFileIndex: number;
}

class VideoStream extends VideoFileStream
{
    // if this is HDR or not
    HDR: boolean;
    // if this is dolby vision or not
    DolbyVision: boolean;
    // the width in pixels
    Width: number;
    // the height in pixels
    Height: number;
    // the number of frames per second
    FramesPerSecond: number;
    // the duration of the video in seconds
    Duration: number;
    // the bits of the video if detected, 0 if undetected
    Bits: number;
}

class AudioStream extends VideoFileStream
{
    Language: string;
    Channels: number;
    Duration: number;
    SampleRate: number;
}

class SubtitleStream extends VideoFileStream
{
    Language: string;
    Forced: boolean;
}

class Chapter
{
    Title: string;
    Start: number;
    End: number;
}