View Single Post
Old 13th June 2005, 23:07   #12  |  Link
xtknight
Registered User
 
Join Date: May 2005
Posts: 33
Doom9:

OK I'm not sure about the AVI muxer...I got real close but I still can't get the damned thing to work.

Does MP4Box show progress? Is there some verbose option? I didn't see any progress bar when I was muxing a video but maybe I'm just blind.

So this d2v crop is for the preview window?

For the grayscale code:
I'm not sure if this would qualify as safe or unsafe, but I got it off of MSDN:

PHP Code:
...
// Get the address of the first line.
IntPtr ptr bmpData.Scan0;
...
// Copy the RGB values into the array.
System.Runtime.InteropServices.Marshal.Copy(ptrrgbValues0bytes);
...
// Copy the RGB values back to the bitmap
System.Runtime.InteropServices.Marshal.Copy(rgbValues0ptrbytes); 
That code is unsafe, correct, even though there are no * pointers, per se? Unfortunately, I think this is one weakness of safe code...it's just not fast enough. The ideal thing to do would be to use assembler, with optimizations up to SSE3, which I don't know but I imagine there's some grayscale code out there. (Though even without the optimizations it would still be a lot faster.) You'd do this by calling a COM DLL coded with inline assembly in C++. Just wondering...what's the advantage of using safe code over unsafe? The 'safe' code gets turned into assembly later, anyway...I mean as long as you have sufficient error-catching there's no need to rely on managed code IMO. You said you didn't mind if it was coded in C++, but essentially that's the same as the unsafe C# code you have there...so...unless there's a faster safe way of doing it you're stuck there...or if that code I posted above is infact "safened" by .NET...

Evidently I haven't dealt with this stuff too much...so that's why I was skeptical of whether I could do this or not. Guess I'll go do the other stuff. And just out of curiosity what is the grayscale function used for?

Last edited by xtknight; 14th June 2005 at 01:42.
xtknight is offline   Reply With Quote