Logo

Quickstart – Standard MPEG Encoder

Welcome to the Quickstart guide for the Standard MPEG Encoder

If you need personal help, the first thing you should do is add mark@standardmpeg.com to your google talk client.

To get started using the Mpeg Encoder, you will need to decide if you are going to be using the DirectShow Mpeg Encoder filter or the DirectAccess Dll. See our documentation page on the difference between the two modes.

There are several samples to help you get started with using the encoder in C++ as well as C#. The samples demonstrate the use of the encoder in both C++ as well as C#. The best sample to use as an introduction to the encoder is the ConsoleEncode sample. Start it by clicking on the 'Start' button, selecting 'Standard Mpeg Encoder', the submenu 'Samples' and then click on 'ConsoleEncode Sample'.

Using the encoder with DirectShow

If you wish to use the encoder with DirectShow, you can do so in a very straightforward manner. After installing the encoder, you will have a new filter in your DirectShow filter list called 'Standard Mpeg Encoder v6'. You can test using this filter in graphedit.

To add the encoder to your application, you should take the following steps:

Add the following line:
#pragma warning(disable : 4192)
#import “DirectEncode.tlb” no_namespace, raw_interfaces_only exclude(“UINT_PTR”)

This will import all the interfaces exposed by the filter.

Include the following file:

#include ”..\StandardMPEGEncoderUIDs.h”

This will make the UUID of the encoder available to your application.

Create the filter using this line:

HRESULT hr = CoCreateInstance(CLSID_StandardMpegEncoder, NULL,
CLSCTX_INPROC_SERVER,
IID_IBaseFilter,
(void **)&m_pMPEGWriter);

Query the interfaces from the filter directly:

hr = m_pMPEGWriter->QueryInterface(__uuidof(IStandardMpegEncoder), (void**)&m_pIMPEGEncoder);
ASSERT(m_pIMPEGEncoder);

Select a format to preload a profile:

m_pIMPEGEncoder->SelectFormat(m_systemsFormat, m_constraint);
m_pIMPEGEncoder->GetSelectedProfile(&m_pIMPEGEncoderProfile);

Customize the profile:

m_pIMPEGEncoderProfile->SetFramerate(15);

Using the encoder with the DirectAccess Dll

The DirectAccess dll erdmpg-6.dll does not require any Framework. It's a dll that allows you pass Bitmap Buffers (RGB24) as well as Audio samples to be encoded into a valid Mpeg File. The best way to get started with this is by taking a look at the two samples: C++ Direct Dll Access as well as C# Direct Dll Access. Additionally, take a look at the C# Mpeg Encoder dll tutorial.