Windows Media Encoder XML with Authentication
This one has been bugging me for quite a while: I needed to be able to run a live, PUSH encoding session on startup that was required to authenticate to the Windows Media Services server. When you use the WME GUI, clicking the Start Encoding button will pop-up a dialog box where you can enter in your user name and password. However if you save your encoding settings as a .WME file and try to run it using the WM Command Script, it won’t be able to authenticate and your stream will not start broadcasting. It took a lot of trial and error since I couldn’t find any documentation on what elements and attributes the server allows, but I found out how to make it work.
Windows Media Encoder Session files (.wme files) use XML to store your session settings and can be edited using Notepad or any normal text editor. Save your session as a WME file and then open it for editing. Within the XML is an element called "Broadcast" . It should look something like this:
<broadcast publishserver="mystream.com" publishingpoint="my_publishing_point" publishport="80"></broadcast>The PublishServer is the host you will be pushing to, PublishingPoint is the path to your live stream and the PublishPort is whatever TCP port you will connect to, usually 80. For authentication to work, you just have to add two lines as appear below:
<broadcast publishserver="mystream.com" publishingpoint="my_publishing_point" publishport="80" publishusername="my_username" publishpassword="my_pass"> </broadcast>
Thus PublishUsername will be the username and PublishPassword is the password for authentication. Save your changes and now if you try the command script, your stream should be able to authenticate and start pushing data.
For information on using the WM Command script to automatically start encoding sessions, visit my tutorial here.