Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to read .prx file contents in C# application.

30 views
Skip to first unread message

mint

unread,
Nov 11, 2009, 8:38:02 AM11/11/09
to
I want to read the 'video size' from .prx file through C# code.
Can anybody give some help on this topic.

Thanks.


Ajitpal Singh

unread,
Dec 29, 2009, 9:06:02 AM12/29/09
to
Hey you can use the code in C# like this :-

private void importProfile(string profileName)
{
try
{
//Audio-Video profile...
WmProfile.ContentType = 17;

//filling combo box..
DrpAudioMode.Items.Clear();
DrpVideoMode.Items.Clear();

DrpAudioMode.Items.Add("Constant Bit Rate (CBR)");
DrpAudioMode.Items.Add("Peak VBR");
DrpAudioMode.Items.Add("Quality VBR");
DrpAudioMode.Items.Add("Bit Rate VBR");

DrpVideoMode.Items.Add("Constant Bit Rate (CBR)");
DrpVideoMode.Items.Add("Peak VBR");
DrpVideoMode.Items.Add("Quality VBR");
DrpVideoMode.Items.Add("Bit Rate VBR");

//Clearing codec in audio and video..
DrpAudioCodec.Items.Clear();
DrpVideoCodec.Items.Clear();

//Loading the profile....
WmProfile.LoadFromFile(profileName);

IWMEncAudienceObj Audnc = null;
for (int i = 0; i < WmProfile.AudienceCount; i++)
{
Audnc = WmProfile.get_Audience(i);
}

txtName.Text = WmProfile.ProfileName;
txtDecription.Text = WmProfile.ProfileDescription;

WMENC_PROFILE_VBR_MODE v =
WmProfile.get_VBRMode(WMENC_SOURCE_TYPE.WMENC_VIDEO, 0);
WMENC_PROFILE_VBR_MODE a =
WmProfile.get_VBRMode(WMENC_SOURCE_TYPE.WMENC_AUDIO, 0);

DrpVideoMode.SelectedIndex = setIndex(v);
DrpAudioMode.SelectedIndex = setIndex(a);

//video Codecs....
object vVidCodecName;
int lVid4cc;

for (int x = 0; x < WmProfile.VideoCodecCount; x++)
{
lVid4cc = WmProfile.EnumVideoCodec(x, out vVidCodecName);
DrpVideoCodec.Items.Add(vVidCodecName.ToString());
}

int videoindex = Audnc.get_VideoCodec(0);
if (videoindex != -1)
DrpVideoCodec.SelectedIndex = videoindex;

//Audio Codec...
object vAudCodecName;
int lAud4cc;

for (int x = 0; x < WmProfile.AudioCodecCount; x++)
{
lAud4cc = WmProfile.EnumAudioCodec(x, out vAudCodecName);
DrpAudioCodec.Items.Add(vAudCodecName.ToString());
}

//
Audnc.get_Property(WMENC_SOURCE_TYPE.WMENC_AUDIO,WmProfile.AudienceCount,

int audioCodecIndex = Audnc.get_AudioCodec(0);
if (audioCodecIndex != -1)
DrpAudioCodec.SelectedIndex = audioCodecIndex;

//audio format...
DrpAudioFormat.Items.Clear();
object vAudFormatName;
int lAudBRate;
object SRate;
object Channels;
object BperSample;

for (int x = 0; x <
WmProfile.get_AudioFormatCount(DrpAudioCodec.SelectedIndex); x++)
{
lAudBRate =
WmProfile.EnumAudioFormat((DrpAudioCodec.SelectedIndex), x, out
vAudFormatName, out SRate, out Channels, out BperSample);
DrpAudioFormat.Items.Add(vAudFormatName);
}

int audioFormatIndex = Audnc.get_AudioFormat(0);
if (audioFormatIndex != -1)
DrpAudioFormat.SelectedIndex = audioFormatIndex;

//adding the rest of the value...
txtBitrate.Text = (Audnc.get_VideoBitrate(0) /
1000).ToString();
txtFPS.Text = (Audnc.get_VideoFPS(0) / 1000).ToString();
txtWidth.Text = Audnc.get_VideoWidth(0).ToString();
txtHeight.Text = Audnc.get_VideoHeight(0).ToString();
txtSmoothness.Text =
(Audnc.get_VideoImageSharpness(0)).ToString();

}


Enjoy....

0 new messages