?
Solved

Viewing MPEG-1 stream (not from file)

Posted on 2003-03-06
5
Medium Priority
?
308 Views
Last Modified: 2013-12-03
Hello experts,

I want to write an application that accepts MPEG-1 video buffers from a video card and displays them on the screen.

The video card is not a standard capture device. It supplies buffers that contain MPEG-1 data. The buffers boundaries do not comply to the MPEG-1 standard (MPEG packets are cut between buffers).

I use DirectShow to write the application.
I started to write a source filter (derived from CSource & uses CSourceStream) that accepts the buffers from the card and passes them on to the 'MPEG-1 Stream splitter'. I failed to connect my filter to the 'Stream Splitter' (probably some of my media type information was incorrect).

Is the 'MPEG-1 Stream splitter' provided with DirectShow capable of accepting real-time video stream?
Is my approach for displaying live video correct?
If so, can I get help as to how to write the filter?
0
Comment
Question by:yossikally
[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
5 Comments
 

Expert Comment

by:elpalmer
ID: 8106040

The software you are trying to write will look like a Video Capture filter connected to an MPEG decoder filter.  There are two approaches - (A) connect to the standard MPEG splitter and decoder, or (B) write a custom decoder and connect directly to it.  

For A, you have to make the media types match.  Chances are that your capture device does not deliver data that exactly matches the MPEG-1 format, so you may have to fill in the holes.  If you have video only, you need Stream/MPEG1Video.  If you have audio and video, you need Stream/MPEG1System.

For B, you could allow connection to any media type (assume it's always correct) and decode your custom data format directly.  For a sample video decoder, see the code at http://cedar.intel.com/cgi-bin/ids.dll/content/content.jsp?cntKey=Generic+Editorial%3a%3aht_videoEncode&cntType=IDS_EDITORIAL&catCode=CUY.

When you connect your source filter, you may need to push some dummy data out to the output pin if you haven't already loaded the MPEG header data from your capture card.  The connection algorithm looks for a specific pattern of bytes in the source stream, so you have to fill it in according to the MPEG-1 spec.

Hope that helps,

 - ep
0
 

Author Comment

by:yossikally
ID: 8109354
Hi,

Thanks for your comment.

I think solution 'A' will be good for me (less work). I looked at the ASyncReader example in MSDN. This example loads a file to memory and and supplies chuncks of the file to the filters/renderer.
Do you think I can implement a source filter in the same way? My capture device (which is a device driver for a specific video compression card) produces MPEG-1 buffers. I will send these buffers to the MPEG-1 splitter the same way the chunks of files are sent in the ASyncReader example. One thing I'm still not sure is how do I control the rate in this case? Do I pass each buffer as soon as the renderer/splitter asks for it?
 
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 10788530
PAQed, with points refunded (200)

Computer101
E-E Admin
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

777 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