shtejv / ARDrone-Control-.NET

ARDrone Control library
http://www.parrotsonjava.com
92 stars 84 forks source link

Video Feed Not Changing, Video Not Saving #23

Open zarrro45 opened 13 years ago

zarrro45 commented 13 years ago

Hello, I just started working with your setup for the AR drone yesterday, downloading the newest version. The controls all work, and the video feed from the front camera shows up in the window. However, when I click the "change camera" button, nothing changes, and when I use the save video option, the file either shows up broken, or if I click "compress file" and then don't actually compress it, the file saves as a trippy, psychedelically purple version of the video. Also, if I leave the video capture program on for more than about 6 seconds, the program crashes. The snapshot program, however, seems to work fine. Any help would be appreciated, thank you.

zarrro45 commented 13 years ago

By the way, here is the exception and the line at which it occurs:

    public void AddFrame(Bitmap image)
    {
        if (stream != null)
        {
            stream.AddFrame(image); // The error is here, Line 108 in VideoRecorder.cs
        }
    }

Access Violation Unhandled: Attempted to read or write protected Memory. This often is an indication that other memory is corrupt.

Thanks again

gallouglas commented 13 years ago

Good Times :-)

The file "ARDroneControlLibrary \ Utils \ VideoUtils.cs" lines 329 and 338 of the rules I have to this form: internalImageSource = new WriteableBitmap (width, height, 96, 96, PixelFormats.Bgr565, null); The file "ARDroneControlLibrary \ Utils \ BitmapUtils.cs" function "public System.Drawing.Bitmap BitmapSourceToBitmap (BitmapSource imageSource)" was changed to a form: " System.Drawing.Bitmap bitmap; using (MemoryStream outStream = new MemoryStream ()) { / / From System.Media.BitmapImage to System.Drawing.Bitmap BitmapEncoder enc = new BmpBitmapEncoder (); enc.Frames.Add (BitmapFrame.Create (bitmapsource)); enc.Save (outStream); bitmap = new System.Drawing.Bitmap (outStream); } return bitmap; "

in the file "ARDroneUI_WPF_full \ MainWindow.xaml.cs" line 652 still looks like this: videoRecorder.StartVideo (videoFilePath, averageFrameRate, size.Width, size.Height, System.Drawing.Imaging.PixelFormat.Format16bppRgb565, 2, false);

Regards, Victor.

shtejv commented 13 years ago

Yeah, one of the things I forgot to test was the image and video recording which is still unchanged since version 1.0.3. This will be fixed in the next version.

The camera change is probably due to your firmware version. In the options, try out another firmware version. This should help.

njoi commented 12 years ago

When will this be updated, do you think?

I swapped over to Ander's version of this SDK and it also does not record video correctly and I was wondering if this will be implemented any time soon.

shtejv commented 12 years ago

There is currently no deadline for this topic - and I don't really know when. Currently, I'm still totally out of time.

shtejv commented 12 years ago

Try the new version. Video output should work fine now.