Link to home
Start Free TrialLog in
Avatar of jldean1
jldean1

asked on

DirectShow Editing Service timeline and MPEG-2

Can a DirectShow Editing Services timeline be built using MPEG-2s?  I've been trying for a while now without success.  Any ideas or, better yet, sample code?  None of the DirectX SDK samples use MPEG-2 files.  Only Avi and MPEG-1s.  (Also, by using GraphEdit, I know that the MPEG-2 Splitter filter is the one used by default if I call RenderFile).

I'm developing for a Win2k system and, yes, I have MPEG-2 decoders loaded.  Playing single MPEG-2s are no problem using DirectShow.  But I need to play several consecutive files and be able to seek through them as if they were joined.  DES seems the best bet to do that without joining the MPEGs ahead of time.  Any help is GREATLY appreciated!

Thanks,
James
Avatar of jldean1
jldean1

ASKER

I finally discovered the answer to my own question...

You can NOT use MPEG-2s with DES timelines as far as I can tell.  The IAMTimelineGroup::SetMediaType will only work properly if the AM_MEDIA_TYPE fed in derives from a VIDEOINFOHEADER structure.  MPEG-2s derive from VIDEOINFOHEADER2 so don't work.  SetMediaType will happily accept your AM_MEDIA_TYPE, but things get hosed later in the IMediaControl::Run method call.  I kept getting a VFW_E_SIZENOTSET (Cannot allocate memory because no size has been set) and couldn't figure out why.  Especially since Run() is only supposed to return an S_FALSE or S_OK.  I found that the problem is the extra header info in the VIDEOINFOHEADER2 stuff throws the memory allocation off and makes things go boom.  If anyone can prove me wrong, PLEASE do so. hehe

So...  If you're trying to use DES timelines with MPEG-2 files, just stop.  Stop now and back away from the machine and no one will get hurt.

Cheers,
James
ASKER CERTIFIED SOLUTION
Avatar of SpideyMod
SpideyMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial