Elecard
May 24, 2013, 07:30:30 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: MPEG Push Demux w/ custom PIDMap not working!!!  (Read 6435 times)
sliver97
Newbie
*
Posts: 9


View Profile
« on: May 14, 2008, 09:31:07 am »

Hello,
I am writing a program in VC++ (MFC) to decode UDP Multicast MPEG2TS. I can add and configure the NWSource-Plus filter without issue, and I have been able to add and configure the Push Demultiplexer as well. I then get the IMPEG2Demultiplexer interface, create a new pin, get the IMPEG2PIDMap of the pin and Map my PID (0x3e8) to the pin. This all works as evidenced by GraphEdit (through the ROT).
I then add the Elecard AVC decoder and add it to my newly created pin, that works fine, but I cannot render the output of the decoder???
Here is the media type for the pin I created (it is H.264 Video on PID 0x3e8):
AM_MEDIA_TYPE media_type;
ZeroMemory(&media_type, sizeof(AM_MEDIA_TYPE));
media_type.majortype = MEDIATYPE_Video;
media_type.subtype = MEDIASUBTYPE_AVC;

This is the output pin parameters (from graphedit) when I run the graph:
Major Type:  Video - Sub Type:  YUY2 - Format:  YUY2 0x0, 16 bits,
Aspect Ratio: 4x3,
Interlace format: Frames
rcSrc=(-842150451,-842150451,-842150451,-842150451)
rcDst=(-842150451,-842150451,-842150451,-842150451)
Major Type:  Video - Sub Type:  UYVY - Format:  UYVY 0x0, 16 bits,
Aspect Ratio: 4x3,
Interlace format: Frames
rcSrc=(-842150451,-842150451,-842150451,-842150451)
rcDst=(-842150451,-842150451,-842150451,-842150451)
Major Type:  Video - Sub Type:  RGB32 - Format:   RGB 0x0, 32 bits,
Aspect Ratio: 4x3,
Interlace format: Frames
rcSrc=(-842150451,-842150451,-842150451,-842150451)
rcDst=(-842150451,-842150451,-842150451,-842150451)
Major Type:  Video - Sub Type:  RGB24 - Format:   RGB 0x0, 24 bits,
Aspect Ratio: 4x3,
Interlace format: Frames
rcSrc=(-842150451,-842150451,-842150451,-842150451)
rcDst=(-842150451,-842150451,-842150451,-842150451)
Major Type:  Video - Sub Type:  RGB565 - Format:  BITF 0x0, 16 bits,
Aspect Ratio: 4x3,
Interlace format: Frames
rcSrc=(-842150451,-842150451,-842150451,-842150451)
rcDst=(-842150451,-842150451,-842150451,-842150451)
Major Type:  Video - Sub Type:  RGB555 - Format:  BITF 0x0, 16 bits,
Aspect Ratio: 4x3,
Interlace format: Frames
rcSrc=(-842150451,-842150451,-842150451,-842150451)
rcDst=(-842150451,-842150451,-842150451,-842150451)
Major Type:  Video - Sub Type:  YV12 - Format:  YV12 0x0, 12 bits,
Aspect Ratio: 4x3,
Interlace format: Frames
rcSrc=(-842150451,-842150451,-842150451,-842150451)
rcDst=(-842150451,-842150451,-842150451,-842150451)
Major Type:  Video - Sub Type:  YUY2 - Format:  YUY2 0x0, 16 bits
rcSrc=(-842150451,-842150451,-842150451,-842150451)
rcDst=(-842150451,-842150451,-842150451,-842150451)
Major Type:  Video - Sub Type:  UYVY - Format:  UYVY 0x0, 16 bits
rcSrc=(-842150451,-842150451,-842150451,-842150451)
rcDst=(-842150451,-842150451,-842150451,-842150451)
Major Type:  Video - Sub Type:  RGB32 - Format:   RGB 0x0, 32 bits
rcSrc=(-842150451,-842150451,-842150451,-842150451)
rcDst=(-842150451,-842150451,-842150451,-842150451)

Obviously something has gone seriously wrong...
What am I doing wrong?

Thanks-
Logged

Troy Wood
Radeus Labs
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
Rich Cook
IvanR
Moderator
*****
Posts: 131


View Profile
« Reply #1 on: June 08, 2008, 11:00:40 pm »

Hello,

The problem is caused by the fact, that you haven't filled the mediatype completely. In this case, decoder cannot work. We are going to add the feature of parsing data and  automatic work of decoder  with incomplete mediatype soon.
Logged
sliver97
Newbie
*
Posts: 9


View Profile
« Reply #2 on: June 09, 2008, 03:48:49 am »

Ivan,
I look forward to the auto parsing as it will make the job much easier especially when the source material being played back is not always known.
In the interim, I was able to get it working by creating the graph without the PID map and pausing it to let the automatic pin generate, then I copy the AM_MEDIA_TYPE from the pin to use when I create my custom PID map. This works just fine.
Logged

Troy Wood
Radeus Labs
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
Rich Cook
sebk
Newbie
*
Posts: 2


View Profile
« Reply #3 on: May 19, 2010, 10:02:31 pm »

Hello,

The problem is caused by the fact, that you haven't filled the mediatype completely. In this case, decoder cannot work. We are going to add the feature of parsing data and  automatic work of decoder  with incomplete mediatype soon.

Hello!

I'm also using the "manual mapping mode" with the Push-Demuxer. When I create output-pins and connect it with video/audio-decoders, only the video-decoder (so far only tested with the MPEG2-Decoder) is happy with only the majortype/subtype set.

The MPEG2-audio-decoder refuses connection unless the AM_MEDIA_TYPE is completely populated. Right now, I'm using the data I gathered from having the demuxer automatically create the output pins which has (in case of audio) the full AM_MEDIA_TYPE filled, including a WAVEFORMATEX-struct.

If I understood your statement from above, you had planned to add auto-detection of incomplete media-types. This would be very practical. Ideally, I'd only set major/subtype on the pins I'm creating and the decoder works out the rest. Has any work been done in this area? If yes, how can I take advantage of it?

Спасибо,
sebk
Logged
IvanR
Moderator
*****
Posts: 131


View Profile
« Reply #4 on: May 20, 2010, 10:32:26 pm »

Quote
If I understood your statement from above, you had planned to add auto-detection of incomplete media-types. This would be very practical. Ideally, I'd only set major/subtype on the pins I'm creating and the decoder works out the rest. Has any work been done in this area? If yes, how can I take advantage of it?

Hello!

This feature is already done in the latest version of Elecard MPEG Audio Decoder.
But this version isn't marked as a release yet.
You can write a request to our tech support and we'll send it to you.
Write an email to this address: tsup@elecard.ru

After official release it will be included in SDK.

Ivan
Logged
gil
Newbie
*
Posts: 6


View Profile
« Reply #5 on: June 08, 2010, 08:06:10 pm »

Hi,

I've encountered the same problem: When I create a new pin to the Push Demultiplexer I can't connect it to the Decoder, but when I don't create a new pin, run the graph and wait long enough an output pin is created automatically and everything works just fine.
The problem is that while it takes only one or two seconds for the GraphStudio to create the output pin, it takes between 30 and 180 seconds (approximately) for my program to create the same pin. It is important to emphasize that when my program finally manages to create the pin everything works just fine.

Is there something I can do to accelerate the pin creation?

my waiting loop looks something like this:



QzCComPtr<IMediaControl>   pMC;
QzCComPtr<IMediaEvent>      pME;
QzCComPtr<IBaseFilter>      pDemultiplexer;

.
.
.

pMC->Run();
long evCode=0;
pME->WaitForCompletion(INFINITE, &evCode);
   
int num;
do
{
   num = NumOfDemuxPins();

} while (num<2);


pMC->Stop();

.
.
.


int NumOfDemuxPins()
{
   QzCComPtr<IEnumPins> pEP;
   int counter=0;

   pDemultiplexer->EnumPins(&pEP);
   
   QzCComPtr<IPin> pPin;
   while (pEP->Next(1, &pPin, NULL)==S_OK)
   {
      counter++;
      pPin.Release();
   }

   return counter;
}
Logged
IrinaM
Moderator
*****
Posts: 139


View Profile
« Reply #6 on: June 09, 2010, 10:54:55 pm »

gil, use EMPGPDMX_INITIAL_PARSING_DONE. This parameter indicates the status of the stream detecting process. NWPlayer sample demonstrates how to use it.
It is important: add VideoRenderer filter to gtaph after Push Demultiplexer created output pins.

If it will not help you, please send an email to our Technical Support.
« Last Edit: June 09, 2010, 10:59:21 pm by IrinaM » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!