Video-Frames

Video::Frames takes frames of pixels one at a time and writes them as a
video that browsers, phones and video players open: H.264 in an MP4 file.
It reads such a video back a frame at a time, and it plays frames in a
terminal.

    use Video::Frames qw(writer reader player);

    my $video = writer('loop.mp4', width => 1080, height => 1080,
                       frames => 300, rate => 30);
    $video->frame($rgba) for 1 .. 300;
    my $about = $video->end;

    my $back  = reader('loop.mp4');
    my $first = $back->frame(0);

A frame is a string of bytes: four for each pixel, red, green, blue and one
more that is not read, a row at a time from the top.

Each frame is coded and written as it is handed over, so a video of an hour
needs no more memory than a video of a second. The index of the file is at
its front, so it begins to play before a download of it has finished. The
same frames and the same settings give the same file, byte for byte, on
every machine and on every day.

Another extension can write, read and play video through one installed
header, vidfrm_abi.h, with no Perl call between.

INSTALLATION

To install this module, run the following commands:

	perl Makefile.PL
	make
	make test
	make install

It needs Ex::Op to run, and ExtUtils::Configure to configure and to test.

SUPPORT AND DOCUMENTATION

After installing, you can find documentation for this module with the
perldoc command.

    perldoc Video::Frames

You can also look for information at:

    RT, CPAN's request tracker (report bugs here)
        https://rt.cpan.org/NoAuth/Bugs.html?Dist=Video-Frames

    Search CPAN
        https://metacpan.org/release/Video-Frames


LICENSE AND COPYRIGHT

This software is Copyright (c) 2026 by LNATION <email@lnation.org>.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)

