Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Controlling the MPEG2 CODEC from the Multimedia SDK?
Started by shawn@imagewks.com at 05-03-2005 15:08. Topic has 3 replies.

Print Search « Previous Thread Next Thread »
  05-03-2005, 15:08
shawn@imagewks.com is not online. Last active: 12/23/2005 9:38:40 AM shawn@imagewks.com

Not Ranked
Joined on 03-28-2005
Maine, USA
Posts 4
Controlling the MPEG2 CODEC from the Multimedia SDK?
Reply Quote

Can anyone provide me with some information on how to set the MPEG settings on the LEAD MPEG2 CODEC when used with the Multimedia SDK?

Specifically, I have a component that will automatically (through calls from a Windows Service) convert videos from raw uncompressed AVI to 320x240 mpeg1 for display on a website.  I can get the Encoding to happen in MPEG2, but I can't find any information on how to set the codec to encode in mpeg1.  I suspect that I need to define a custom TargetFormat and add it to the TargetFormats collection, but there isn't any information in either the SDK Docs or the CODEC docs on what to set the various properties to to enable the mpeg1 compression.

Finally, a small note: I had all of this working perfectly with the trial version of the SDK (it had the MPEG1System TargetFormat pre-defined), but when I upgraded to the licensed version the pre-defined TargetFormat didn't exist and the docs don't provide enough info to create a new one.


Thank you,
Shawn Smiley


   Report 
  08-02-2005, 10:22
Silviu is not online. Last active: 2/22/2007 4:22:40 PM Silviu

Top 100 Posts
Joined on 04-29-2005
Posts 22
Re: Controlling the MPEG2 CODEC from the Multimedia SDK?
Reply Quote

MPEG1System TargetFormat should be all you need. This format should be defined if you installed the latest setup. Please download the latest binaries and try again. If you still do not have the MPEG1System TargetFormat, please contact TechSupport and tell them where you downloaded this outdated setup.

 

If you set the MPEG1System Target format, the toolkit will automatically select the MPEG-2 Encoder and set it to generate MPEG-1 video.

 

If you want to insert MPEG-1 data in other formats (AVI, Ogg, etc), or you want something other than MPEG-1 (like VCD), then you need to use the MPEG2 encoder interface. This interface exposes all the settings you need including the TYPE (MPEG1, MPEG2, VCD, DVD, etc.).

Here is how you can get the encoder interface and change some settings:

 

First choose the target format: What target format you want to use for your compressed stream? MPEG1 can fit into AVI, OGG, MPEG1 System, etc.

 

Second, select the encoder; the MPEG2 encoder (compressor).

Then get the compressor interface and change the settings:

 

    ILMMPEG2Encoder* pIMPEG2Encoder;

    IUnknown *pMPEG2Encoder;

 

    pConvert->GetSubObject(ltmmConvert_Object_VideoCompressor, &pMPEG2Encoder);

    pMPEG2Encoder->QueryInterface(IID_ILMMPEG2Encoder, (void**)&pIMPEG2Encoder);

    pMPEG2Encoder->Release();

 

    // change settings:

    pIMPEG2Encoder->put_MpegVideoType(MPEG2Type_MPEG1);

 

    // ...

 

    // done

    pIMPEG2Encoder->Release();

 


   Report 
  10-23-2008, 10:13
sdecorme is not online. Last active: 10/23/2008 3:11:20 PM sdecorme

Top 75 Posts
Joined on 07-22-2008
FRANCE
Posts 30
Re: Controlling the MPEG2 CODEC from the Multimedia SDK?
Reply Quote
In the same way how can I change framerate for example in c#
I've add the good reference LMMPEG2EncoderLib
But I don't know how to modify parameters without opening the property form of the codec
Thanks

   Report 
  10-23-2008, 14:04
Walter is not online. Last active: 12/29/2008 9:00:18 AM Walter



Top 25 Posts
Joined on 04-14-2008
Charlotte, NC
Posts 125
Re: Controlling the MPEG2 CODEC from the Multimedia SDK?
Reply Quote
In order to change the frame rate on the codec, you'll need an interface to the codec. You can get a handle on the codec using the GetSubObject method for the control you're using. We do have an example that uses this method. Please check the 'DVDAuthor' example project. You can then set the frame rate through the FrameRate property on the interface.

If you're still having trouble with this, please post a small sample project (not your entire application) so that I can continue to assist you with this. Here are some guidelines for posting on the forums:

1.) Zip the file(s) up.
2.) Make sure it is less than 5 MB.
3.) Remove ANY AND ALL unlock codes and LEADTOOLS DLLs.
4.) Do not click the preview button, the attachment will not show up when you post it.
Walter
Technical Support
LEADTOOLS
support@leadtools.com
   Report 
Post
LEAD Support Fo... » Developer » Multimedia » Controlling the MPEG2 CODEC from the Multimedia SDK?

Powered by Community Server, by Telligent Systems