Skip to main content
Email Password   helpLost your password?

Sample Image

Introduction

I posted an article DirectX Video Stream and Frame Capture a few months before, and I got a few feedbacks. Please refer to the article for more information. As a response to many requests, I added again some examples on how to use the video capture library.

In this example, I added a sample code to change the video format from NTSC to PAL and vice versa. A code piece to change the brightness, and the old, grasp a frame from video and finally save to a video file.

Actually this example is prepared in a rush, so I would hope anyone to send me any comments so that I can update it again. Thanks.

Using the code

To change to PAL_B standard:

private void button2_Click(object sender, System.EventArgs e)
{
    capture.VideoFormat= DShowNET.AnalogVideoStandard.PAL_B;
}

To set brightness:

void button2_Click_1(object sender, System.EventArgs e)
{
    VideoProcAmp_prop Brightness;
    Brightness= 
      capture.Get_VideoProcAmpProp(
      DShowNET.VideoProcAmpProperty.VideoProcAmp_Brightness);
    capture.Set_VideoProcAmpProp(
      DShowNET.VideoProcAmpProperty.VideoProcAmp_Brightness,5106);
}

To capture a frame:

void button1_Click(object sender, System.EventArgs e)
{
    capture.FrameEvent2 += new Capture.HeFrame(CaptureDone);
    capture.GrapImg();
}

Points of Interest

Thanks for everyone who gave me suggestions for adding these functions to the code. I am sorry that this is not a robust sample, I created it just for demo purpose. Please tell me if you have any questions and suggestions.

You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
Generalwant to change the brightness... Pin
Lomis
1:43 27 Jul '09  
GeneralI can not set Brightness or contrast Pin
kanada ketan H
2:54 15 Dec '08  
GeneralChange VideoSignal and VideoSource Pin
haxmaxx
3:55 14 Sep '06  
GeneralNice article! Pin
almere109
22:31 2 Mar '06  
QuestionCan't get it to work! Pin
Peaver
11:30 15 Nov '05  
Generalit doesnt work for ATI VGA+Capture Pin
sohrabi
12:56 21 Oct '05  
GeneralRe: it doesnt work for ATI VGA+Capture Pin
sohrabi
12:59 21 Oct '05  
GeneralRe: it doesnt work for ATI VGA+Capture Pin
sandinog26
17:30 29 Nov '05  
GeneralProblem changing Frame Size Pin
maihuaz
16:26 8 May '05  
GeneralRe: Problem changing Frame Size Pin
Anonymous
1:16 10 May '05  
Generaldont have capture device ? Pin
Chrono_man
11:12 7 May '05  
GeneralRe: dont have capture device ? Pin
hpAng
1:19 10 May '05  
GeneralVideoProcAmp Problem Pin
yoda_2069a
20:46 2 May '05  
GeneralRe: VideoProcAmp Problem Pin
hpAng
1:20 10 May '05  
Generaldesktop capture Pin
Anmar-xe
23:40 11 Apr '05  
GeneralRe: desktop capture Pin
hpAng
1:21 10 May '05  
GeneralBrightness change in a video. Pin
MarsWalker
8:59 11 Apr '05  
GeneralSeem REAL interesting, but does it work Pin
regispoulin
10:43 31 Mar '05  
GeneralRe: Seem REAL interesting, but does it work Pin
hpAng
1:23 10 May '05  
GeneralInteresting. Pin
Anonymous
8:37 14 Mar '05  
GeneralRe: Interesting. Pin
hpAng
4:38 15 Mar '05  
GeneralRe: Interesting. Pin
Renecito
7:45 18 Mar '05  
GeneralRe: Interesting. Pin
hpAng
1:26 10 May '05  
GeneralLooks interesting but... Pin
Poolbeer
1:51 24 Feb '05  


Last Updated 23 Feb 2005 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2009