View Full Version : Xvid file can't be read out using VfW?
matmike
26th January 2004, 19:11
Hi,
as I solved most of the problems, eith my program, my last and biggest problem still exists:
I cannot open (better: readout) any xvid-encoded files.
Files with coded with any other codec I tested is working (msmpeg4, divx, ...). Does anybody know, why this happens?
When I'm using Virtual-Dub to open the files, everything is working fine.
My code to access the files and the compiled version can be downloaded from http://www.matthias-mielke.de/vfw.zip
It would be great if someone could help me.
MatMike
esby
27th January 2004, 16:29
I don't know how to help you,
but i think i had the same problem in delphi using vfw too.
the only workaround solution i could find was changing the f4cc
and have the xvid clip played by divx5 .. ~~
esby
PS: if i am remembering well, AVIStreamGetFrameOpen() was failing
with xvid... ( like in what i wrote ages ago there --> http://esby.free.fr/prog/lbkiller/toDO.txt )
matmike
27th January 2004, 16:46
After dancing on the top of the pylon (I hope you saw "Last boy scout":)), I think I have to say thank you very much.
It is working when changing the identifier of the files at position 0x70 to "divx" and at position 0xbd to "DX50".
Til' yesterday I was only experimenting with letting the xvid-encoder change the f4cc. It was not working. But when I do it by hand, everything is fine.
Again, thank you very much,
MatMike
Shalcker
27th January 2004, 20:10
I also had this problem... The thing is that most codecs return RGB24 when you pass NULL parameter to AviStreamGetFrameOpen, but it's not the case for XviD (probably some kind of bug in vfw implementation). So you cannot use NULL parameter for AviStreamGetFrameOpen. You should create BITMAPINFO structure, fill it with appropriate RGB24 data and pass it into AviStreamGetFrameOpen call instead of NULL. Then most xvid files will open without any problems.
matmike
27th January 2004, 20:22
Thanks for the post. Do you have any information or example code for that. I don't know exactly what you mean although I understand it in theory.
At the moment, my call is container.AviGetFrame = AVIStreamGetFrameOpen(container.video, NULL);
I understand that I have to reaplce the final NULL by a structure like
tagBITMAPINFOHEADER *patch_xvid=new tagBITMAPINFOHEADER;
patch_xvid->biBitCount=24;
patch_xvid->biSize=sizeof(BITMAPINFOHEADER);
patch_xvid->biWidth=352;
patch_xvid->biHeight=480;
patch_xvid->biPlanes=1;
patch_xvid->biCompression=BI_RGB;
But when I do this, it is not working the way I want it to. I still get the same errors as every time.
MatMike
matmike
27th January 2004, 21:45
OK, just forget about that.
I'm dancing on the lights again:)
Everything is working. Thank you very much, my diploma thesis is already done now.
If someone needs the source code because he has the same problems, I will upload my code, of course. Just let my know by mail or post here.
MatMike
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.