Most Popular Articles
Capturing and Encoding on the Cheap
Many years ago, when a station wanted to capture four, one-hour blocks of audio each day, it involved writing scripts that would interact with the GUI of the audio encoding tool (send an ALT-F to the encoder window, send the filename, send the down arrow four times). There would be problems with it, but for the most part, it worked for capturing the content. Each day the captured files would be edited by hand, manually up-loaded and then the HTML pages would be updated to show links to the new files.
I got tired of doing things manually and started looking for a better way. I left the capture program the way it was, and I wrote scripts to allow other people to edit the files automatically (the times were nearly always the same), and taught them how to upload them as well. I even created a CGI that wrote to an included HTML file, so that others could post the links to the Realmedia files without my interaction, simply by submitting a form from a browser. It still required manual labor, but it wasn't my labor, so I didn't mind nearly as much.
As time went by, some people began to mind, and I began exploring ways to automate more of the process. The script to interact with the encoder GUI was replaced with a command-line program, so there were fewer chances for something to go wrong. Because the files always needed the same amount of time removed from their beginning, I automated that as well. Then the files would be sent automatically via FTP to the server, and the links would be displayed only if the file existed. Completely automatic, but all done in a proprietary automation program.
Real Systems Real Producer has a command-line program called rmbatch, which can be set up to schedule encoding tasks.
Nowadays most of these tasks are fulfilled by the programs themselves, so users don't need to write a lot of custom code. It's almost as easy as point, click and leave.
Timing is everything
The single most important piece in this puzzle is the time source. Computer clocks are notoriously inaccurate, and this process requires capturing content from an accurate fixed schedule. If possible, use the same time source as the rest of the station, perhaps from the automation system or from a satellite feed or GPS clock. If those options aren't available, download one of the many programs designed to keep the computer's clock accurate from time sources like NIST, the Naval Observatory or Abouttime from Arachnoid.com. There are dozens of these programs available. Whichever you choose, install it, configure it to set the clock at least once an hour, and make sure it starts automatically when the computer is restarted. This will produce an accurate timebase to start from.
File-transfer programs can also be set up to automate file transfers, ensuring that the most recent file is always posted.
Schedule it: Nearly all operating systems now have a built-in scheduling program. Windows 98 offers Task Scheduler; Windows NT provides the AT command; Linux variants offer Cron; and Windows ME, XP and 2000 all have similar schedulers. If you are already familiar with it, you can even find a version of Cron for use on Windows.
Encode it: Real Systems Real Producer has built-in, command-line encoding with a program called rmbatch, so it's a natural choice for scheduled encoding (from a pre-existing file, or from a live source). After reading the manual and determining which settings to use (the user controls all of them, including bit rate, audio and video codecs, duration, filename, title, capture to a file and stream live to a server), simply create a scheduled task to run at the specified time. Check the documentation for the actual parameters, but for live encoding, it's something along the lines of this:
RMBatch.exe /L /O C:\foo.rm /T 0,1 /A 0 /V 0 /F 1 /B “My Clip”
Just set up a task with the scheduler and it is finished.
Edit it: Most task schedulers can only launch a program at the beginning of a minute, but odds are the content the user wants to encode starts 30 seconds after the minute. Simply encode more than is needed, and trim it later. Realproducer uses rmeditor, a command-line editor for encoded files. Add a second scheduled task, and remove the first 30 seconds of extraneous content. Again, check the documentation, but here's a quick usage guide:
rmeditor -i <input> -o <output> [-t <title>] [-a <author>] [-c <copyright>]
[-C <comment>] [-r <allow recording>] [-k <allow download>]
[-s <start time>] [-e <end time>] [-l <log file>] [-d <dump file>]
[-q <description>] [-n <keywords>] [-IN <allowing indexing>] [-AR <audience rating>]
Removing trailing content should be just as simple.
Upload it: Yes, you could spend a lot of time creating a scheduled task to upload the encoded content to the appropriate server. Or, write a command-line batch file to FTP the file and schedule it to run at the correct day and time using the operating system's built-in scheduler. It would work fine. Instead, save a lot of trouble and use an FTP program with its own scheduling function, such as WS_FTP Pro. A few easy clicks and the file is set up to be transferred without writing a single line of code.
Post it: There are many ways to display a link to the file on the station's Web page. One way is to always use the same file name for the encoded content, so the link is already on the page and the file just changes when it gets uploaded. A second way is to set up an additional scheduled FTP for the new HTML page, and have it upload after the encoded file has been uploaded. Yet another way is to use PHP, Perl or a similar language, and check for the existence of the encoded file on the server. If it exists, display the link in the page. Otherwise, it can display something else.
Apply these same principles to a system using Windows Media Encoder with one small change: the command-line encoding utility for Windows Media Encoder does not allow input to be from a live source. The user will have to capture the content to a .wav or .avi first by using some other command-line capture utility, and then run that file through the batch job Windows Media Encoder. The user will have to download the Windows Media 8 Encoding Utility (search the Microsoft website for wm8eutil) to get command-line ability for batch encoding, which will read something like this:
wm8eutil -input clip.avi -output clip.wmv
Serve it: There isn't much to discuss on this topic because once the encoded files are uploaded, and links have been posted to them on the website, it is automated about as much as it can be. But recent developments in server technology ask to be touched on here.
Real Networks (www.realnetworks.com) has just released its new Helix Universal Server, which has the ability to stream nearly any file format: Real Audio (.rm), Real Video (.rm, .rmvb), Real Pix (.rp), Real Text (.rt), Macromedia Flash (.swf), Windows Media (.asf, .wma, .wmv), Quicktime (.mov), MPEG-1, MPEG-2, MPEG-4, MP3 and others with the addition of plug-ins. This means there can be a Real Networks and a Windows Media stream without the need for two separate streaming servers.
The drawback of this single-server system is that Real Server licenses will now cover Windows Media streams as well. The user now has to pay for concurrent streams of Windows Media, something that previously wasn't a concern. With a stand-alone Windows Media server, there can be as many streams as desired, all license-free and cost free.
This is just the basis of a system with much more potential. For example, with these tools someone has to set up four scheduled tasks each time he wanted to encode, upload and post anything — fine for a one-time broadcast, but not ideal for a show that airs Monday through Friday. Write simple scripts to automatically name the encoded file for the date and time it gets encoded, and not have to set up a scheduled task for each encoded file. I have one setup that encodes 24 one-hour files each day, and makes a month's worth of audio available online, all with one scheduled task.
Most encoding software packages provide utilities to automate some functions.
If there is something that simply cannot be scheduled because it doesn't have a built-in scheduler, and there is no command-line version of the program, there are a couple of programs designed to interact with just about anything else on a machine.
Winbatch from Wilson Windowware (www.winbatch.com) is an interpreter-based language that can be used to automate nearly any Windows task. It has extenders for the language to let you interact with network servers (Microsoft or Netware), ODBC databases, printers, serial and parallel ports. Winbatch makes it a snap to name files based on date and time of encoding.
Automize from Hitek Software (www.hiteksoftware.com) is a cross-platform automation package written primarily in Java, so it can be used on Windows machines, Macs and even Linux machines with a GUI. It should also be able to automate most redundant tasks.
No matter what route the station chooses, be sure to write down what is and what is not automated. Six months later, when there is a problem, it's nice to have notes about what is supposed to be happening before you try to fix it.
Harrison is senior applications developer for Toad.net, an Internet service provider in Severna Park, MD.
Acceptable Use Policy blog comments powered by Disqus
[an error occurred while processing this directive]
Today in Radio History
The history of radio broadcasting extends beyond the work of a few famous inventors.
EAS Information More on EAS
The feed provides feeds for all US states and territories.
Need a calendar for your computer desktop? Use one of ours.
Information from manufacturers and associations about industry news, products, technology and business announcements.
Cumulus builds a new campus in Nashville to house its NASH family of brands
Browse Back Issues[an error occurred while processing this directive]
Also in the October Issue
- Trends in Technology: Alternate Transmitter Sites
- Tell City Waiver Denied
- 2014 Radio magazine Salary Survey
- Field Report: Steinberg UR44
- Repurposing Older Equipment