コード例 #1
0
        /// <summary>
        /// ビデオライタを作成する.
        /// </summary>
        /// <param name="fileName">出力するビデオファイルの名前</param>
        /// <param name="fourcc">
        /// フレームを圧縮するためのコーデックを表す 4 文字.例えば,"PIM1" は,MPEG-1 コーデック, "MJPG" は,motion-jpeg コーデックである.
        /// Win32 環境下では,null を渡すとダイアログから圧縮方法と圧縮のパラメータを選択できるようになる.
        /// </param>
        /// <param name="fps">作成されたビデオストリームのフレームレート</param>
        /// <param name="frameSize">ビデオフレームのサイズ</param>
        /// <param name="isColor">trueの場合,エンコーダはカラーフレームとしてエンコードする. falseの場合,グレースケールフレームとして動作する(現在のところ,このフラグは Windows でのみ利用できる).</param>
        /// <returns>CvVideoWriter</returns>
#else
        /// <summary>
        /// Creates video writer structure.
        /// </summary>
        /// <param name="fileName">Name of the output video file. </param>
        /// <param name="fourcc">4-character code of codec used to compress the frames. For example, "PIM1" is MPEG-1 codec, "MJPG" is motion-jpeg codec etc.
        /// Under Win32 it is possible to pass null in order to choose compression method and additional compression parameters from dialog. </param>
        /// <param name="fps">Frame rate of the created video stream. </param>
        /// <param name="frameSize">Size of video frames. </param>
        /// <param name="isColor">If it is true, the encoder will expect and encode color frames, otherwise it will work with grayscale frames (the flag is currently supported on Windows only). </param>
#endif
        public VideoWriter(string fileName, string fourcc, double fps, Size frameSize, bool isColor = true)
            : this(fileName, FourCCCalculator.Run(fourcc), fps, frameSize, isColor)
        {
        }
コード例 #2
0
        /// <summary>
        /// ビデオライタを開く
        /// </summary>
        /// <param name="fileName">出力するビデオファイルの名前</param>
        /// <param name="fourcc">
        /// フレームを圧縮するためのコーデックを表す 4 文字.例えば,"PIM1" は,MPEG-1 コーデック, "MJPG" は,motion-jpeg コーデックである.
        /// Win32 環境下では,null を渡すとダイアログから圧縮方法と圧縮のパラメータを選択できるようになる.
        /// </param>
        /// <param name="fps">作成されたビデオストリームのフレームレート</param>
        /// <param name="frameSize">ビデオフレームのサイズ</param>
        /// <param name="isColor">trueの場合,エンコーダはカラーフレームとしてエンコードする. falseの場合,グレースケールフレームとして動作する(現在のところ,このフラグは Windows でのみ利用できる).</param>
        /// <returns>CvVideoWriter</returns>
#else
        /// <summary>
        /// Creates video writer structure.
        /// </summary>
        /// <param name="fileName">Name of the output video file. </param>
        /// <param name="fourcc">4-character code of codec used to compress the frames. For example, "PIM1" is MPEG-1 codec, "MJPG" is motion-jpeg codec etc.
        /// Under Win32 it is possible to pass null in order to choose compression method and additional compression parameters from dialog. </param>
        /// <param name="fps">Frame rate of the created video stream. </param>
        /// <param name="frameSize">Size of video frames. </param>
        /// <param name="isColor">If it is true, the encoder will expect and encode color frames, otherwise it will work with grayscale frames (the flag is currently supported on Windows only). </param>
        /// <returns></returns>
#endif
        public void Open(string fileName, string fourcc, double fps, Size frameSize, bool isColor = true)
        {
            Open(fileName, FourCCCalculator.Run(fourcc), fps, frameSize, isColor);
        }