|
|
| error |
| Posted: Nov 24 2002, 01:31 PM |
 |
|
Unregistered

|
Hi, I'm programming a program which should start VD, capture a videoclip and stop the capturing again. Now i have to know if there is there any way to make VD stop capturing by sending it messages like 'WM_KEYDOWN','WM_KEYUP' or activating a special MenuItem.
Thx ia - error |
 |
| TKSoft2000 |
| Posted: Nov 24 2002, 02:06 PM |
 |
|
Unregistered

|
Hi, you don't need to code such a program cause it already exists: http://www.geocities.com/GeoFileSer0002/ei...vdstartpro.html
This program also enables to control VirtualDub by console, and also works with clones of VirtualDub (like NanDub).
Regards TKS
|
 |
| error |
| Posted: Nov 24 2002, 02:22 PM |
 |
|
Unregistered

|
Hi, Thanks, but I would prefer to use my own program... Do you have any idea what I could try?
thx ia - error |
 |
| error |
| Posted: Nov 24 2002, 03:18 PM |
 |
|
Unregistered

|
Update: It seems like VD ignores any WM_KEYDOWN/WM_KEYUP/WM_CHAR messages but reacts if a key is 'really' pressed... how is this possible? |
 |
| Spire |
| Posted: Nov 24 2002, 05:51 PM |
 |
|
Unregistered

|
Assuming your Abort hotkey is set to Escape, the following sequence should work:
| CODE | PostMessage(hWnd, WM_KEYDOWN, VK_ESCAPE, 0x00010001); PostMessage(hWnd, WM_CHAR, 0x0000001B, 0x00010001); PostMessage(hWnd, WM_KEYUP, VK_ESCAPE, 0xC0010001);
|
Make sure that hWnd is set to the correct window. |
 |
| error |
| Posted: Nov 24 2002, 07:17 PM |
 |
|
Unregistered

|
| QUOTE (Spire @ Nov 24 2002, 06:51 PM) | Assuming your Abort hotkey is set to Escape, the following sequence should work:
| CODE | PostMessage(hWnd, WM_KEYDOWN, VK_ESCAPE, 0x00010001); PostMessage(hWnd, WM_CHAR, 0x0000001B, 0x00010001); PostMessage(hWnd, WM_KEYUP, VK_ESCAPE, 0xC0010001);
|
Make sure that hWnd is set to the correct window. |
Now I get the following error: ')' expected but identifier 'x00010001' found"
After I changed the Source to
| CODE | PostMessage(hWnd, WM_KEYDOWN, VK_ESCAPE, $00010001); PostMessage(hWnd, WM_CHAR, $0000001B, $00010001); PostMessage(hWnd, WM_KEYUP, VK_ESCAPE, $C0010001);
|
I don't get any errors but the function doesnt work... |
 |
| Spire |
| Posted: Nov 24 2002, 08:08 PM |
 |
|
Unregistered

|
You're right; I just tested it and it doesn't work.
Try this instead:
| CODE | keybd_event(VK_ESCAPE, 0, 0, 0); keybd_event(VK_ESCAPE, 0, KEYEVENTF_KEYUP, 0); |
BTW, in case you were wondering, there is no need to make VirtualDub the foreground window before doing this. It should work regardless of what the current foreground window is. |
 |
| error |
| Posted: Nov 24 2002, 08:45 PM |
 |
|
Unregistered

|
Thanks a lot! |
 |
| Spire |
| Posted: Nov 24 2002, 08:57 PM |
 |
|
Unregistered

|
No problem. So you got it working? |
 |
| DubbedOut |
| Posted: Nov 24 2002, 09:53 PM |
 |
|
Unregistered

|
Vdub doesn't respond to key press messages? I may have to test this myself some time. |
 |
| Spire |
| Posted: Nov 25 2002, 12:10 AM |
 |
|
Unregistered

|
| QUOTE (DubbedOut @ Nov 24 2002, 01:53 PM) | | Vdub doesn't respond to key press messages? I may have to test this myself some time. |
The reason for this is that it's actually not VirtualDub that's trapping the Esc key; it's the Video for Windows video capture subsystem itself.
The VfW abort-keypress functionality is somewhat weird; it allows the caller to specify the virtual keycode of the key used to abort the capture (it defaults to VK_ESCAPE). However, the documentation seems to indicate that the mechanism used for detecting the keypress is WM_HOTKEY rather than the more conventional WM_CHAR or even WM_KEYDOWN/WM_KEYUP method. This is why the abort keypress works even when VirtualDub isn't in the foreground.
Unfortunately, it's not possible to simulate the WM_HOTKEY message because we don't know what id VfW used to register the hotkey. So instead, we have to go lower and simulate an actual keypress using keybd_event().
I was going to post this explanation originally, but I figured no one cared. |
 |
| DubbedOut |
| Posted: Nov 29 2002, 05:39 AM |
 |
|
Unregistered

|
Wow! I just tested this myself, and man.. This thread deserves a sticky.. Very informative. Thx to the original guy asking the ? and then the guy who gave the working response (keybd_event).
It's true, you can sendkeys to every part of VDub all you like.. But when the capture has started, and Vdub is locked up capturing, there's no other way to get out (via program) short of simulating a real keyboard ESC press with Keybd_event. I was surprised when sendkeys ESC directly to VDub and even a SendMessage with ESC keydown didn't work.
Alright I've now got the sweetest little app to custom record TV with Vdub. Starts Vdub, goes to capture, sets up resolution & codec based on my command line preference, configures some other things & sets capture file info.. Then captures for a set amount of time, exits capture mode, closes VDub! Combined with task scheduler Vdub is a very powerful tool. I think functionality like this, built into Vdub itself, would rival any other TV capture system on the market. |
 |
| ChristianHJW |
| Posted: Nov 29 2002, 07:06 AM |
 |
|
Advanced Member
  
Group: Moderators
Posts: 1768
Member No.: 2
Joined: 7-July 02

|
| QUOTE (DubbedOut @ Nov 29 2002, 07:39 AM) | | Alright I've now got the sweetest little app to custom record TV with Vdub. Starts Vdub, goes to capture, sets up resolution & codec based on my command line preference, configures some other things & sets capture file info.. Then captures for a set amount of time, exits capture mode, closes VDub! Combined with task scheduler Vdub is a very powerful tool. I think functionality like this, built into Vdub itself, would rival any other TV capture system on the market. |
Would like to join the VdubMod team ?
We'd like to implement such a functionality into VdubMod, so people can capture to OGM and later to MCF. In fact i was talking to Joe, the author of the German Mod on http://www.virtualdub.net , about it and he agreed he would allow us to implement some of his features into VdubMod.
His mod comprises :
- easy to use timer control - IR output via WinLIRC to control TVs/Sat-Receivers - time syncronizing with official DCF-77 time servers - simple setup of batch files for recording, including channel selection on TV/Sat
etc.
Maybe once UCI is there you'll be able to capture sound in FLAC .... if Josh Coalson agrees to implement an UCI interface into FLAC that is ...
-------------------- Visit the unofficial Virtualdub support forum on http://forums.virtualdub.org - help to reduce the big number of emails Avery Lee is getting every day !! Support matroska as container and Gstreamer as the only truely open, x-platform multimedia platform .... |
 |
| error |
| Posted: Nov 29 2002, 10:37 AM |
 |
|
Unregistered

|
| QUOTE (Spire @ Nov 24 2002, 09:57 PM) | | No problem. So you got it working? |
Yes! 
If my pc wasn't that slow I had a nice VCR now...
mfg error |
 |
| DubbedOut |
| Posted: Dec 2 2002, 03:14 PM |
 |
|
Unregistered

|
| QUOTE | | Would like to join the VdubMod team ? |
You have no idea how badly I would.. But, I don't have enough time for anything now adays.. Barely enough for my family, let alone anything else  |
 |
|