Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I implemented a C# application that recevies frame RGB at framerate of 30fps.

The event of frame arrive is managed with this code:

void client_ColorFrameReady(object sender, ColorFrameReadyEventArgs e)
        {
            mycounter++;
            Console.WriteLine("new frame received: " + mycounter);

            if (writer != null)
            {
                count++;
                if (count % 2== 0)
                {

                    using (var frame = BitmapImage2Bitmap(e.ColorFrame.BitmapImage))
                    using (var thumb = ResizeBitmap(frame, 320, 240))
                    {
                        writer.WriteVideoFrame(thumb);
                    }

                }
            }
            else
            {
                writer.Close();
            }
        }

with the if condition I manage only one out of two frames.

When my code call BitmapImage2Bitmap I obtain this exception:

enter image description here

The exception in english should be:

A first chance exception of type 'System.NotSupportedException' occurred in PresentationCore.dll
Additional information: BitmapMetadata is not available on BitmapImage.

The strange thing is that my application works "well" because the frames are correctly inserted in the output file.

I've read this, so the problem seems a bug in WPF framework.

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.