If you are writing a screen capture program to get video frames but find that it only captures a blank window when playing a video then I discovered a trick for you.
This is not my original idea so can't take credit for it. I found a link on a programming forum but lost it so I can't provide a direct link.
Under normal circumstances, hardware acceleration prevents you from capturing the video layer resulting in a black frame where the image should be. It might be very difficult if not impossibe to disable hardware settings on someones computer within your program so what can you do?
The trick is to first start a small video in background before running you screencap application. This will occupy the harware layer with the small file. Only one playing video can use hardware acceleration so when you run the next video it runs with software assist only and you can then easily get all the screen caps you want.
One way to implement this could be to have a small video in a resource file and run it using your own built-in player. Your form could remain hidden so no-one will actually know that a video is playing (no audio needed). If the player window from which the screencap will be done is within your program then the user needs no other information except how you want him to select the video window etc....
If you are letting the user choose his own player from which to capture frames then you would have to have a splash screen warning the user to close any playing video and run your program first. Anyway I think most programmers can figure out what I mean here.
The advantage of imbeddding your own player is that you can do multi frame captures and or timed captures etc... instead of just single snaps like most programs allow.
I did not test this within a program yet but did do a test using MS windows media player and media player classic.
For comparison, leave hardare acceleration on and play a dvd etc.. with MPC and hit printscreen. Paste the result in and image editor like mspaint and you get a blank screen where the video should be.
Now close MPC and start a small video in WMP and then open a video (AVI,VOB,DVD) in MPC and hit print screen. Paste the image and there you have a image of the video.
That is not how you do it in a program but this illustrates that it works.
I'm tight for time right now so don't have time to play with this but I'll try something in a vb program within a few weeks. Anyone else is welcome to test this if you want.
+ Reply to Thread
Results 1 to 1 of 1
Similar Threads
-
Which is better - usb stick vhs cap or hd-pvr cap + convert for vhs to dvd?
By yoda313 in forum Capturing and VCRReplies: 22Last Post: 22nd Dec 2011, 20:13 -
Help In Putting Two Videos Into One Screen
By R3CONF1GUR3D in forum EditingReplies: 12Last Post: 13th Apr 2011, 03:20 -
Screen Cap from video
By eliqush in forum Newbie / General discussionsReplies: 3Last Post: 2nd Dec 2009, 04:52 -
Looking for App to Have to Render two videos on screen
By barkster in forum Newbie / General discussionsReplies: 5Last Post: 30th Jan 2009, 08:36 -
Videos expands off screen
By Squid_uk in forum Newbie / General discussionsReplies: 13Last Post: 15th Sep 2008, 18:40