AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

VideoCaptureDevice crashes application in portrait mode

Forum to discuss AForge.NET Framework, its features, API, how-tos, etc.

VideoCaptureDevice crashes application in portrait mode

Postby AndrewR » Fri Feb 19, 2016 12:16 pm

I am building a WPF application using AForge library to capture video from webcam, and I am using the monitor in a portrait mode. Application crashes after videoSource.Start(); but before entering video_NewFrame handler. When I turn my monitor in landscape mode, everything works fine. Looks like it's a library bug, but is it any way to bypass this bug? And how VideoCaptureDevice functionality is even related to monitor orientation?

Code: Select all
void UserControl_Loaded(object sender, RoutedEventArgs e)
{
    var videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
    if (videoDevices.Count != 0)
    {
        videoSource = new VideoCaptureDevice(videoDevices[0].MonikerString);
        videoSource.NewFrame += new NewFrameEventHandler(video_NewFrame);
        videoSource.Start();
    }
}
AndrewR
 
Posts: 3
Joined: Fri Feb 19, 2016 11:53 am

Re: VideoCaptureDevice crashes application in portrait mode

Postby andrew.kirillov » Sat Feb 20, 2016 3:52 pm

I would suggest debugging it and find the line of code causing the crash.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3453
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: VideoCaptureDevice crashes application in portrait mode

Postby AndrewR » Tue Mar 01, 2016 1:48 pm

Traced the error to quartz.dll. Looks like it's a DirectShow error.
AndrewR
 
Posts: 3
Joined: Fri Feb 19, 2016 11:53 am

Re: VideoCaptureDevice crashes application in portrait mode

Postby nmasry » Mon Feb 27, 2017 9:55 pm

Can i know please how to change camera orientation to portrait ?
nmasry
 
Posts: 3
Joined: Mon Feb 27, 2017 9:53 pm




Return to AForge.NET Framework

cron