Video

Overview

A Draft.VideoEncoder is used to create videos and a Draft.VideoDecoder is used to extract frames from videos.

Implementation Details

Video Encoder

When creating a Draft.VideoEncoder you can specify many parameters including the video’s framerate, kbit rate and codec. For a complete list, please consult the constructor VideoEncoder(). Once your Draft.VideoEncoder is created, you can encode each frame using the method EncodeNextFrame().

Supported Codecs

Draft supports multiple codec options. They include:

  • MPEG4 (default)
  • MJPEG
  • DNxHD® (requires a “Draft Pro” license)
  • H264
  • RAWVIDEO

Valid Avid DNxHD® Settings

It’s important to remember that when you’re encoding with Avid DNxHD® you must use a specific set of parameters. Here is a table of all the Avid DNxHD® settings that work with Draft.

width height fps kbitRate
1920 1080 59.94 440000
1920 1080 59.94 290000
1920 1080 59.94 90000
1920 1080 50 365000 *
1920 1080 50 240000 *
1920 1080 50 75000 *
1920 1080 29.97 220000
1920 1080 29.97 145000
1920 1080 29.97 45000
1920 1080 25 185000 *
1920 1080 25 120000 *
1920 1080 25 36000 *
1920 1080 24 175000 *
1920 1080 24 115000 *
1920 1080 24 36000 *
1920 1080 23.976 175000
1920 1080 23.976 115000
1920 1080 23.976 36000
1280 720 59.94 220000
1280 720 59.94 145000
1280 720 50 180000
1280 720 50 120000
1280 720 29.97 110000
1280 720 29.97 75000
1280 720 25 90000
1280 720 25 60000
1280 720 23.976 90000
1280 720 23.976 60000

* Draft supports writing MXF files for these combinations only

Video Files Concatenation

It’s possible to concatenate video files using the function ConcatenateVideoFiles() by providing a list of input files and an output file. Note that the input files must all share the same codec and all have the same file extension than the output file.

Video Decoder

When creating a Draft.VideoDecoder you must specify the filename of the video you want to decode. Once your Draft.VideoDecoder is created, you can decode each frame using the method DecodeNextFrame().