The online racing simulator
Guide : Broadcasting LFS
1
(43 posts, started )
Guide : Broadcasting LFS
(Note to moderators: Have tried to find the right section to post this in but just couldn't find the most appropriate one) - It is in the correct place, imho (taa).

*** UPDATE ***

Although this guide is the way I would recommend you to broadcast LFS, there is an alternative way of broadcasting LFS by using P2P streaming software. Check out the attached P2P guide for details.

Broadcasting LFS

This is how we (the iCON team) broadcast races on LFS on the internet. (The iTCC Channel - http://www.mogulus.com/itcc OR http://www.iconracing.co.uk/itcctv.htm

It uses http://www.mogulus.com as the service to which the audio/video stream is uploaded.

For a large section of this guide I have borrowed information from a broadcasting guide at the WoW forums - http://forums.worldofwarcraft. ... icId=7015142416&sid=1


Things you will need:

A reasonably powerful PC!
Flash Media Encoder - http://www.adobe.com/go/fme25
VH Screen Capture Driver - http://www.hmelyoff.com/index.php?section=9
An account at http://www.mogulus.com
Live for Speed

There are several parts to broadcasting a LFS race. These are:

1) Finding a streaming service
2) Capturing the video output (from the Game)
3) Capturing the audio output (from the Game and your commentator)
4) Encoding the audio/video and upstreaming it
5) Broadcasting!

That’s it in a nutshell, quite straightforward but I’ve had a few questions now on how to do this so I thought I’d write this to show you how I go about broadcasting.

Finding a streaming service

In my case, I tried two different services before settling on the second of the two. The service that I use is called Mogulus and is available at http://www.mogulus.com

So firstly we need to make an account at Mogulus. Go to the site and make an account name, password and so on. When you have done this, make a note of your channel name, username, and your password. We will need these later.

You will have a URL now called http://www.mogulus.com/<yourchannelname>

Capturing the video output

Now we need to capture what is happening in LFS.

I should say that to get the best broadcasts out of LFS, you should really consider using LFS TV Director by Soeren Scharf, it’s a fantastic tool that’s very easy to use, very informative and makes the actual broadcast look so much better. Find it here - http://www.lfsforum.net/showthread.php?t=14147

I’m not going to go into how to use or setup LFS TV Director as it is very well documented and discussed already in that thread. In addition the Director software has a VERY comprehensive guide on how to use it.

Download and install the VH Screen Capture Driver. When this is installed, go to Start> All Programs> Hmelyoff Labs> VH Capture> Config. This is the configuration panel for the VH Screen Capture Driver.

Click on "create new" and you will open the screen capture driver GUI.

The first tab is the ‘Capture’ Tab

Capture

You are going to configure which part of the screen should be recorded. You can either record the whole screen (Track Screen) or just a part of it (Track window and select the name of the window out of the list). Or you can define a certain area of your screen (with, height, left, right).



"Track window" - Choose this option to record a certain window. After you activated this option you can choose the name of the window out of a list. Even another window will be in front of this window, it will be recorded. But if you minimize the recorded window, it doesnt work anymore.

NOTE: I have noticed the VH Screen Capture Driver will sometimes crash when you select ‘Track Window’. If this happens, then use the Task Manager (CTRL-ALT-DEL) to close the process. Then start the program up again. If there is already something in the dialogue box then select that and press continue, otherwise 'Create New'.

"Track screen" - Choose this option if you want to record the whole monitor, whatever is visible.

"Show frame" - Show a red frame of the area that is beeing recorded.

"Region" - After clicking on this button you can define an area which will be recorded. This puts in the values for "Left, Top, Width, Height".

"Window selection tool (aim)" - If you click on it, hold your mousebutton and move it over a window you can choose it. Usefull if you dont know the name or if you just want to select a sub-part of a window.

I am using "Region" to stream Live for Speed. I only stream a part of my window. This is because the VH Screen Capture Driver won’t capture LFS when it’s full-screen (not on my PC anyway). So I use a box of about 800x600, using the Region option.

Settings



Configure the settings as per the picture above. Make sure in particular that ‘Optimize screen capture’ is unchecked, as leaving this checked slows the capture framerate a lot!

Capturing the audio output

Now we’re going to capture the audio output from the game. The way we’ll do it will capture any audio that is heard at your speakers, i.e. game audio, audio from TeamSpeak/Ventrilo, etc.

What you need to enable is ‘Stereo Mix’.

To do this in XP, go to Control Panel > Sounds and Audio Devices. Click on the ‘Volume’ tab, then click on ‘Advanced’ in the ‘Device Volume’ box. This brings up the Master Volume box.

Click on Options, and then Properties. Click on the ‘Recording’ button, then scroll down till you see the ‘Stereo Mix’ box. Check it, then click on OK.

You now have the ‘Recording Control’ box. You will notice there is a volume slider for Stereo Mix, check the ‘Select’ box and then close the recording control box.

To do this in Vista, go to Control Panel > Sound. Click on the Recording tab, then in an empty space below the displayed devices, right-click and select ‘Show Disabled Devices’. Stereo Mix will appear – now right-click on it and select ‘Enable’. You may need to double click on Stereo Mix then and turn up the volume. Then click on OK as many times as is needed to return to the desktop.

Encoding the audio/video and upstreaming it

To actually get our audio/video onto the web, we have to encode it so Mogulus can then stream it onto the internet. To do this we’re going to use Flash Media Encoder. There’s a good guide to using FME with Mogulus at http://www.mogulus.com/usergui ... am_from_different_sources

Make sure when entering the FMS URL that you remove the brackets!!!! I can’t stress that one enough 

For the configuration of FME I use the following settings:

1) Make sure the video and audio checkboxes are checked
2) Video device should be VH Scrap, Audio device should be Stereo Mix
3) Size is the size of your LFS window (800x600 for me)
4) Bitrate for me is 200 Kbps Video, 20 Kbps Audio
5) Format for audio is MP3 Mono, 11 Kbps for basic or 22 Kbps for better Audio.

If you want to start ‘auto’ - broadcasting with Mogulus as soon as you press Start in FME, then set the True/False switch in the FMS URL to True. If you want to select the stream to start broadcasting at the time you want (as controlled by you in the Mogulus GUI) then set the switch to False.

When you’ve entered the FMS URL and configured the FME settings, click on Connect and then click on the green Start button.

That’s it for Flash Media Encoder! You’re almost there.

Broadcasting

If you set the switch to True in the last section, you’re already broadcasting! Go check it out at http://www.mogulus.com/yourchannelname

If you set it to false, then log in to http://www.mogulus.com/studio, click on the ‘Produce Existing Channel’, and enter your username, password, and channel name. Once you’ve logged in, click on the ‘Broadcast Live’ Tab and then select the FME stream from the ‘Cameras’ tab on the left of the screen. Cue it and transition to cue to start broadcasting the stream!

Conclusion

That’s it! I’m not saying that this solution to broadcasting is LFS is best, I’ve definitely seen better solutions. However, this is very cheap – in fact it’s free, and for most purposes is more than adequate.

I hope you have fun broadcasting LFS!

Cheers

Joe Keaveney
Attached files
P2P Broadcasting.doc - 34 KB - 967 views
#2 - J@tko


Sticky please.
Very useful! thanks!
+1 This is quite interesting

Yeah...This thread must be sticky in my opinion
Great guide, really helpfull.

+1 for sticky.
need linux equivalent.
Or just use Xfire, simple
+1 Joe_Keaveney, nice guide, very helpfull!!
next month will have a tourney(D1), will start broadcasting it =]
I watched some of the last iTCC races and was really happy to see you guys were using mogulus. My attention was drawn to your league because it was the first I'd seen done with mogulus for live sim racing events. I had done some experimenting with mogulus for streaming live LFS video. I was even more surprised to see you used the exact same software and method I had tried after doing some research. While you say there are better solutions, I haven't seen any that really work as good as this setup. Maybe if you could buy hulu space, but I bet that is really high dollar. I see so often the low fps and major video lag/spikes/ect of most video streaming for race leagues. It is nice to see community members making the most out of what is available for public use.

Good Job!

One more thing. Have you ever tried to tried to broadcast by playing a mpr file as it is being written?

Jay Odom
Quote from jbirdaspec :I watched some of the last iTCC races and was really happy to see you guys were using mogulus. My attention was drawn to your league because it was the first I'd seen done with mogulus for live sim racing events. I had done some experimenting with mogulus for streaming live LFS video. I was even more surprised to see you used the exact same software and method I had tried after doing some research. While you say there are better solutions, I haven't seen any that really work as good as this setup. Maybe if you could buy hulu space, but I bet that is really high dollar. I see so often the low fps and major video lag/spikes/ect of most video streaming for race leagues. It is nice to see community members making the most out of what is available for public use.

Good Job!

One more thing. Have you ever tried to tried to broadcast by playing a mpr file as it is being written?

Jay Odom

Hi Jay! And thanks for the kind word re: the iTCC broadcasts.

Just a quick word with regards to your question - no, we've never tried to do that, I do remember reading a thread somewhere about this a while ago, so I'll go look it up. If you have any info about this, could you PM me it so I can investigate and try to work out a solution?

Nice that you came up with the same solution! Right now, Flash Media Encoder 3 has recenetly become available for download - I'm testing it currently and will update the guide when I find out how to improve the broadcast quality using it.

Cheers!
A (reasonably buggy?) attempt at MPR streaming has been tried, it's had a few problems.

It can't do commentary, there isn't an autodirector (it's choose-your-own-picture), and there's issues about skin abuse and similar.
Quote from duke_toaster :A (reasonably buggy?) attempt at MPR streaming has been tried, it's had a few problems.

It can't do commentary, there isn't an autodirector (it's choose-your-own-picture), and there's issues about skin abuse and similar.

Why can't you use the TV director?
Quote from duke_toaster :A (reasonably buggy?) attempt at MPR streaming has been tried, it's had a few problems.

It can't do commentary, there isn't an autodirector (it's choose-your-own-picture), and there's issues about skin abuse and similar.

What I was referring to wasn't a multiplayer stream, but rather a way to start a mpr file on the computer doing the source broadcast signal.

Basically what you do is the person commenting starts the mpr as it is being made by another instance of LFS. So two instances of LFS are needed. One is receiving the live data from the server and the other is reading the first one's mpr as it is being written. So there is a delay, of 15-20 second minimum. In order to make the commentary sync the commentator comments to the second instance that is playing the MPR.

The result is a much smoother broadcast picture. This is because LFS knows what the cars are going to do before they do it because the mpr was created 15-20 seconds in the past. LFS can interpolate the action and all is much smoother. TV director is compatible with a multiplayer replay. I have tried it, live and just running a random replay file.

There is a hitch though. Once you start an 'live' mpr file, if the race restarts so will the mpr, with the next race. About a few minutes in it will stop again for no reason. However, in a live race you should have no reason to restart the race.

I believe there are insim packets that can control replay files as well. I don't remember exactly, but I think there is a way to start a mpr at a certain time using insim. If that is true... instant replay technology is possible with the right programmer at the wheel. That would be the shizzzz.

As far as I know this hasn't been attempted live before (reading a live MPR file). I ran the idea across Becky Rose a month back and she said she had suggested it to someone else before so this isn't a new idea, it just hasn't been attempted yet...that i know of. I also mentioned it to MP3_astra as well.

Jay Odom

insim packet info i searched for insim.txt file.

// UVal: Time(hundredths of a second since start of race or replay)

/ REPLAY CONTROL
// ==============

// You can load a replay or set the position in a replay with an IS_RIP packet.
// Replay positions and lengths are specified in hundredths of a second.
// LFS will reply with another IS_RIP packet when the request is completed.

struct IS_RIP // Replay Information Packet
{
byte Size; // 80
byte Type; // ISP_RIP
byte ReqI; // request : non-zero / reply : same value returned
byte Error; // 0 or 1 = OK / other values are listed below

byte MPR; // 0 = SPR / 1 = MPR
byte Paused; // request : pause on arrival / reply : paused state
byte Options; // various options - see below
byte Sp3;

unsigned CTime; // (hundredths) request : destination / reply : position
unsigned TTime; // (hundredths) request : zero / reply : replay length

char RName[64]; // zero or replay name - last byte must be zero
};

I think there are other controls too. Look through the file.
....Or you could go download Xfire, setup LFS in the Games tab, enable broadcast then actually go live. No need to do all this work for something so simple
Quote from Yelpats03 :....Or you could go download Xfire, setup LFS in the Games tab, enable broadcast then actually go live. No need to do all this work for something so simple

:rolleyes:
:faint2:
The reason I wrote this guide is that having received several messages regarding broadcasting games, I thought it was necessary.

The reason I don't use XFire, but Mogulus instead, is one of how useful Mogulus is to someone who organises and broadcasts a league.

Mogulus not only offers us a way of broadcasting to many users, but also automatically records the races we run so that they can be made available on-demand for later viewing. Added to that, we can embed the Mogulus Player into our website. As well as using the software inside the 'Studio' to add titles, scrolling messages, and all sorts of fancy stuff.

Xfire by comparison is great for what it is but for my purposes, and for those like me who run leagues and want to broadcast them, it is limited in its use.
Bumpage.

Flash media encoder doesn't need it's gui to run, it can be done from the command prompt as well. I don't know how much more efficient it is, but I guess it takes a few powers to run the gui.

To run the fme get your command prompt (windows-key+r, type cmd, press enter), navigate to your flash media encoder installation folder (type in 'cd c:\program files\adobe\flash media encoder 0.5' where 0.5 is the version number of your fme installation, c is the disk partition your fme installation is in. By default it is c. When navigating in the command prompt you get the file listing by typing 'dir', you move to the parent directory by 'cd ..' (yes, you can leave the space out between cd and .. in windows, in *nix-systems you cannot and that's where Bill Gates nicked the command.) and move to a folder by typing 'cd folder') and start the encoding by typing 'FMEcmd'

You can add parameters the fmecmd command:
FMEcmd [/p [path\]profile.xml] [/l [path\]log_file] [/ap userIDassword] [/ab userIDassword] [/t dd:hh:mm] [/r]

/p
(Optional) Specifies the path and filename of an XML profile to use. If you do not use this parameter, Flash Media Encoder uses the default profile, startup.xml.

/l
(Optional) Specifies the path and filename of an encoding log file. The settings in the log file override the settings specified in the currently loaded profile.

/ap
(Required if the primary server requires authentication) Specifies an authenticating user ID and password for the primary server. Because the password is shown in plain text, take care when entering your password.

/ab
(Required if the backup server requires authentication) Specifies an authenticating user ID and password for the backup server. Because the password is shown in plain text, take care when entering your password.

/t
(Optional) Instructs Flash Media Encoder to restart after the specified time interval.

/r
(Optional) Registers the encoding session to restart at an operating system relaunch after a system closure or crash.

To stop encoding it is a little more difficult. The easy way out is to close the cmd window, but if you do that you do not have a proper recording of your encoded video. Instead you end up with a recording that has not been indexed, so you can not fast forward/rewind it.

If you wish to have a proper recording to be saved on your hard disk as well, you must stop the encoding session by typing in another command. Note that this does not work if you do not use the traditional stream-id, which would be in the format of rtmp://myserver.com/live+livestream where livestream is the name of your live encoding session. THIS is the case if you use the mogulus broadcasting system! So with mogulus you can not get a proper recording on your hard drive, but you have to record it with the mogulus system.

To show a list of encoding sessions that were started from the command line type 'FMEcmd /s'
To stop an encoding session that was started from the command line type 'FMEcmd /s fme_UID', for example 'FMEcmd /s rtmp://fms.myserver.com/live+livestream'

When the session is being saved to file but is not streaming to a server, use the filepath and filename for fme_UID. For example:

FMEcmd /s "C:\Documents and Settings\abc\My Documents\My Videos\sample.flv"
Thanks Timo!

I'm gonna try this as the next round of the iTCC, as I need all the CPU power I can get as I also FRAPs the races, which really works the system hard.

I guess there's nothing to stop me putting the 'FMEcmd command' with its parameters into a batch file so it's just a one-click thing then?
Quote from Joe_Keaveney :
I guess there's nothing to stop me putting the 'FMEcmd command' with its parameters into a batch file so it's just a one-click thing then?

If I had thought of that myself I'd have saved a lot of trouble when probing this...
Great guide! But I have a problem. The Adobe Flash Media Encoder 2.5 doesnt find the VH screen capture. When I'm chosing a video device, there is nothing to chose from. What can I have done wrong?

Edit: Tried Adobe Flash Media Encoder 3.0 instead, and its working perfectly now
Mogulus now has desktop broadcasting software! I'm just about to install it and I'll see exactly what it can do...

(Ok, can't use until I get home)

http://www.procaster.com/
-
(hyntty) DELETED by hyntty
1

Guide : Broadcasting LFS
(43 posts, started )
FGED GREDG RDFGDR GSFDG