private void encodeVP9()
        {
            Bitmap        currentFrame;
            FFMPEGEncoder ffmpegEncoder = new FFMPEGEncoder((int)videoFileReader.videoFileMetaData.targetFramerate, videoFileReader.videoFileMetaData.filePath + "\\" + CamConstants.ENCODED_FILE_NAME_WEBM, quality, videoFileReader.videoFileMetaData.frameCount, videoFileReader.videoFileMetaData.frameWidth, videoFileReader.videoFileMetaData.frameHeight, false);

            ffmpegEncoder.update += updateData;

            while (true)
            {
                currentFrame = videoFileReader.getNextFrame();

                if (currentFrame != null)
                {
                    //ffmpegEncoder.writeToFrameBuffer(currentFrame);
                    ffmpegEncoder.writeFrame(currentFrame);
                }
                else
                {
                    break;
                }
            }

            ffmpegEncoder.lastFrame = true;

            /*
             * while (!ffmpegEncoder.finished) {
             *  Thread.Sleep(100);
             * }*/
            ffmpegEncoder.finalize();
            updateData(1f, true, 0);
            Process.Start(filePath);
        }