Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » OT: video in...how?

This thread is locked; no one can reply to it. rss feed Print
OT: video in...how?
A J
Member #3,025
December 2002
avatar

does anyone know how i can go about getting video in with my allegro app.
an good URLs or code for win2k/XP ?

___________________________
The more you talk, the more AJ is right. - ML

Ultio
Member #1,336
April 2001

Video In? That's pretty much very hardware specific stuff there. I doubt there's any allegro functions that actually read what's coming through a video-in port, much less do anything with it. Check the manuals, there's probably nothing in there. Most likely you'll need to figure out how to access your video card directly through the operating system, or whatever. I don't know much about accessing hardware.

Also, you need to include more information about your question than "State Question (simply) then Request Code". What are you going to DO with the video in? Do you want it to show to the monitor, or do you want to just do stuff with the content feeding in in the background - like dump it to an avi file without it rendering anything to the screen? More information always helps, and will make people more willing to help you out.

---
"It's nice knowing that someday, the software I write will just be pirated by millions of people." :-/
http://loomsoft.net | Zep's Dreamland | Allegro Newbie Tutorials

Bob
Free Market Evangelist
September 2000
avatar

You could have a look at the VirtualDub source code. It does video captures under Windows. As for interfacing video input with Allegro, I have no idea if it's feasable.

--
- Bob
[ -- All my signature links are 404 -- ]

Steve Terry
Member #1,989
March 2002
avatar

if you simply mean putting video in your project then MJPEGAlleg should do it for you, it's not quite MPEG, but you can take an AVI and use it just fine in an allegro application.. the sound quality still is lacking though from last I heard.

___________________________________
[ Facebook ]
Microsoft is not the Borg collective. The Borg collective has got proper networking. - planetspace.de
Bill Gates is in fact Shawn Hargreaves' ßî+çh. - Gideon Weems

Derezo
Member #1,666
April 2001
avatar

I think he means using a Video-In jack on a video card.

"He who controls the stuffing controls the Universe"

A J
Member #3,025
December 2002
avatar

i mean composite video signal from say a camera or VCR.. pluged into a video input card in PC.
then i get a "surface" of some sort with the signal on it, that i can use in my app, which happens to use alot of allegro.

i think virtual dub has code for captuing direct to disk, which by-passes the "surface" that i would need to access.

i think i needs direct show code.

___________________________
The more you talk, the more AJ is right. - ML

dudaskank
Member #561
July 2000
avatar

Well, if VirtualDub save direct to file, what you need to do is modify the code to output on a BITMAP * struct, but I don't know if the video in is encoded in some format different from RGB or YUV.

And the problem in the audio in MJpgAlleg (the name is because in the start of the library it only play lots of "Moving" JPGs...) is the size, because it needs to be PCM uncompressed.

^__^

Toque a balada do amor inabalável, eterna love song de nós dois
Eduardo "Dudaskank"
[ Home Page (ptbr) | Blog (ptbr) | Tetris 1.1 (ptbr) | Resta Um (ptbr) | MJpgAlleg 2.3 ]

Tobias Dammers
Member #2,604
August 2002
avatar

Two steps to go here:
1) Capture the video input to an OS-native surface/bitmap
2) Transform to allegro.

1) Depends hugely on your platform; looks like you're using windows, and you sort of half-solved the problem there (if not, I can't help you. Find a good lib).
2) Is comparatively easy. Check the allegro docs about how to convert a windows HBITMAP to an allegro BITMAP. No idea about other platforms, but I'm pretty sure if it's not DOS, it should be doable.

---
Me make music: Triofobie
---
"We need Tobias and his awesome trombone, too." - Johan Halmén

A J
Member #3,025
December 2002
avatar

the convertion from a HBITMAP to alegro bitmap is 2 % of the work.

i would like to find out how i can acheive the other 98%, that is getting to video input into a block of memory that i can read.

are there any Direct Show experts out there ?

___________________________
The more you talk, the more AJ is right. - ML

Oscar Giner
Member #2,207
April 2002
avatar

Now I'm learning Direct Show. There are good examples. I thing there's some example about video capturing. Copy&paste the example and made the proper changes (that's basically what I did with MVPlayer).

What you must do is programming a filter that converts uncompressed video to an allegro bitmap, and connect it to the filter graph, removing first the filter that renders the video to the screen or saves it to a file. I can't help you more at the moment.

MiquelFire
Member #3,110
January 2003
avatar

If you can find docs on getting video from WDM, you can get any video in your computer has (in my case, two, my PC camera and my TV tuner card)

And if you find ths info, let me know, I could use it myself

[edit] Never mind, did a lookup in my MSDN files and found that what I'm talking about is DirectShow...

---
Febreze (and other air fresheners actually) is just below perfumes/colognes, and that's just below dead skunks in terms of smells that offend my nose.
MiquelFire.red
If anyone is of the opinion that there is no systemic racism in America, they're either blind, stupid, or racist too. ~Edgar Reynaldo

Go to: