y4m-d 0.2.0

File loader/emitter for Y4M, a convenient uncompressed video format.


To use this package, run the following command in your project's root directory:

What's this?

y4m-d is a tiny library to load/save Y4M video files. Y4M files are the simplest uncompressed video files that also contain meta-data (width, height, chroma subsampling, etc...) which makes a better solution than .yuv files.

Licenses

See UNLICENSE.txt

Usage


import y4md;

void main(string[] args)
{
    auto input = new Y4MReader("input-file.y4m");

    writefln("Input: %s %sx%s %sfps", inputFile, input.width, input.height,
             cast(double)(input.framerate.num) / (input.framerate.denom));

    ubyte[] frameBytes;
    while ( (frameBytes = input.readFrame()) !is null)
    {
        // Do something with frame data in frameBytes[]
    }


    // Output a 1920x1080p25 stream
    auto output = new Y4MWriter("output-file.y4m", 1920, 1080, Rational(25, 1)); 
    frameBytes = new ubyte[output.frameSize()];
    for (int i = 0; i < 100; ++i)
    {
        // write something in frameData...

        output.writeFrame(frameBytes[]);
    }
}

Authors:
  • ponce
Dependencies:
none
Versions:
1.0.1 2016-Jun-01
1.0.0 2016-May-31
0.3.0 2014-Aug-17
0.2.1 2014-Apr-27
0.2.0 2014-Apr-27
Show all 7 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 262 downloads total

Score:
0.2
Short URL:
y4m-d.dub.pm