Advertisement

04.21.2006 at 11:28AM PDT, ID: 21822679
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

5.6

Video for Windows: Compressed Image Capture

Asked by RageDBL in Miscellaneous Programming, Video Editing

Hello,

I'm working on a webcamera video stream processing program, and I'm having some trouble with the internals of actually just modifying the stream.
My main issue is that the only webcam I have uses a compressed IYUV format - which ends up being something like 12 bits per pixel.

Here is the code I was told to use to decompress that:

//the Frame Callback function set with capSetOnFrameCallback (or something like that)
LRESULT CALLBACK Edge_Processor(HWND hwnd, LPVIDEOHDR lpVHdr)
{
      if(!lpVHdr->lpData) //Note that "lpData" is the actual frame data - whether it's compressed or decompressed.
            return 0;
      
                BITMAPINFO frameinfo;
      capGetVideoFormat(hwnd, &frameinfo, sizeof(frameinfo));

//Find the appropriate decompressor for this frame... of course this doesn't need to be done every frame.
      if(!theApp.dlg->decompressor){  //declared as "HIC decompressor"
            ICINFO icinfo;
            
            //thank you CodeGuru Guy!

            //walk over all codecs, find desired
            for (int i=0; ICInfo(ICTYPE_VIDEO, i, &icinfo); i++)
            {
                  theApp.dlg->decompressor=ICLocate(icinfo.fccType, icinfo.fccHandler, &frameinfo.bmiHeader,
                  NULL, ICMODE_FASTDECOMPRESS);
      
                  if (theApp.dlg->decompressor) {
                                theApp.dlg->decomp_handler=icinfo.fccHandler; //declared as "DWORD decomp_handler".. this is a function pointer.
                                break;
                  }
            }      
      }

                //THIS RETURNS A VALID DIB HANDLE... however I have no idea how big it is.... but hopefully it decompressed it to 24-bit, in the dimensions of the camera.
      HANDLE dib_to_process=ICImageDecompress(theApp.dlg->decompressor, 0, &frameinfo, lpVHdr->lpData, NULL);


.... ok ... that's pretty much what I got as far as translating the stream goes.

However - I do not know how to edit that DIB. I've tried just modifying the input version outright (I have another capture device that supports RGB 24 (uncompressed)), that doesn't exactly work either.

Someone please help me with this. I need to access pixels in the video.

Also I would like a tip to make this a little faster. Going in and processing every pixel in the captured image proves to be slow - just because of the processing I'm doing. I noticed that in the VIDEOHDR struct, it has variables like "bytes used", and "seconds captured" - or something like that. I was hoping to find out how I can process a smaller portion of the video capture so that this function runs faster.

I know that's asking alot - but I'm going to offer a good point value for this. Please offer good explanations...Start Free Trial
[+][-]04.21.2006 at 11:57AM PDT, ID: 16510385

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Miscellaneous Programming, Video Editing
Sign Up Now!
Solution Provided By: mrblue
Participating Experts: 2
Solution Grade: B
 
 
[+][-]04.21.2006 at 12:02PM PDT, ID: 16510457

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.21.2006 at 12:14PM PDT, ID: 16510635

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.21.2006 at 12:39PM PDT, ID: 16510929

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.21.2006 at 02:40PM PDT, ID: 16512056

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.21.2006 at 04:45PM PDT, ID: 16512616

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.21.2006 at 10:10PM PDT, ID: 16513611

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.23.2006 at 11:09PM PDT, ID: 16522539

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.24.2006 at 06:02AM PDT, ID: 16524580

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.03.2006 at 12:48PM PDT, ID: 16599584

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.03.2006 at 10:45PM PDT, ID: 16602981

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.03.2006 at 11:41PM PDT, ID: 16603157

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.04.2006 at 10:57AM PDT, ID: 16608110

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.04.2006 at 02:54PM PDT, ID: 16610241

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.04.2006 at 10:38PM PDT, ID: 16612277

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.05.2006 at 01:15AM PDT, ID: 16612780

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.05.2006 at 10:13AM PDT, ID: 16616648

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32