How to broadcast live video from your temple

by Manu Dasa - Krishna.com IT Department
Version 1. Revision 1, November 26, 2008

Overview:

Using a simple USB webcam connected to a laptop, along with wireless broadband Internet connection, you can webcast live video from your temple, home program, or gathering. Or maybe you’d like to host your own live show for an hour a week, reading KRSNA Book, or the Bhagavad-gita, or other favorites. The sky’s the limit.

Here’s a quick tutorial to get you started. When you’re up and running, let us know. If we like what you do, we may feature you on Krishna.com

Hardware

In our test we used an affordable consumer webcam (Logitech) bought from an office supply store ($40 - $80), an old used laptop (IBM ThinkPad R51 with Windows XP, $250 on eBay), and a slow DSL connection (entry-level DSL, $25/month.)

Software

We used free software. Adobe Flash Media Live Encoder, requires to create a user account with Adobe.

Free hosting: We used Justin.tv as our media streaming / distribution platform. Requires to set up a user account with Justin.tv. (You can embed your live video stream and chat room into your own web page, so you’re not forced to send all of your viewers to their site.)

What about uStream.tv and Mogulus.com? You can use those popular services as well. However, if automating the start and stop times of your live webcast is a valuable feature for you, then Justin.tv is the way to go. Justin.tv lets you stream directly with Adobe Flash Media Live Encoder, which in turn can be scripted to automate your start and stop times. This works great for temples wishing to automate the broadcast of their morning / evening programs, Sunday Feast, etc.

Results

We were able to stream live video with synchronized audio, 4 frames per second at quarter VGA screen size (320x240), and at 1 frame per second VGA size (640 x 480). Upload bitrate on average was about 150 kilobit per second. Keep in mind that whatever you upload, users will have to download in real-time to view your show. The practical reality for live shows on the Internet is that you’ll probably broadcast business-card size video (320x240 pixels) for the next couple of years to reach the widest possible audience.

We specifically tested using cheap, easily available components to show that it doesn’t have to cost you lots of money to start a live video show, whether it’s broadcasting the morning program from your temple, or the Sunday Feast or another festival, or doing your own weekly Bhagavad-gita reading live on the Internet, with the ability for viewers to interact with you live in the chat room.

Step-by-step How-to Tutorial

Prerequisites: USB webcam, computer, broadband Internet (DSL or cable).

  1. Set up a broadcast account at Justin.tv
  2. Install the webcam software and follow the instructions to get your webcam to work on your computer.
  3. Download and install the free Adobe Flash Media Live Encoder from Adobe.com.
  4. Click on the big red “Broadcast” button at Justin.tv. (You may have to allow a plug-in to be installed by your web browser - do so.)
  5. Click on the “More” tab at the top of the Broadcast Live Video window.
  6. Click on the “Learn More” link at the end of the Flash Media Encoder text.
  7. Download your config file and save it to your desktop.
  8. Open Adobe Flash Media Live Encoder. Under the “File” menu, choose “Open Profile” and select the xml file you just downloaded.
  9. Choose your webcam and mic from the respective drop-down boxes in the Flash Media Live Encoder interface. (More on customizing FMLE in a moment.)
  10. Press the green “Start” button to begin broadcasting. Once the software has connected, you can load your Justin.tv channel page (e.g. http://justin.tv/justin) to check if you are broadcasting.

That’s it. You should be broadcasting live video by now !!!

Right below your broadcast video screen at Justin.tv you should see a “This is you … Share … Popout … Report” grey bar with blue text. Click on “share” to get the embed code to embed the video stream and chat room in your own website.

Optimizing Adobe Flash Media Live Encoder Settings

  1. Open Flash Media Live Encoder.
  2. Via the “File / Open Profile” menu, load the xml profile for your Justin.tv account (see above). You should now see two video screens side by side, with the live image of your webcam displayed. You should see an audio level indicator (vertical string of green “LED” lights) to the left of your video screens.
  3. Adjust the “Encoding Options” settings as follows. (We’ll list them column by column, from left to right.)

    Preset: Custom

    Let’s look at the left column: Video settings.

    Video check box is checked.

    Device: select your webcam source (in my case, it’s Logitech QuickCam…)

    Format: VP6, Bit Rate: 100 Kbps

    Size: 320x240, 8 fps

    Crop (leave at default)

    Resize: (leave at deault)

    Timecode: (leave unchecked), Burn Timecode (leave unchecked)

    Deinterlace (leave unchecked), AutoAdjust (leave checked)

    … Next column: Audio settings.

    Audio checkbox is checked.

    Device: select your audio source (in my case, Logitech Mic…)

    Format: MP3, Mono

    Sample Rate: 22050 Hz

    Bit Rate: 32 kbps

    Volume slider: Adjust as needed. (In my case, 3/4 to the right, on almost full volume for speech transmission. During loud segments you may have to slide the volume level all the way to the left, even cover the webcam microphone with a piece of tape or cloth to make it less sensitive… to prevent distortion for your listeners. The volume level indicators - green LED lights - should never stay at full volume, that is, peaking all the way up for any length of time. They should oscillate in the top range (light green to yellow) during loud segments - clap your hands to test.

    Total Video + Audio Bit Rate: 132 kbps

    And on to the third column.

    Panel Options: Output (Metadata is the other choice, which we don’t need to worry about for now.)

    Stream to Flash Media Server checkbox is checked.

    FMS URL: rtmp://live.justin.tv/app

    Stream: your Justin.tv stream identifier (should already be entered by choosing the Justin.tv xml file you downloaded earlier as the “profile” you opened at the beginning of this tutorial.)

    Save to File checkbox is not checked. You can check this, and change the name of “sample.flv”, if you wish to archive a copy of your live show as a flash video file.

    That’s it, really. Happy streaming.

    If you follow the above settings your total streaming video + audio bit rate should be around 132 kbps (kilobit per second).

  4. Click on the green “Start” button and monitor your actual upload bandwidth in the bottom right corner of the Encoding Log window, which you automatically are taken to once you start broadcasting.

In my case, as I am writing this, I can see that my average upload bandwidth is 128 kbps, and I’m dropping frames and am only able to achieve an average frame rate of 4.8 frames per second. (down from my 8 fps desired setting.)

With this information I can now go back and change my frames-per-second to 5 if I want to, and adjust my video bit rate to something like 90 kbps, for a new total estimated bit rate of 122 kbps (kilobit per second). A classic example of how I’d like to stream at higher frame rate (8 fps) but my upload bandwidth just can’t sustain it. It’s the big bottle-neck in my equation. Lesson learned: If you want faster upload speed, you gotta pay more money to the phone company :-)

Why can’t I broadcast full screen video?

It’s tempting to try and broadcast at the highest possible quality, full screen size, to replicate the quality of live television. Can it be done? Sure. Can you and I afford to do this? Not yet.

TV stations own digital broadcast networks costing thousands of dollars a month to “rent.” They’re not using the Internet as their distribution medium for live shows. (Pre-recorded is possible, with longer download times.) The Internet is not yet capable of transmitting large data streams live on a large scale for tens of thousands of simultaneous viewers.

Be prepared to settle for 320x240 pixel quarter VGA screen size (the size of a business card, or YouTube.com video before pressing the “full screen” option), and about 6 to 8 frames per second. In the future, as the world becomes “wired” and more and more people can afford faster and faster Internet connections, you can expect to increase the quality and screen size of your live broadcasts.

Here’s a short analogy to explain.

Think of your streaming live video like a stream of water from a tap. Think of the Internet as a series of thousands of pipes of various sizes that allow water (data) to flow through them, eventually reaching the home of the viewer of your live video stream. The smallest pipe in the network is the bottle-neck that holds up your stream and prevents it from flowing at its full strength.

Small pipes are a plenty on the world wide web. Three small pipes you will have to contend with are 1) your upload DSL connection speed; 2) the end viewer’s DSL connection speed; 3) Lots of traffic jams - literally - on the Internet…

Overall, in order for live video to be a truly live experience (as opposed to a chopped up, stop-and-go disappointment), we need to adjust our live video faucet to stream at a rate that can be sustained over time (several minutes) without requiring constant pausing by the video player software (waiting to catch up with the video stream.)

150 - 200 kilobit per second sustained live transfer rate is the result of our tests at Krishna.com. Any more and too many of your viewers will complain that they can’t watch the live show, the live video stream keeps stopping on them. You’ll have to keep asking your viewers to refresh / reload their browser windows.

Automating the START and STOP broadcasting based on time of day, day of week…

Finally, the whole reason why we are using Justin.tv in the first place (as opposed to the more popular uStream.tv) is because the kind folks at Justin.tv let us use Flash Media Live Encoder directly to stream our live show, without requiring us to log into an additional proprietary interface. Adobe Flash Media Live Encoder can be scripted to automatically start and stop the broadcast based on time of day, day of the week, etc.

Here’s how to automate FMLE in Windows XP (Vista may be similar - haven’t tried.)

  1. Save your Justin.tv FMLE profile in the same location as your FMLE program (C:/Program Files/Adobe/Flash Media Live Encoder/my_profile.xml)
  2. Using a simple text editor (like Notepad) create a new text file in that same directory, with the “.cmd” extension (you may have to select “All Files” instead of “Text Files” when saving to allow you to use the .cmd extension.)

    The text file should contain the start broadcasting script is as follows:

    FMEcmd /p my_profile.xml

    (Replace “my_profile.xml” with the name of your actual profile xml file.)

  3. Create a second command line script to stop the encoder, with the following text:

    FMEcmd /s rtmp://live.justin.tv/app+live 2345678 3bOnNKG7

    The string of numbers after the /app+ is your Justin.tv stream ID information, same as what you see in Flash Media Live Encoder in the right column, under “Stream:” - Replace the sample above with your actual information.

  4. Using START / All Programs / Accessories / System Tools / Scheduled Tasks, go to “Scheduled Tasks” application on your computer and “Add Scheduled Task” and select the start or stop scripts respectively, to start or stop the broadcast automatically at certain times of the day or week. :-) Simple.

Let me know if you run into any errors or if anything in this tutorial needs to be clarified.

Happy webcasting! If your live video stream or live show is all about Krishna, let us know. We may feature it on Krishna.com.

For questions or comments, contact us.