Because you have the vod ( video on demand ) in you nc.connect("rtmp://localhost/vod"); connect call makes me think you are using the wrong FMS / AMS version.
You need the interactive server to publish video.
You may be running Flash Media Streaming Server and not Flash Media Interactive Server.
Or the new AMS versions.
Adobe Media Server 5 Standard
You should use
Adobe Media Server 5 Professional.