Git Product home page Git Product logo

vt-transcode-worker's Introduction

vt-transcode-worker

A video transcoder service, which prepares the video for streaming using HLS.
Transcode worker will transcode the videos into multiple renditions using ffmpeg, creates the HLS manifest and uploads it to S3 or any other object store.

Request message format

export interface TranscodeWorkerInput {
  requestId: string;
  inputFile: RemoteFile;
  transcodeConfig: TranscodeConfig;
}

RemoteFile

Details of the input video stored in a remote location

export interface RemoteFile {
  requestId: string;
  contentLength?: number;
  contentSha1?: string;
  contentType?: string;
  fileId: string;
  fileName: string;
  uploadTimestamp?: number;
}

TranscodeConfig

The configuration for ffmpeg for transcoding the asset.

export interface TranscodeConfig {
  renditions: Rendition[];
  /**
   * Presets affect the encoding speed.
   * Using a slower preset gives you better compression, or quality per filesize,
   * whereas faster presets give you worse compression
   * @default 'veryfast'
   */
  preset: FFmpegPreset | string;
  /**
   *@default 'libx264'
   */
  videoCodec: string;
  /**
   * @default 'aac'
   */
  audioCodec: string;
  /**
   * Segment size in seconds
   * @default 6
   */
  segmentDuration: number;
}

export enum FFmpegPreset {
  UltraFast = "ultrafast",
  SuperFast = "superfast",
  VeryFast = "veryfast",
  Faster = "faster",
  Fast = "fast",
  Medium = "medium",
  Slow = "slow",
  Slower = "slower",
  verySlow = "veryslow",
}

export interface Rendition {
  resolution: {
    width: number;
    height: number;
  };
  videoBitRate: number;
  audioBitRate: number;
}

vt-transcode-worker's People

Contributors

rohithb avatar

Watchers

Gadheyan Sivakaran avatar

vt-transcode-worker's Issues

Implement Split-transcode-merge

In order to improve the performance of transcoding, try splitting the input video into chunks, distribute the video to multiple nodes for transcoding, gather all the chunks and combine to create the final video.

Try better codec to improve streaming quality

Currently, video tom uses h.264 codec. Which is hugely popular and widely supported.
But to cope with the lower performance of cloudflare and backblaze B2, a better codec is required.
H.265 (or HEVC) is a potential alternative, it provides same video quality at half the bitrate. But, HEVC is not widely adopted due to heavy license fees. Very less support for hardware-accelerated encoding/decoding.
AV1 and VP9 are 2 different alternatives. VP9 is a promising codec, and its already being used by Youtube, Netflix and may others.
Need to check about VP9 support for HLS. I don't want to go in the HEVC path, so if required we can switch to Mpeg-Dash from HLS.

Todo:

  • Try encoding a stream using VP9
  • Support of VP9 on various devices.
  • Check the same for AV1
  • Does any of these codecs is supported by HLS?

The main concern is how well these codecs are supported so that we can assure our video plays everwhere.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.