Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion mpg4c32.dll codec
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Alessandro Angeli [MVP::DigitalMedia]  
View profile  
 More options Mar 4 2005, 4:35 pm
Newsgroups: microsoft.public.win32.programmer.mmedia
From: "Alessandro Angeli [MVP::DigitalMedia]" <nob...@nowhere.in.the.net>
Date: Fri, 4 Mar 2005 22:35:59 +0100
Local: Fri, Mar 4 2005 4:35 pm
Subject: Re: mpg4c32.dll codec

Robert Ferraro wrote:
> Maybe I don't know where to look, but I've had a problem
> finding something as fast/faster than mpg4c32 that's free
> to use and distribute to customers buying my application
> (I'm just not selling enough at this point to pay
> royalties for a codec).

> Can you suggest something specific that's comparable in
> quality and also royalty-free to distribute?

In my experience, DivX,  XviD and ffdshow/VfW are faster and
produce higher quality encodings. XviD and ffdshow are both
open source under the GNU GPL license, which lets you
redistribute them but has some restrictions. On the other
hand, IIRC, the mpg4c32.dll codec can not be redistributed
at all according to the accompanying EULA. With any
ISO-MPEG4 codec, you should also consider the terms of the
MPEG4 license and they may apply to the old MS-MPEG4 variant
as well, unless the codec vendor licensed the codec for you
(which is true for DivX, but not for XviD or ffdshow and I
don't think it's true for MP42 either, in case the license
applies to it).

http://www.mpegla.com/m4v/m4v-faq.cfm

> Chris mentioned that you were able to use mpg4c32.dll on
> multi-threaded applications by running each instance as a
> separate process.

> Can you give me an idea of how this is accomplished?

[CUT]

I don't know what post Chris was referring to, however I can
give you 2 suggestions:

1. (this may or may not work, it depends on whether the
codec's DLL uses shared resources or absolute memory
locations) for each instance of the codec you need, make a
temporary copy of the DLL with a different name then do
something like:

HDRVR hDriver
    = OpenDriver(L"codec_001",NULL,0L);
HMODULE hModule
    = GetDriverModuleHandle(hDriver);
DRIVERPROC fDiverProc
    = (DRIVERPROC)GetProcAddress(hModule,"DriverProc");
ICInstall(*(DWORD*)"VIDC",*(DWORD*)"MP42",
    (LPARAM)fDiverProc,NULL,ICINSTALL_FUNCTION);
HIC hCodec
    =
ICOpen(*(DWORD*)"VIDC",*(DWORD*)"MP42",ICMODE_COMPRESS);
...
ICClose(hCodec);
ICRemove(*(DWORD*)"VIDC",*(DWORD*)"MP42",0);
CloseDriver(hDriver,0,0);

or use ICOpenFunction() instead of ICInstall()+ICOpen() (in
which case, ICRemove() is not needed).

2. (this should always work unless the DLL uses global
shared resources) Create a simple exe that does a single
compression and run as many instances as you need with
CreateProcess(). If you are compressing files, put all the
required code in this exe and pass the necessary parameters
on the command line. If you are compressing streams, read
and write the data through a stream connection (stdio, pipe
or stream socket) or a message-based connection (datagram
socket): the server side of the connection should be opened
by the main application before running the helper exe and
the parameters required to open the client side can be
passed in the command line. In any case, the result/error
can be returned as the process' exit code. As a bonus, if
you use named pipes or sockets, you can even create a
distributed application (over a network, stream sockets are
better while locally datagram sockets are more efficent and
easier to use). Of course, whatever the IPC mechanism you
use, this is a lot slower than having multiple instances of
the codec in the same process.

--

// Alessandro Angeli
// MVP :: Digital Media
// a dot angeli at psynet dot net


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google