?
Solved

DirectShow Editing Service timeline and MPEG-2

Posted on 2003-02-20
2
Medium Priority
?
1,036 Views
Last Modified: 2007-12-19
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
0
Comment
Question by:jldean1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

by:jldean1
ID: 8008909
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
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 8010387
PAQ'd and points refunded.

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question