Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8929255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:38:01+00:00 2026-06-15T08:38:01+00:00

I’m using a third party control for video capture that uses .prx files for

  • 0

I’m using a third party control for video capture that uses .prx files for certain output attributes, namely the output size. I’m trying to set the output height and width to be the largest possible while maintaining the ratio of the user’s actual screen size.

I believe the .prx file is just an XML file, but when I open the it as an XMLDocument then save it, I get a message stating “The Profile is invalid. (0xC00D0BC6)” when trying to open with Windows Media Encoder. I was able to open the same file without issue before running the code.

Dim prx As New XmlDocument()
prx.Load(Globals.appPath + prxFileName)
Dim prxWidth As XmlAttribute = prx.SelectSingleNode("/profile/streamconfig/wmmediatype/videoinfoheader/bitmadinfoheader/@biwidth")
Dim prxHeight As XmlAttribute = prx.SelectSingleNode("/profile/streamconfig/wmmediatype/videoinfoheader/bitmadinfoheader/@biheight")
prx.Save(Globals.appPath + prxFileName)

So without doing any actual editing of the file but re-saving it as an XMLDocument, the profile becomes invalid. Is there a way to edit .prx files in code while maintaining the profile validity?.

For reference, a valid .prx file opened in a text editor is below.

<profile version="589824" 
         storageformat="1" 
         name="myProfile" 
         description=""> 
               <streamconfig majortype="{73647561-0000-0010-8000-00AA00389B71}" 
               streamnumber="1" 
               streamname="Audio Stream" 
               inputname="Audio409" 
               bitrate="48000" 
               bufferwindow="3000" 
               reliabletransport="0" 
               decodercomplexity="" 
               rfc1766langid="en-us" 
> 
         <wmmediatype subtype="{00000161-0000-0010-8000-00AA00389B71}"  
               bfixedsizesamples="1" 
               btemporalcompression="0" 
               lsamplesize="1152"> 
       <waveformatex wFormatTag="353" 
                     nChannels="2" 
                     nSamplesPerSec="32000" 
                     nAvgBytesPerSec="6000" 
                     nBlockAlign="1152" 
                     wBitsPerSample="16" 
                     codecdata="008800001F0000000000"/> 
        </wmmediatype>
        </streamconfig>
               <streamconfig majortype="{73646976-0000-0010-8000-00AA00389B71}" 
               streamnumber="2" 
               streamname="Video Stream" 
               inputname="Video409" 
               bitrate="400000" 
               bufferwindow="3000" 
               reliabletransport="0" 
               decodercomplexity="AU" 
               rfc1766langid="en-us" 
> 
                 <videomediaprops maxkeyframespacing="80000000" 
                                 quality="100"/> 
         <wmmediatype subtype="{33564D57-0000-0010-8000-00AA00389B71}"  
               bfixedsizesamples="0" 
               btemporalcompression="1" 
               lsamplesize="0"> 
   <videoinfoheader dwbitrate="400000" 
                    dwbiterrorrate="0" 
                    avgtimeperframe="333333"> 
    <rcsource left="0" 
              top="0" 
              right="2000" 
              bottom="562"/> 
    <rctarget left="0" 
              top="0" 
              right="2000" 
              bottom="562"/> 
        <bitmapinfoheader biwidth="2000" 
                          biheight="562" 
                          biplanes="1" 
                          bibitcount="24" 
                          bicompression="WMV3" 
                          bisizeimage="0" 
                          bixpelspermeter="0" 
                          biypelspermeter="0" 
                          biclrused="0" 
                          biclrimportant="0"/> 
   </videoinfoheader>
        </wmmediatype>
        </streamconfig>
</profile> 

With help from this question, Video Capture output always in 320×240 despite changing resolution, I changed my strategy a bit to use IWMStreamConfig.

    Dim profileData As String
    Using reader As New StreamReader(File.OpenRead(Globals.appPath + prxFileName))
        profileData = reader.ReadToEnd()
    End Using

    Dim profileManager As IWMProfileManager
    Dim wmProfile As IWMProfile = Nothing
    Dim hr As Integer = WMLib.WMCreateProfileManager(profileManager)
    If hr >= 0 Then
        hr = profileManager.LoadProfileByData(profileData, wmProfile)
    End If

    If profileManager IsNot Nothing Then
        System.Runtime.InteropServices.Marshal.ReleaseComObject(profileManager)
        profileManager = Nothing
    End If

    Dim pConfig As IWMStreamConfig
    wmProfile.GetStream("Video Stream", pConfig)

Now that I have at least the stream as an IWMStreamConfig object, I feel like I’m getting closer. But how do I edit the BITMAPINFOHEADER.biHeight and BITMAPINFOHEADER.biWidth as found in this MSDN article?

http://msdn.microsoft.com/en-us/library/windows/desktop/dd756998(v=vs.85).aspx

The SetBitRate and SetBufferWindow are showing up in InteliSense but I’m not sure how to get to these lower level properties.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T08:38:03+00:00Added an answer on June 15, 2026 at 8:38 am

    After looking at the file in a Hex Editor, the valid profiles have 0x00 between each character and the file starts with 0xFFFE, I’m assuming for some encoding. Once that was determined, I just used a stream reader to read in the text to a string and made my changes with string manipulation.

    The tricky part was writing everything back to the file. For some reason, any way I tried to write the first two Hex characters to the file, they would be translated to four different Hex characters. The solution was to write it byte by byte with a FileStream.

    //Read in the initial profile
    Dim profileData As String
    Using reader As New StreamReader(File.OpenRead(prxFile))
        profileData = reader.ReadToEnd()
    End Using
    
    //Make changes to the profile with string manipulation
    
    //Write the changed data back to the file including all the Hex characters
    File.Delete(prxFile)
    Dim FS As FileStream = New FileStream(prxFile, FileMode.CreateNew)
    //Start by writing 0xFFFE
    FS.WriteByte(&HFF)
    FS.WriteByte(&HFE)
    //Then write each character succeeded by 0x00
    For Each Character As Char In profileData.ToCharArray
        FS.WriteByte(AscW(Character))
        FS.WriteByte(&H0)
    Next
    FS.Close()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have thousands of HTML files to process using Groovy/Java and I need to
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.