Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, March 1, 2011 8:57:08 PM(UTC)

dreich  
dreich

Groups: Registered
Posts: 5


Hi,

I'm using IltmmConvert to decompress MPEG-4 frames into IYUV.

I'm setting it up this way:

    IltmmConvert *pConvert;
    IltmmSampleTarget *pTarget;
    IltmmMediaTypeDisp *pTargetMediaType;
    ...
    //CoCreateInstance( everything )
    ...
    pTargetMediaType->put_Type (ltmmMEDIATYPE_Video);
    pTargetMediaType->put_Subtype(ltmmMEDIASUBTYPE_IYUV);
    pTarget->SetAcceptedMediaType(pTargetMediaType);
    pConvert->put_TargetObject(pTarget);
    pConvert->put_TargetFormat(ltmmConvert_TargetFormat_Still_Image);
    pConvert->put_AllowedStreams(ltmmConvert_Stream_Video);

After I push a compressed frame into the source object (not shown above),
I should be able to get the uncompressed data this way:

    IltmmMediaSampleDisp* pMediaSample;
    VARIANT varBuffer;
    void* pBuffer;

    pTarget->GetSample (1000, &pMediaSample);
    pMediaSample->get_Buffer (&varBuffer);
    SafeArrayAccessData(V_ARRAY(&varBuffer), &pBuffer);

What structure does pBuffer contain?  What can I cast it into?

Thanks,
David



 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, March 2, 2011 5:37:55 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

David,
If the media subtype is not already IYUV, it must first be converted. One way for that to happen is that DirectShow will insert a processing filter similar to our LEAD color space converter.
You can check that by using the ltmmConvert.EditGraph() function, which lets you see the contents of the internal filter graph of the control.

In any case, if the needed filters are connected correctly, the format of a buffer that contains IYUV data is not directly explained in our documentation, but you can easily find it by searching the internet for "YUV pixel formats"

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Wednesday, March 2, 2011 12:34:24 PM(UTC)

dreich  
dreich

Groups: Registered
Posts: 5


Maen,

I don't need the pixel formats, or how to convert between them.

I need the layout of the frame ... something that shows where the Y, U, and V data is located and how it is arranged.

I would be very surprised if that information (or at least a link to it) was not available someplace within LEAD.

Thanks,
David

 
#4 Posted : Thursday, March 3, 2011 5:34:39 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

David,
The returned buffer will be a byte array that contains pixel data formatted according to the video subtype specification.
This means if the subtype is a planar YUV format, the buffer will contain the different Y, U and V planes arranged one after the other as detailed by that subtype's documentation.

The details of the common sub-types data configurations (planar or otherwise) are not available in our documentation. A typical programmer who's going to use our controls, codecs and DirectShow filters either together or with third-party codecs and filters, does not usually need this kind of information to successfully make these components work together.

A programmer who needs to work with YUV data himself is going a step beyond our toolkit, and I'm afraid that step is not documented by us. To do that, you will need additional references.

Please note that LEAD did not create the IYUV format, but if any of our components produces this format, our responsibility is limited to giving correctly-formatted video buffers. We are not required to explain the format to the user.

This is similar to any component that produces a file or video format. If that component works correctly, it does not necessarily document the internal details of the format.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.081 seconds.