Click here to Skip to main content
11,640,599 members (58,504 online)
Click here to Skip to main content

Trick: How to Capture Video Screen Shots

, 25 Feb 2004 219.6K 5.4K 66
Rate this:
Please Sign up or sign in to vote.
An article describing a trick to capture video screen shots.

Video Screen Shot

Introduction

This article describes a "trick" on how to capture video screen shots, irrespective of the source (file, Webcast stream, TV-input).

Background

My task is to capture a screen shot of a video being played. It is easy to capture a screen shot of a window. However with a video being played (e.g. with Media Player), you will capture the window border and a blank video surface. I am sure there is a way to do it with DirectX and DirectShow methods, however I could not find an article on it. If anyone knows the method or a link to an article on this topic, please let me know. HyperSnap-DX from Hyperionics seems to be the only one with the "proper" way of capturing a video screen shot.

Using the code

The demo application is started, CHogVideo will attempt open and pause the video hog.dat. This is to hog the video resources (*the trick*). You can then open your Media Player (or other video players) to play the video you wish to capture. Once the video is playing, start the capture under "Options".

There are no codes specific to this article. However here are a few links to related articles:

Points of Interest

Why it works?

My guess is that the hogging video, being the first video being played, gets priority to the hardware. Subsequent videos played have to use software rendering, which enables Windows GDI to capture a copy of the frame being played.

Do I need the CHogVideo class?

No. CHogVideo is just for demonstration. You could have just started playing a video file and paused it (say with Media Player). Open a second Media Player to play the intended video screen to capture.

When it will work?

The trick will work for if the video resource is hogged first. It will work for video players that utilize DirectX approach for playing the video (this includes Windows Media Player) regardless of the source (from file, Webcast stream, TV-input).

What about Full Screen mode?

Yes, it will also capture videos in full screen mode.

History

  • February 16, 2004 - First version.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Chiew Heng Wah
Malaysia Malaysia
No Biography provided

You may also be interested in...

Comments and Discussions

 
QuestionIt is not able to capture video, Please help. Pin
Member 40137843-May-11 21:14
memberMember 40137843-May-11 21:14 
AnswerIt is not able to capture video, Please help. Pin
Member 40137843-May-11 21:34
memberMember 40137843-May-11 21:34 
AnswerRe: It is not able to capture video, Please help. Pin
Chiew Heng Wah3-May-11 21:37
memberChiew Heng Wah3-May-11 21:37 
GeneralRe: It is not able to capture video, Please help. Pin
Member 40137843-May-11 21:55
memberMember 40137843-May-11 21:55 
GeneralRe: It is not able to capture video, Please help. Pin
Chiew Heng Wah3-May-11 23:07
memberChiew Heng Wah3-May-11 23:07 
GeneralRe: It is not able to capture video, Please help. Pin
butterfly081525-Jul-11 16:30
memberbutterfly081525-Jul-11 16:30 
GeneralRe: It is not able to capture video, Please help. Pin
Chiew Heng Wah25-Jul-11 23:32
memberChiew Heng Wah25-Jul-11 23:32 
QuestionHow to capture only Open or Save Dialog Box Pin
chintan.desai20-Nov-06 20:14
memberchintan.desai20-Nov-06 20:14 
AnswerRe: How to capture only Open or Save Dialog Box Pin
THE SENSE4-Jan-07 22:56
memberTHE SENSE4-Jan-07 22:56 
GeneralRe: How to capture only Open or Save Dialog Box Pin
chintan.desai5-Jan-07 16:44
memberchintan.desai5-Jan-07 16:44 
GeneralRe: How to capture only Open or Save Dialog Box [modified] Pin
THE SENSE5-Jan-07 17:58
memberTHE SENSE5-Jan-07 17:58 
Questionhow can I do the same in C#? Pin
Winita S12-Sep-06 2:01
memberWinita S12-Sep-06 2:01 
QuestionPrintWindow ? Pin
ChristianS_10-Aug-06 21:53
memberChristianS_10-Aug-06 21:53 
QuestionHow to capture a direct show window Pin
neerajgoel1-Aug-06 1:42
memberneerajgoel1-Aug-06 1:42 
i was trying to get the screen shot using getfrontbuffer() , but i m getting a blank screen when windows media player is there on the screen ... how can i get the screen shot without disbling the hardware acceleration .
AnswerRe: How to capture a direct show window [modified] Pin
achainard1-Aug-06 2:09
memberachainard1-Aug-06 2:09 
AnswerRe: How to capture a direct show window Pin
Chiew Heng Wah1-Aug-06 16:46
memberChiew Heng Wah1-Aug-06 16:46 
QuestionHow to convert to C# version? Pin
Duy Linh18-Jul-06 0:51
memberDuy Linh18-Jul-06 0:51 
GeneralFull Screen Capture is not working Pin
jeykumars13-Jun-06 2:01
memberjeykumars13-Jun-06 2:01 
GeneralRe: Full Screen Capture is not working Pin
Chiew Heng Wah13-Jun-06 15:57
memberChiew Heng Wah13-Jun-06 15:57 
GeneralRe: Full Screen Capture is not working Pin
jeykumars14-Jun-06 0:00
memberjeykumars14-Jun-06 0:00 
GeneralRe: Full Screen Capture is not working Pin
Chiew Heng Wah14-Jun-06 15:52
memberChiew Heng Wah14-Jun-06 15:52 
GeneralGood But ... Pin
despirados16-Apr-06 14:46
memberdespirados16-Apr-06 14:46 
GeneralCapturing Image of Minimized Window Pin
IslamianFalcon30-Nov-05 1:31
memberIslamianFalcon30-Nov-05 1:31 
GeneralRe: Capturing Image of Minimized Window Pin
Chiew Heng Wah1-Dec-05 15:11
memberChiew Heng Wah1-Dec-05 15:11 
Questioncan dirctshow change the framerate ? Pin
infinity070710-May-05 23:21
sussinfinity070710-May-05 23:21 
Generalcapturing from mpeg file Pin
shing yan13-Feb-05 21:12
membershing yan13-Feb-05 21:12 
GeneralRe: capturing from mpeg file Pin
Chiew Heng Wah14-Feb-05 14:18
memberChiew Heng Wah14-Feb-05 14:18 
Generalhiiiiii a litle helpp Pin
Mario_Young20-Jan-05 18:11
memberMario_Young20-Jan-05 18:11 
GeneralRe: hiiiiii a litle helpp Pin
Chiew Heng Wah23-Jan-05 15:05
memberChiew Heng Wah23-Jan-05 15:05 
GeneralCapturing Desktop Pin
m_idris11-Jun-04 0:40
memberm_idris11-Jun-04 0:40 
GeneralRe: Capturing Desktop Pin
Chiew Heng Wah12-Oct-04 0:49
memberChiew Heng Wah12-Oct-04 0:49 
GeneralGuidance Pin
Chivalrous13-Apr-04 19:20
memberChivalrous13-Apr-04 19:20 
GeneralRe: Guidance Pin
Chiew Heng Wah14-Apr-04 15:43
memberChiew Heng Wah14-Apr-04 15:43 
GeneralRe: Guidance Pin
FlyingTinman3-May-04 16:00
memberFlyingTinman3-May-04 16:00 
GeneralRe: Guidance Pin
Goldshtein Haim20-Apr-07 11:45
memberGoldshtein Haim20-Apr-07 11:45 
GeneralDirectShow Capturing Pin
descartes26-Feb-04 23:25
memberdescartes26-Feb-04 23:25 
GeneralRe: DirectShow Capturing Pin
Chiew Heng Wah27-Feb-04 15:13
memberChiew Heng Wah27-Feb-04 15:13 
GeneralRe: DirectShow Capturing Pin
descartes27-Feb-04 23:28
memberdescartes27-Feb-04 23:28 
GeneralRe: DirectShow Capturing Pin
Chiew Heng Wah29-Feb-04 14:09
memberChiew Heng Wah29-Feb-04 14:09 
GeneralRe: DirectShow Capturing Pin
nowlex29-Mar-04 13:34
membernowlex29-Mar-04 13:34 
GeneralRe: DirectShow Capturing Pin
eligetiv1-Jan-05 10:29
membereligetiv1-Jan-05 10:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150731.1 | Last Updated 26 Feb 2004
Article Copyright 2004 by Chiew Heng Wah
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid