|
Hope dies, dreams shatter, welcome in the world we like to call Windows(r)
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
To add to Ryan's answer, you cannot prevent the system from interrupting your thread, ever. That's how preemptive multitasking works. If you absolutely need realtime control over the CPU time and hardware, then Windows isn't the right OS to be using.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
Dear All:
I am involved in a project that contains a module recording TV program into local hard disk.
Does anyone have any idea to Capture video come from TV card?
I have a PCI TV card but I have no idea how to capture video stream and encode into MPEG-II.
Your reply is greatly appreciated.
|
|
|
|
|
The answer is DirectShow.
All modern capture cards feature a DirectShow filter that can supply you with raw video data from the capture card. The properties of the filter determine what else it can do. Some can supply you with still-images, for example.
Capturing video with DirectShow is easy. You need to build a capture filter chain or, as they are also called, a capture graph. Filter chains in DS are a set of filters connected adjaciently that process the video data in a pass-through manner. An example of a capture graph is as follows:
- The video source, in my example, Logitech QuickCam 4000 Pro video capture filter
- The encoding filter, here, the XViD video compressor filter
- A video multiplexer, here, the AVI Mux multiplexing filter
- And the file writer filter.
If you wish to try this out, you can download the DirectX 9.0 SDK. This SDK also contains a VERY handy set of tools, from which the most interesting is GraphEdit . This program allows you to build any kind of filter chains using any filters available on your system. So, if the video card has it's drivers installed properly, you should find it's capture filter, in GraphEdit, from "Graph -> Insert Filters... -> Video Capture Sources -> Your PCI TV Card brand here"
After you have inserted this filter, right-click on it's 'Output' or 'Capture' pin, and select 'Render Pin'. This will automatically build a filter chain that can display a live video feed from the filter in a small window.
In order to learn how to build filter chains, you should consult the DirectX SDK documentation. I myself am in the process of writing an article on video capture, but it won't be ready until after a few or more days.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Dear Antti:
Thank you for your detailed explanation.
I have another question, are these features supported in the Windows CE environment? The project will be developed under Windows CE.net.
Thanks a lot.
Jeffrey Gao
|
|
|
|
|
Looking at the supported list of DirectX filters in Windows CE.Net (Found here[^]), it seems that the DX for WinCE .Net lacks the following filters: AVI Mux and File Writer. Unfortunately the availability of Video Capture filters and video compressors is not defined by this list.
You should download the Windows CE .Net SDK. Another interesting thing might be the .Net Compact Framework. This framework sports some level of support for Managed DirectX as well, but unfortunately I am no proficient with it.
The best way would be to obtain a copy of GraphEdit program (Distributed with DirectX SDK) and get it to run on a Windows CE .Net platform. This program could instantly show you what filters/capture devices are available on the target platform. Basically, you will need the following things:
- A video capture source
- A suitable video compressor
- AVI Multiplexer that creates AVI format videos
- A file writer
The last two, like discussed, are not listed in the online reference. Thus I doubt their availability on the actual device also. But as an alternative, the AVI Multiplexer is just used to create a stream that follows AVI format specification. This can be done manually, but requires exact knowledge of the AVI format. The last, file writer, just writes the stream into a file. It could be done by using any suitable stream-based file writing algorithm (such as an advancing file-pointer), so it is not necessary either.
So, grab a copy of GraphEdit somewhere and get it to run on the Windows CE .Net device. I know this isn't much, but it's a start nevertheless.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
As an alternative to what the other guy said, here are two (linux only?) projects that do this in a much more complex mannor, you might learn something from their code, or find they already meet your needs.
http://freevo.sourceforge.net/
http://www.mythtv.org/
|
|
|
|
|
Dear Henry,
Thank you for your reply.
I will check that out.
Jeffrey Gao
|
|
|
|
|
Please excuse the basicness of this question but I just got to know.
Which Comes First: The C or The C++??
I have heard it both ways:
Learn the basics of C then start C++.
Do not Lean C first you may form bad habits and is a waste of time.
Is it that there is not a definitive answer or that someone just can't decide? I am guessing personal perference??
Thanks
-Mark
We're sorry, we were unable to complete you request. The website administrator has been automatically notified.
That's real reassuring.
|
|
|
|
|
|
What does your boss need you to know? The first concern is always what you need today.
I've known several programers that were excellent at C, but never did figure out C++ despite using C++ for years, they were too stuck in the C world. So from that point, it is better to learn C++ first, in hopes that you learn to think about objects from the start.
|
|
|
|
|
Hello everyone.
I write a video capture programe based MDI using MS driectshow ,the
video is captured from CCD camera, i need to preview the real-time
video ,how can i preview the video at one windows of the MDI program.
can you give me some sample code?
Thank you!
|
|
|
|
|
I know how to preview the video to the windows using its hwnd.but i don't konw how to preview the video to a MDI program.
|
|
|
|
|
Well, an MDI window has a HWND. Just use the HWND of your view.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thank you very much,i will try it.
|
|
|
|
|
hi, um i am not sure if this is the right spot to post but i am having a small problem in c++. I have a class that holds a pointer to a struct.
struct somestruct {
someval
};
class someclass {
somestruct* pointer;
}classpointer*;
when i do this:
classpointer->pointer->someval = something;
i get a error i have no idea how to fix it
thanks
|
|
|
|
|
The default member access for a class is private, so you can't access pointer outside of the class unless you declare it as public.
class someclass {
public:
somestruct* pointer;
}classpointer*;
|
|
|
|
|
to add to the other answer, I assume that point is actually allocated ?
anyway, is it a compilation error or a runtime error ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hey-
How does one app go about putting a button on the title bar of another window?
I've seen AOL and WebEx do this?
They place a button, which receives events, and posts a pop-up menu.
Thanks in advance
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
By implementing a hook. See this[^] article for an example.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I have six lines in my code similar to the following:
Biquad[0]->mfVh = pow(10, (0.05*mfGh));
On compiling the program I get the following error:
error c2666: 'pow': 7 overloads have similar conversions.
Could somebody explain to me what this means.
Biquad[i] is an object of cBiquad.
mfVh and mfGh are floats.
I've tried suffixing 10 and 0.05 with f, but that gives me a separate error saying that the use of the suffix there is incorrect.
If you could let me know what I'm doing wrong it would be of great help! Thanks!
|
|
|
|
|
I seem to have fixed it by some kind of brute casting technique.
The line now reads:
Biquad[0]->mfVh =
pow((float)10, (float)(0.05*mfGh));
Here's a link to the MSDN document if somebody else has a similar problem
ERROR C2666
Suggestions for more elegant solutions are welcome!
|
|
|
|
|
I had the same problem. Are you using VS2003? It doesnt seem to be a problem in vs6
Change your code like this. Its a bit neater
Biquad[0]->mfVh = ::pow(10.0, 0.05*mfGh);
|
|
|
|
|
Josh,
Thanks for the tip, and yes, I'm using VS2003. That's a really weird error...digging through the MSDN documentation helped a little and I typecasted everything that could be (even the result, but apparently that wasn't required).
I like your solution better. Could you please explain what the "::" does?
Thanks again!
|
|
|
|
|
The :: means "the pow() function from the globalname space". This is redundant if you dont use namespaces, and probably if you do but I like to use it when calling functions from the c library as it makes the code a bit easier to read im my opinion.
Look at the declaration of the pow() template function in math.h if you are still unsure about how to use it
|
|
|
|