=head1 NAME

frames_to_mj2 - convert a yuv video file to a motion jpeg2000 encoded file


=head1 SYNOPSIS

B<mj2_to_frames> B<-i> I<input> B<-o> I<output> B<-W> I<width,height,CbCrSubsampling-dx,CbCrSubsampling-dy> B<-F> I<framerate> [-cinema2k] [-cinema4k] [-r I<ratios> | -q I<psnr>] [-n rI<escount>] [-b I<blocksize>] [-c I<precintsize>] [-t I<tilesize>] [-p I<progression>] [-s I<subsampling>] [-POC I<orders>] [-SOP] [-EPH] [-M I<modeflags>] [-x I<indexfile>] [-ROI:quantize] [-d I<imageoffset>] [-T I<tileoffset>] [-I]


=head1 DESCRIPTION

frames_to_mj2 encodes a video stream in yuv format to the motion jpeg 2000
format.

=head1 OPTIONS

=over

=item B<-i> I<input>

The input YUV encoded video file to process

=item B<-o> I<output>

Name of file to output encoded video in motion jpeg 2000 to

=item B<-W> I<width,height,CbCrSubsampling-dx,CbCrSubsampling-dy>

width, the output frame width
height, the output frame height
CbCrSubsampling_dx, sub sampling in x direction
CbCrSubsampling_dy, sub sampling in y direction

=item B<-cinema2k> I<fps>

Digital Cinema 2K profile compliant codestream for 2K resolution. 24 or 48 fps.

=item B<-cinema4k> [I<fps>]

Digital Cinema 4K profile compliant codestream for 4K resolution. fps default is 24

=item B<-r> I<ratios>

compression factor for successive layers, comma separated

=item B<-q> I<psnr>

psnr for successive layers, comma separated

=item B<-n> I<rescount>

number of resolutions

=item B<-b> I<blocksize>

width and height of code block, comma-separated

=item B<-c> I<precintsize>

width and height of precinct, comma-seperated

=item B<-t> I<tilesize>

width and height of tile, comma-separated

=item B<-p> I<progression>

progression order, one of LRCP, RLCP, RPCL, PCRL, CPRL

=item B<-s> I<subsampling>

subsampling factor in X and Y, comma-separated. Values larger than 2 can produce errors

=item B<-POC> I<orders>

progression order change

=item B<-SOP>

write SOP marker before each packet

=item B<-EPH>

write EPH marker after each header packet

=item B<-M> I<modeflags>

Sum of the values of the modes, as follows:

=over

=item 1. BYPASS (LAZY)

=item 2. RESET

=item 4. RESTART (TERMALL)

=item 8. VSC

=item 16. ERTERM (SEGTERM)

=item 32. SEGMARK (SEGSYM)

=back

=for
	TODO: a line bre3ak seems to be missing here. I don't know how to
	handle this one. Please let me know when you've found how to
	do it. :)
=cut

=item B<-x> I<indexfile>

create an index file

=item B<-ROI:>I<quantize>

quantization indices upshifted for component c between 0 and 2 inclusive with an upshift of U between 0 and 37 inclusive

=item B<-d> I<imageoffset>

X and Y offset of the origin of the image, comma-separated

=item B<-T> I<tileoffset>

X and Y offset of the origin of the tiles, comma-separated

=item B<-I>

use the irreversible DWT 9-7

=back


=head1 EXAMPLE

To encode a file with the standard YUV CIF frames of 352*288 format, at 30 frames per second :- 

frames_to_mj2 -i yuv_file.yuv -o mj2_file.mj2 -W 352,288,2,2 -F 30

=head1 AUTHOR

Written by Robin Cornelius <robin.cornelius@gmail.com> based on the output of mj2_to_frames as part of the Debian packaging of OpenJPEG


=head1 COPYRIGHT

Copyright 2009 Robin Cornelius <robin.cornelius@gmail.com>


=head1 SEE ALSO

L<mj2_to_frames(1)>, L<wrap_j2k_to_mj2(1)>, L<extract_j2k_from_mj2(1)>, L<image_to_j2k(1)>, L<http://www.openjpeg.org/index.php?menu=doc#MJ2>
