Click here to Skip to main content
11,641,971 members (61,388 online)
Click here to Skip to main content

Change Video Signal Format with DirectX library

, 23 Feb 2005 94.3K 1.5K 30
Rate this:
Please Sign up or sign in to vote.
An enhancement for the DirectX video stream and frame capture sample.

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.

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

hpAng
Web Developer
Malaysia Malaysia
Please visit my website www.mbwebcreator.com for more web site information.

You may also be interested in...

Comments and Discussions

 
Generalwant to change the brightness... Pin
Lomis27-Jul-09 0:43
memberLomis27-Jul-09 0:43 
GeneralI can not set Brightness or contrast Pin
kanada ketan H15-Dec-08 1:54
memberkanada ketan H15-Dec-08 1:54 
GeneralChange VideoSignal and VideoSource Pin
haxmaxx14-Sep-06 2:55
memberhaxmaxx14-Sep-06 2:55 
GeneralNice article! Pin
almere1092-Mar-06 21:31
memberalmere1092-Mar-06 21:31 
QuestionCan't get it to work! Pin
Peaver15-Nov-05 10:30
memberPeaver15-Nov-05 10:30 
Generalit doesnt work for ATI VGA+Capture Pin
sohrabi21-Oct-05 11:56
membersohrabi21-Oct-05 11:56 
GeneralRe: it doesnt work for ATI VGA+Capture Pin
sohrabi21-Oct-05 11:59
susssohrabi21-Oct-05 11:59 
GeneralRe: it doesnt work for ATI VGA+Capture Pin
sandinog2629-Nov-05 16:30
membersandinog2629-Nov-05 16:30 
GeneralProblem changing Frame Size Pin
maihuaz8-May-05 15:26
membermaihuaz8-May-05 15:26 
GeneralRe: Problem changing Frame Size Pin
Anonymous10-May-05 0:16
sussAnonymous10-May-05 0:16 
Questiondont have capture device ? Pin
Chrono_man7-May-05 10:12
memberChrono_man7-May-05 10:12 
AnswerRe: dont have capture device ? Pin
hpAng10-May-05 0:19
memberhpAng10-May-05 0:19 
GeneralVideoProcAmp Problem Pin
yoda_2069a2-May-05 19:46
memberyoda_2069a2-May-05 19:46 
GeneralRe: VideoProcAmp Problem Pin
hpAng10-May-05 0:20
memberhpAng10-May-05 0:20 
Generaldesktop capture Pin
Anmar-xe11-Apr-05 22:40
memberAnmar-xe11-Apr-05 22:40 
GeneralRe: desktop capture Pin
hpAng10-May-05 0:21
memberhpAng10-May-05 0:21 
GeneralBrightness change in a video. Pin
MarsWalker11-Apr-05 7:59
memberMarsWalker11-Apr-05 7:59 
GeneralSeem REAL interesting, but does it work Pin
regispoulin31-Mar-05 9:43
memberregispoulin31-Mar-05 9:43 
GeneralRe: Seem REAL interesting, but does it work Pin
hpAng10-May-05 0:23
memberhpAng10-May-05 0:23 
GeneralInteresting. Pin
Anonymous14-Mar-05 7:37
sussAnonymous14-Mar-05 7:37 
GeneralRe: Interesting. Pin
hpAng15-Mar-05 3:38
memberhpAng15-Mar-05 3:38 
GeneralRe: Interesting. Pin
Renecito18-Mar-05 6:45
memberRenecito18-Mar-05 6:45 
GeneralRe: Interesting. Pin
hpAng10-May-05 0:26
memberhpAng10-May-05 0:26 
GeneralLooks interesting but... Pin
Poolbeer24-Feb-05 0:51
memberPoolbeer24-Feb-05 0:51 

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
Web01 | 2.8.150731.1 | Last Updated 24 Feb 2005
Article Copyright 2005 by hpAng
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid