PDA

View Full Version : DivX/XviD codec menu


HongKongFu
29th June 2002, 20:02
I would like to open the DivX/XviD codec menu
with my program in order to make advanced
codec settings. Does anybody know how this
can be done?

cu fu

int 21h
29th June 2002, 23:41
I think ICM_CONFIGURE is the API you'll want to use to bring up the Codec's dialog box for configuration, but I am confused on how you would use this in your program... can you elaborate as to how you were planning on using these 'advanced' settings and in what context?

HongKongFu
30th June 2002, 00:50
DVX simply changes the bitrate and the pass in the registry, for everything else I'm to lazy, I don't even use advanced codec settings myself. I also think I couldn't do a better menu than the original. Do you know by chance how to call this function from VB.NET, I'm not very experianced in programming

cu fu

llemor
4th July 2002, 05:25
Originally posted by HongKongFu
DVX simply changes the bitrate and the pass in the registry, for everything else I'm to lazy, I don't even use advanced codec settings myself. I also think I couldn't do a better menu than the original. Do you know by chance how to call this function from VB.NET, I'm not very experianced in programming

cu fu

You may want to visit this site:
http://www.shrinkwrapvb.com/

You may find some useful APIs for multimedia programming in VB and converted constants from C to VB. Though it covers VB 5/6, but it might give you some ideas.

HongKongFu
4th July 2002, 11:10
now I have the problem I don't know where to get the parameters for the ICOpen function

HIC ICOpen(
DWORD fccType,
DWORD fccHandler,
UINT wMode
);

I've tried several times to download your VirtualDub tool, download seems to be dead

regards
Dolemite

llemor
4th July 2002, 14:54
Hi,

Try to follow this link: http://epshteyn.net/eugene/programming/win32/video_compression00.txt

No, it's not dead. I just do some housekeeping on my computer, since I'm hosting my website on my machine. Maybe too heavy traffic :D :D

HongKongFu
4th July 2002, 19:04
code does not work, can anybody help

Declare Function ICOpen Lib "msvfw32.dll" (ByVal fccType As Int32, _
ByVal fccHandler As Int32, ByVal wMode As Int32) As Int32
Declare Function ICSendMessage Lib "msvfw32.dll" (ByVal hic As Int32, _
ByVal msg As Int32, ByRef dw1 As Int32, ByRef dw2 As Int32) As Int32
Declare Function mmioStringToFOURCC Lib "winmm.dll" Alias "mmioStringToFOURCCA" _
(ByVal sz As String, ByVal uFlags As Int32) As Int32

Const DRV_USER = &H4000
Const ICM_RESERVED_LOW = (DRV_USER + &H1000)
Const ICM_RESERVED = ICM_RESERVED_LOW
Const ICM_CONFIGURE = (ICM_RESERVED + 10)
Const MMIO_TOUPPER = &H10
Const ICMODE_QUERY = 4

Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim fccType As Int32
Dim fccHandler As Int32
Dim hic As Int32

fccType = mmioStringToFOURCC("VIDC", MMIO_TOUPPER)
fccHandler = mmioStringToFOURCC("H263", MMIO_TOUPPER)
hic = ICOpen(fccType, fccHandler, ICMODE_QUERY)
ICSendMessage(hic, ICM_CONFIGURE, Handle.ToInt32, 0)
End Sub

HongKongFu
10th July 2002, 21:16
ok, it works now, everything must be ByVal, but DivX don't save the settings, XviD does. Does anybody know why is this?

cu fu

mtrooper
11th July 2002, 22:51
Divx does save the settings. Check out ICGetState and ICSetState functions. Everything is saved in buffer you get. Then all you net to get is info from buffer.
Read Video For Windows docs in MSDN and how to work with VfW if you haven't yet, it's a good read :)

ciler
12th July 2002, 07:55
Originally posted by mtrooper
Divx does save the settings. Check out ICGetState and ICSetState functions. Everything is saved in buffer you get. Then all you net to get is info from buffer.
Read Video For Windows docs in MSDN and how to work with VfW if you haven't yet, it's a good read :)

Not exactly... I mean, if you re-open the config window, the settings are reseted.

int 21h
13th July 2002, 00:15
Yea but why would you call ICM_CONFIGURE again after you already had the settings you want?

VirtualDub does almost this exact same thing in its scripting routines, look in the Sylia scripting .job files and you can even see the codec states saved.

HongKongFu
13th July 2002, 09:50
like I said before, DVX changes only pass and bitrate in the registry, when I want to make special DivX settings, I have to make it in VirtualDub, when I call icm_configure from my program and change settings in the menu, nothing will be saved to the registry. I don't think I can solve this problem with VB.NET because it supports no pointers, but I want to learn C++ and C# anyway, I guess it will take me some time I come up with this feature, WinAPI sucks

cu fu

ciler
15th July 2002, 08:59
Originally posted by HongKongFu
like I said before, DVX changes only pass and bitrate in the registry, when I want to make special DivX settings, I have to make it in VirtualDub, when I call icm_configure from my program and change settings in the menu, nothing will be saved to the registry. I don't think I can solve this problem with VB.NET because it supports no pointers, but I want to learn C++ and C# anyway, I guess it will take me some time I come up with this feature, WinAPI sucks

cu fu

As suggested sooner, have a look at http://www.shrinkwrapvb.com/, you'll see that the guy here as found a way to handle pointers in VB

llemor
15th July 2002, 09:41
Originally posted by ciler


As suggested sooner, have a look at http://www.shrinkwrapvb.com/, you'll see that the guy here as found a way to handle pointers in VB

That's right. The good thing - it's fully documented. Nice to read for VB programmers.;)