Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

howto: set Compress parameter with Microsoft MPEG-4 Video Codec V2 ?

83 views
Skip to first unread message

Frank Telbert

unread,
Aug 15, 2002, 11:22:01 AM8/15/02
to
hello experts, i need your help again...

i write a small video-file recompress program with directshow
("DV"->"Microsoft MPEG-4 Video Codec V2")

howto can i set the Compress parameters of the codec "Microsoft MPEG-4
Video Codec V2" ?

i try already long time to get a paremeter/property dialog of that codec ,
but no success( IAMVfwCaptureDialogs, ISpecifyPropertyPages)

in other programs (iE "DVD2AVI.exe") there comes a setup/config dialog of
this codec. but i dont know how they make it (maybe VFW stuff).

when the codec compresses my PAL video file 768x576 25 fps i get a result
video bitrate of only 143KBit. the quality is not good of course. how can i
tell the codec to use a higher bitrate?

i try-ed with
IAMVideoCompression, IAMStreamConfig

please give a sample code or explanation

my config: VC++,DX8.1,WinXP

Frank


Alessandro Angeli

unread,
Aug 15, 2002, 1:34:40 PM8/15/02
to
The dialog you are referring to is shown by the VfW codec itself when asked
to by the right ICM message. You can do the same in DS using
IAMVfwCompressDialogs::ShowDialog(), implemented by the AVICompressor. You
should be able to configure the codec programmatically using
IAMVfwCompressDialogs::SetState() (to get the state buffer, show the dialog,
config it then GetState() and save the buffer for later).

"Frank Telbert" <fran...@gmx.de> wrote in message
news:#cdX2UHRCHA.1756@tkmsftngp11...

Frank Telbert

unread,
Aug 16, 2002, 6:46:52 AM8/16/02
to
i try this just before. but no success. the codec is MS-MPEG4 V2.
i get the IAMVfwCompressDialogs and can also show the dialog. i see that the
codec has always the same default vals and if i change some values the
compressed file is also different (i got 266KBit now). that is OK.
but when i want to setup the codec parameters by my program it does not
work.
i call getstate() just after ShowDialog() save the buffer to a file (512
Bytes) and later restart the prog and load the buffer and call setstate
without ShowDialog. i get S_OK but the codec is still on its defaults...and
the bitrate is only 133KBit.
also i dont know what buffer size to use. i give in getstate a bufsize of 10
but i see in the debugger that the codec ignores that and still write into
the buffer at pos 100 or so...! and returns S_OK
it seems to be that i have to boring the user to show all the time the
dialog....
any idea?
frank


"Alessandro Angeli" <a.angel...@sogetel.REMOVE.it> schrieb im
Newsbeitrag news:eVtcBJIRCHA.1996@tkmsftngp12...

Alessandro Angeli

unread,
Aug 16, 2002, 9:54:04 AM8/16/02
to
You can discover the required buffer size calling
IAMVfwCompressDialogs::GetState() with a NULL buffer pointer.

Beside that, I have no idea how the wrapper or the codec behaves when
setting its state. You can use IAMVfwCompressDialogs::SendDriverMessage() to
communicate directly with the ICM codec as you'd do with ICSendMessage().
You can read about ICM codecs in

\Platform SDK
\Graphics and Multimedia Services
\Windows Multimedia
\Video for Windows
\Video Compression Manager

VirtualDub <http://virtualdub.sourceforge.net/> can save and restore the
state of the video codec, you could have a look at its source code to see
which kind of ICM messages it uses.

"Frank Telbert" <fran...@gmx.de> wrote in message

news:eMomjLRRCHA.4200@tkmsftngp08...

Frank Telbert

unread,
Aug 16, 2002, 12:46:43 PM8/16/02
to
Thanx, i never worked with ICM stuff. OK i give it a try. today i tried more
codecs. i have the same results. i get the dialog (thank you) but can not
yet save the state.some codecs save their state alone (as new defaults).
i habe also the source of virtual dub here. this will take some time...
i want 720x576(PAL)x25fps with ca. 500KBit.
the ms.mpeg4-v3 hase some good quality. but the bitrate is much lower. i
dont know how to get higher bitrates.
but it would be ok already, if i could set the state...
Frank

"Alessandro Angeli" <a.angel...@sogetel.REMOVE.it> schrieb im

Newsbeitrag news:uMa7lySRCHA.3360@tkmsftngp11...

Xu Tao

unread,
Aug 19, 2002, 2:03:36 AM8/19/02
to
That's GREAT!
At first, I have the same problem as Framk Telbert. Now I try to communicate
with the codec driver directly using SendDriverMessage method, everything is
OK.
Thank you. :)

"Alessandro Angeli" <a.angel...@sogetel.REMOVE.it> wrote in message
news:uMa7lySRCHA.3360@tkmsftngp11...

Frank Telbert

unread,
Aug 19, 2002, 4:06:32 AM8/19/02
to
Can you send some smaple code here, please. Frank
"Xu Tao" <xu...@msn.com> schrieb im Newsbeitrag
news:u0E#NU0RCHA.1900@tkmsftngp09...
0 new messages