When streaming with widows media encoder 9 sometimes the stream goes down or locks up. This post will address these issues. (The following was done on a win XP computer and it works.)
Part one.
Encoder restart:
Based on a post here:
http://www.serverroom.us/mediapulltutorial
How To Automate Live Streaming With Windows Media Encoder, Windows media Encoder reconnect.
This article will explain how to have Windows Media Encoder automatically reconnect (always stay encoding), and also explain how to have Windows Media Encoder automatically start encoding at boot up, for example in case of a power outage.
Saving Configuration
1. Save your Windows Media Encoder configuration as C:encoderconfig.wme
windows media pull tutorial
Downloading
2. Download this Zip file and unzip the two files ( reconnect.vbs and startencoding.bat ) onto your C: WME Download files
Testing files
3. Make sure Windows Media Encoder isn’t currently running, and test the startencoding.bat file by double clicking it. You should see Windows Media Encoder start up, and a few seconds later start encoding.
Click “Stop Encoding” in your encoder and wait 10 seconds. You should see your encoder automatically start encoding again.
If the encoder never started encoding and didn’t display an error, make sure reconnect.vbs is located on your C:. You may also try double clicking it manually to test if it works (while the encoder is open).
Test Passed
Start encoding on reboot.
4. If the test passed, place a shortcut to startencoding.bat in your Startup directory by dragging it to Start -> Programs -> Startup
windows media pull tutorial
Computer Settings
5. Make sure your computer is set to automatically logon.
For 2000 and XP instructions, see below
Reboot the computer and make sure Windows Media Player starts and begins encoding. You may also want to check your computer’s BIOS to make sure the power state will always be “ON” or “LAST” after a power outage. If it is set to “OFF”, the most common default, your computer will not reboot in the case of a power outage.
Now you don’t have to worry about power outages or network anomalies, knowing that your encoding machine will always be encoding. Enjoy your newly found freedom!
WME Download Script files mentioned in post.
Part two
How to reset a WME webstream. Sometimes the stream locks up, server goes up and down or other anomalies take place. This is one method to reset stream every 4 hours (or whatever times you choose) This also could start and stop a stream during certain hours if autorestart script is disabled that is.
Solution setup a macro to start stop encoder 2 to 4 times a day! Also disconnects users so all bandwidth is not used by someone leaving there computer on all night. But most important keeps stream up.(it automates the mouse and mouse clicks!)
(Note old method below for restart purpose use encoder restart method explained above for that this is a reset or start stop time method)
Software Needed the new version is paid, the old version is free search for it if you need free version.
http://www.nkprods.com/nmacro/
nMacro Recorder 1.1
Name: nMacro Recorder
Version: 1.1
Price: FREE (only for non-commercial use)
Size: 375 KB
Release date: 23 SEP 2006
Category: Automation Tool
nmacro-recorder-1.1 (Its getting hard to find so here it is get paid version if you can but if a non-comm this is free)
Create macro to stop and start encoding of WME.
It records mouse movements and saves as a .bat or .exe file. So you can point windows scheduler to that file. Just record stop and start mouse clicks or stop and start as separate files. ( note screen size and position must be maintained of WME encoder because if it changes mouse will click in wrong place I just make WME window max size and make sure windows remembers its position)
After that use windows scheduler to run the macro at the times you choose like midnight and 6:00am. Note you must be logged in for windows scheduler to work. So make sure your automatic windows re-start* includes a autologon.
The following is optional. It is if you want an auto reboot, but you may consider a power outage an auto reboot so read on about autologin also.
*AUTO BOOT Shut Down, Restart, COMPUTER Log Off XP Using A Batch File – Undocumented feature for XP
(Ok use this to create a .bat point windows scheduler to it once a week or 2 weeks or whatever this is optional but I include here because most computers need rebooted once in a while, you must do an autolog on hack so you do not see login screen, yet you still need a password, try it first if need do hack to logon. The follow is for a remote reboot in our case the remote is windows scheduler is all both will work)
How to shutdown a XP Pro computer when you are connected using RDC (Remote Desktop Connection) using a batch file or RPC (Remote Procedure Command) This is useful if you can’t get to the computer but have remote access to the computer via a network or the Internet.
First To show you what you will see at a command prompt (command.com) when you type: “shutdown /?” Without the ” ” on each end.
c:>shutdown /?
Usage: SHUTDOWN [-i | -l | -s | -r | -a] [-f] [-m computername] [-t xx] [-c “c
omment”] [-d up:xx:yy]
No args Display this message (same as -?)
-i Display GUI interface, must be the first option
-l Log off (cannot be used with -m option)
-s Shutdown the computer
-r Shutdown and restart the computer
-a Abort a system shutdown
-m computername Remote computer to shutdown/restart/abort
-t xx Set timeout for shutdown to xx seconds
-c “comment” Shutdown comment (maximum of 127 characters)
-f Forces running applications to close without warning
-d [u][p]:xx:yy The reason code for the shutdown
u is the user code
p is a planned shutdown code
xx is the major reason code (positive integer less than 256)
yy is the minor reason code (positive integer less than 65536)
This is an undocumented feature in XP so I have not found any writeup about it on M$ and everything used here is from other sources. Do not use “cmd” to start the command interpreter (cmd.exe), but type “command” for (command.com. Now you can shutdown the computer by typing “shutdown -s” or to restart the computer type “shutdown -r”
To create a batch file for this you can use notepad, and save the file as .bat in c: (root directory) Here are the 3 most used batch files for shutdown:
1 save as down.bat
shutdown -s
2 save as restart.bat
shutdown -r
3 save as forcedown.bat
shutdown -f
4 save as logoff.bat
shutdown -l
5 save as rpcdown.bat (replace computername with the name of your computer )shutdown -s -m computernameand this last one is fun in an enviroment using RPC
So that’s a piece of cake, the other options are self explanatory and if you need any help creating the batch file, ask and someone will help
Auto Logon
Here is more then you want to know about the subject most likely but knowledge is power as they say. Remember Windows Scheduler Requires a password so be careful and test this otherwise you may disable widows scheduler kind of the domino effect.
http://www.wtjrtv.org/engineering/wp-content/uploads/2009/01/passwordsxplogon.txt
In conclusion;
If all you want is auto restart and reboot on power outage you do not need to use widows scheduler and any of the auto log on methods would work. You just manually reboot once in a while in that case. Or if you are not concerned about that just use the auto restart script.
So what if you are on a domain? The streamer or VOD computer for that matter does not have to join the domain, the mount points will work use VNC for remote connect. If you just have to join domain, (why?) ignore auto logon part or experiment with it use auto reconnect script above at min.
All the data is posted here for the idea of a computer running all the time with a min of intervention. Needless to say strip it of all software not needed including AV, and windows update, never let it go to sleep or stand by and so on, but that is the topic of another post.
In His Service,
Jim W