Click here to Skip to main content
15,867,756 members
Articles / Multimedia / DirectX
Article

Change Video Signal Format with DirectX library

Rate me:
Please Sign up or sign in to vote.
3.86/5 (7 votes)
23 Feb 2005 121.2K   1.9K   30   24
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:

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

To set brightness:

C#
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:

C#
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


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

Comments and Discussions

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

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

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