Writing Video Codecs for Win32?
Gldm asks: "I've been working on a video codec as part of a college computer science project, but I've been stuck at an impasse for several months now: I can't figure out how to get video data from the OS to compress or test anything with. All the software applications I have (Premiere, Virtualdub, and AVIcap) want to use Microsoft's Video For Windows API, but I can't find any books on how to get a codec to interface with it. I've tried Microsoft's own docs, but they're not very helpful. The only example source I've found is huffyuv
but it's written and commented so poorly, I can't understand it. I've tried emailing the author but he never replied. I thought it would be simple to do this but apparently VFW is some kind of ancient byzantine labyrinth of messages and function calls and data types I don't understand. If anyone knows a book on the VFW API that still exists and maybe something that very clearly explains exactly how you go about building a DLL please let me know. Or if you have experience programming for this API please please email me."
"I've tried asking my CS department for help, but they barely acknowledge the existence of GUIs and usually have us do everything in SunOS on their ancient 50mhz machines using gcc, which is not practical for this project. Nobody in the department knows any Windows programming and I've been unable to teach myself how to do it. I'm really frustrated because all I need is some kind of pointer to the pixels in a frame, its size and color format, and a pointer of where to put the compressed output."
Yeah, I know you want to do it on Windows, but hear me out - I'm doing this at the moment.
e ich/transcode/ and I think the command line you want is something along the lines of "transcode -i /dev/dvd -y yuv4mpeg,null -o whatever". RTFM. Oh, the output is a format called YUV4MPEG, google for it, and open it in a hex editor, it's kinda obvious.
... so something like "mycodec | mplayer -vo x11".
For source, a program called transcode will turn just about anything into 4:2:0 YUV. If you don't know what 4:2:0 YUV is, go back to MSDN now.Transcode is at http://www.theorie.physik.uni-goettingen.de/~ostr
Make your codec spit out YUV4MPEG too then pipe it into mplayer http://www.mplayerhq.hu/homepage/, with some distinctly non challenging flags
Easy peasy, and no shithead API's.
Dave
I write a blog now, you should be afraid.