How to broadcast live video from your temple

by Manu Dasa - Krishna.com IT Department
Version 1. Revision 3
Date: September 8, 2009
Revised: February 24, 2011

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. There are countless possibilities.

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.) We specifically used inexpensive options to show that anyone can broadcast live video these days. You don't need fancy gear.

Software

We used free software. Adobe Flash Media Live Encoder

Free hosting: In our original tests in 2009 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. As of the revision of this tutorial in 2011, Ustream.tv has become more popular and meanwhile also allows direct connection via Adobe Flash Media Live Encoder. So I'd gravitate towards recommending the more popular Ustream.tv at this time.

NOTE: If your live stream is from an ISKCON temple, or is all about Krishna or a related topic, contact us. We may decide to feature your live video stream on Krishna.com, in which case we can set you up with a free streaming account on Krishna.com's Flash Streaming Server. We will give you code that you can embed in your own website as well. The advantage is that you will have an ad-free stream (no advertising from Ustream.tv inserted into your video), and you'll have exposure to an audience of thousands of seekers who want to know more about Krishna.

What about other live streaming services, such as Ustream.tv, Livestream.com, Stickam.com? You can use whichever popular service appeals to you. We have been seeing a lot of temples use Ustream.tv lately, to broadcast live kirtan events, festivals, etc. If automating the start and stop times of your live webcast is a valuable feature for you, then choose a service that will allow you to use Adobe Flash Media Live Encoder (FMLE) as your encoding software to connect to their service (and not be tied to having an open web browser window and pressing their browser-based "Start Broadcast" button, for example.) As of this revision, Justin.tv and Ustream.tv allow this. Not sure about the others. FMLE can be scripted to automate your start and stop times. This works great if you want to automate the broadcast of your temple's morning and evening programs, Sunday Feast, etc.

Results

Back in September of 2009 in our original tests, 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 kilobits 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 be broadcasting business-card size video (320x240 pixels) for the next few years in order to reach the widest possible audience. (This still applies at the time of this revision, February 2011).

We specifically tested using cheap, easily available components to show that it doesn't have to cost you a lot 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 a chat room.

Step-by-step How-to Tutorial

Prerequisites: USB webcam, computer, broadband Internet (DSL or fiberoptic cable). Please note: At the time of our original tests, we were using Justin.tv. The below instructions are specific to Justin.tv at that time (2009). They may have changed. Use this as a guide for setting up a similar service with Ustream.tv. (If you'd like to help us update this tutorial, send us the below instructions as they would apply to settings on a recent Ustream.tv account.)

  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've got to pay more money to the phone company :-)

Why can't I broadcast full screen video in HD quality?

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 rent digital broadcast networks costing thousands of dollars a month. They're not using the public Internet as their distribution medium for live shows yet. (Pre-recorded video is possible, with longer download times.) The Internet is not yet capable of transmitting large (full-screen) video streams live on a large scale for thousands of simultaneous viewers.

Be prepared to settle for 320x240 quarter VGA screen size, or some HD ratio such as 400x226, 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 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 an analogy to explain.

Think of your live streaming 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. The smallest pipes in the network are the bottle-necks that hold up your stream and prevent 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 along the way. Your live video stream has to travel from hop to hop, from one major network distribution center to another, sometimes traversing 20 or 30 such "hops" across the planet before it finally gets to the local Internet Service Provider of your end viewer. At each point along the way, there can be congestion during peak usage times.

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

150 - 200 kilobit per second sustained live transfer rate was the result of our tests at Krishna.com in September of 2009. You may expect slightly higher successful rates at the time of this revision, February 2011. Somehwere in the range of 250 - 350 kbps. Any more and many of your viewers will complain that they can't watch the live show, that 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...

Any of the popular live streaming services that allow you to use Adobe Flash Media Live Encoder directly will be useful here. You can script FMLE to automatically start and stop the broadcast based on time of day, day of the week, etc.

NOTE: If you're an ISKCON temple, or if your live stream is all about Krishna or a related topic, talk to us about hosting your stream directly on Krishna.com. If we decide to host you, there are benefits: No annoying ads over the top of your live video stream. We'll give you embed code for your own website, and you can fully automate the live webcast when you stream to Krishna.com's Flash Streaming Server.

Here's how to automate Flash Media Live Encoder (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.

Live Video from SONY SNC Network Cameras

White paper - Version 1, revision 2
by Manu dasa, Krishna.com IT department
Date: September 8, 2009. Revised February 24, 2011

At this time there are several ways to get streaming video from the SONY SNC cameras for upload to a streaming server (such as Krishna.com's Adobe Flash Streaming Server.)

  1. IPcamSourceVideo filter developed by Unreal Streaming technologies.

    http://www.umediaserver.net/umediaserver/download.html

    Cost: $150

    Grabs image frames from any IP camera and turns them into Microsoft DirectShow video which is recognized in the same way as plugging a USB webcam into your computer. For example, Flash Media Encoder will allow you to select the IPcamSourceVideo filter as a video source, and show the live streaming video from your SONY SNC camera.

    Pros: The filter works as a system process in the background and doesn't require to be started in the same way as an application / program. Facilitates full automation of Flash Media Encoder live video streams via Windows Scheduler action scripts.

    Cons: Limited customization options. You can adjust frame rate, and that's about it. If you are using the SONY SNC for live still images at VGA resolution (640x480), then IPcamSourceVideo filter will grab images at that resolution and send VGA size video to Flash Media Encoder. If you change the size of your default SONY SNC camera image sizes to quarter screen VGA resolution ideal for streaming live video (320x240), then your live still images from the camera will also be at that size.

    Rasa Acharya Dasa is using this filter to stream live video from the SONY SNC camera at ISKCON Washington D.C. temple.

    We have experimented with this filter for live video streaming at the ISKCON Alachua temple, but our laptop does not currently have sufficient processing power to run this filter at the same time as live audio webcast on Shoutcast... so we are thinking of setting up the live video stream on a separate computer.

  2. Webcam XP Pro, which includes a IP Camera DirectShow Filter in the license.

    http://www.webcamxp.com/products.aspx

    Cost: $75

    Pros: Lots of customization options. You can overlay "picture in picture" or a logo over the top of your video. It's a fully functional webcam software. Seems to allow capture of video at a smaller screen size without needing to change the default size in the SONY SNC camera, making it easier to simultaneously stream video and capture large, high quality still images from the same camera.

    Cons: Runs as a regular application that has to be started and stopped. You need to start this program and set up the webcam to show in it BEFORE starting Flash Media Encoder.

    As of this revision (Feb. 2011) WebcamXP Pro now, which is now available for Windows 7 and is called Webcam 7 Pro, offers the "directshow" filter as a separate install, allowing you to simplify your broadcast and just use Adobe Flash Media Live Encoder (FMLE) directly with the directshow filter, that turns your IP camera into a virtual USB camera as far as FMLE is concerned.

    If you plan on automating your live video streams, for example to start and stop based on time of day, day of week, etc, you would use only Webcam 7's directshow filter, or the IPcamSourceVideo filter in Option 1, in conjunction with FMLE.

    Rupa Madhurya Dasa is using this program to stream live video from the ISKCON Dallas, Texas, temple.

  3. Several professional video switching programs have come onto the market recently, that support IP cameras and allow you to switch between multiple cameras. On the Mac compatible side, there's Wirecast. On the PC side, Vidblaster. Search for these on Google for more information.

For any questions or comments, or to help us update this tutorial contact us.