Пример #1
0
        private IntPtr CreateCompressedStream(IntPtr stream)
        {
            Avi.AVICOMPRESSOPTIONS_CLASS options =
                new Avi.AVICOMPRESSOPTIONS_CLASS();
            options.fccType  = (uint)Avi.StreamtypeVIDEO;
            options.lpParms  = IntPtr.Zero;
            options.lpFormat = IntPtr.Zero;

            //display the compression options dialog
            Avi.AVISaveOptions(
                IntPtr.Zero,
                Avi.ICMF_CHOOSE_KEYFRAME | Avi.ICMF_CHOOSE_DATARATE,
                1, ref aviStream, ref options);
            options.dwQuality = 10000;
            //Avi.AVISaveOptionsFree(1, ref options);

            //get a compressed stream
            IntPtr compressedStream = IntPtr.Zero;

            Avi.AVICOMPRESSOPTIONS structOptions =
                options.ToStruct();
            int result = Avi.AVIMakeCompressedStream(
                out compressedStream,
                stream,
                ref structOptions, 0);


            return(compressedStream);
        }