There is, I think, a minor bug in the DxPlay sample (in capture.cs).
In the function IPToBmp() you (re-)calculate the buffer size for the bitmap data through the formula:
int iBufSize = m_videoWidth * m_videoHeight * 3;
Now, AFAIK in Windows bitmaps each indiviual row is DWORD-aligned (i.e.the rows are padded, if necessary, so that the stride is always a multiple of 4).
So, in a 24bpp bitmap the stride equals (<width>3) only, if <width> is a multiple of 4. ( In general, it is: ((((<width></width></width><bpp>) + 31) & ~31) >> 3) )
Yet not all codecs require the frame width to be a multiple of 4. If it isn't, an access violation (due to the incorrect value for <scan0> parameter in the Bitmap constructor) occurs upon trying to save the bitmap. (You can verify this by cropping a video appropriately and saving it e.g. as Uncompressed RGB.)</scan0></bpp></width>
Why not simple use the stored value for the size of the bitmap data <m_imagesize> obtained in SaveSizeInfo()?</m_imagesize>
Regards
uli
(I would like to conclude - I should have started with this - by expressing my most heartfelt gratutude for all your efforts in this immensely valuable project!)
Yeah. Probably shouldn't use ToInt32 in the samples either. Don't know if there'll be another release though.