<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Carl Sziebert &#187; Flash Media Server</title>
	<atom:link href="http://sziebert.net/posts/category/fms/feed/" rel="self" type="application/rss+xml" />
	<link>http://sziebert.net</link>
	<description>is a software engineer with an interest in Spring, Hibernate, Red5 and jQuery development.</description>
	<lastBuildDate>Thu, 29 Jul 2010 20:25:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Jedai Framework for Red5</title>
		<link>http://sziebert.net/posts/jedai-framework-for-red5/</link>
		<comments>http://sziebert.net/posts/jedai-framework-for-red5/#comments</comments>
		<pubDate>Sat, 03 May 2008 23:00:43 +0000</pubDate>
		<dc:creator>Carl Sziebert</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash Media Server]]></category>
		<category><![CDATA[Red5]]></category>
		<category><![CDATA[jedai]]></category>

		<guid isPermaLink="false">http://sziebert.net/?p=12</guid>
		<description><![CDATA[<p>As the Red5 media server continues to mature, new and exciting additions are announced with greater frequency.  Once such addition to Red5 is the Jedai project.  Anyone familiar with Flash Media Server knows that it provides a solid component library for rapid development of collaborative media applications.  With the introduction of the Jedai project, Red5 is no longer lacking in the area.<!--more-->  </p>
<p>The project consists of two main parts, the Jedia Networking Framework (JNF) and the Jedai Collaboration Suite (JCS).  The Networking Framework delivers a development stack that &#8220;builds upon the services that most real-time applications need&#8221; such as user, stream and data management.  The Collaboration Suite is a set of reusable components providing services such as authentication, text chat and video publishing and is designed to be used directly with the JNF.  Leveraging these two pieces gives Red5 application developers a great deal of power and flexibility with a minimum of effort.  </p>
<p>From the project developers themselves: &#8220;We have seen the need for this framework for quite some time, and here is our answer. Please, feel free to try it out and watch as it becomes a standard in real-time application development with Red5 and Flash.&#8221;  </p>
<p>Check it out here: <a href="http://code.google.com/p/jedai/">http://code.google.com/p/jedai/</a></p>
]]></description>
		<wfw:commentRss>http://sziebert.net/posts/jedai-framework-for-red5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Server-side stream recording with Red5</title>
		<link>http://sziebert.net/posts/server-side-stream-recording-with-red5/</link>
		<comments>http://sziebert.net/posts/server-side-stream-recording-with-red5/#comments</comments>
		<pubDate>Wed, 05 Sep 2007 02:48:25 +0000</pubDate>
		<dc:creator>Carl Sziebert</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash Media Server]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Red5]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://sziebert.net/posts/server-side-stream-recording-with-red5/</guid>
		<description><![CDATA[<p><strong>This tutorial has been updated. Please check out the <a href="http://sziebert.net/posts/server-side-stream-recording-updated/">new post</a>.</strong</p>
<p>While most developers are content to record video using the <tt>NetStream.publish(&#8220;streamName&#8221;, &#8220;record&#8221;)</tt> API, it is sometimes useful to take FLV snippets from the publishing stream instead.  In my opinion, this is one of the greatest features of Flash Media Server (FMS) and Red5.  Utilizing this strategy allows the application developer to precisely control when and how much of the video is recorded.  While recording via the <tt>NetStream</tt> function has been available in Red5 since the beginning, recording video from the server-side application has not.  In this post, I'll demonstrate Red5's ability to record an FLV with a very simple pair of publish and subscribe flash applications.<!--more--> </p>
<p>I'll jump right in by creating a simple ApplicationAdapter subclass.  This step isn't really necessary, however I feel that it is good practice when creating Red5 applications.  As your application grows in functionality, you'll have the most essential building block ready to go. </p>
<p><strong>Application.java</strong></p>
<pre class="brush: java;">
public class Application extends ApplicationAdapter {

	...

	/**
	 * Delegate method used to accept/reject incoming connection requests.
	 *
	 * @param conn
	 * @param params
	 * @return true/false
	 */
	@Override
	public boolean roomConnect(IConnection conn, Object[] params) {
		log.debug(&quot;New connection attempt from &quot; + conn.getRemoteAddress() + &quot;...&quot;);
		// Insure that the listeners are properly attached.
		return super.roomConnect(conn, params);
	}

	/**
	 * Delegate method which logs connection/client/user disconnections.
	 *
	 * @param conn
	 */
	@Override
	public void roomDisconnect(IConnection conn) {
		log.debug(&quot;Connection closed by &quot; + conn.getRemoteAddress() + &quot;...&quot;);
		// Call the super class to insure that all listeners are properly
		// dismissed.
		super.roomDisconnect(conn);
	}
}
</pre>
<p>As you can see, there isn't much to it, just a couple of logging statements to track new connections to the application.  Next, I'll define a simple service bean to handle the <tt>NetConnection</tt> calls to start and stop the stream recordings.</p>
<p><strong>StreamManager.java</strong></p>
<pre class="brush: java;">
public class StreamManager {

	...

	/**
	 * Start recording the publishing stream for the specified
	 * IConnection.
	 *
	 * @param conn
	 */
	public void recordShow(IConnection conn) {
		log.debug(&quot;Recording show for: &quot; + conn.getScope().getContextPath());
		String streamName = String.valueOf(System.currentTimeMillis());
		// Get a reference to the current broadcast stream.
		ClientBroadcastStream stream = (ClientBroadcastStream) app.getBroadcastStream(
				conn.getScope(), &quot;hostStream&quot;);
		try {
			// Save the stream to disk.
			stream.saveAs(streamName, false);
		} catch (Exception e) {
			log.error(&quot;Error while saving stream: &quot; + streamName, e);
		}
	}

	/**
	 * Stops recording the publishing stream for the specified
	 * IConnection.
	 *
	 * @param conn
	 */
	public void stopRecordingShow(IConnection conn) {
		log.debug(&quot;Stop recording show for: &quot; + conn.getScope().getContextPath());
		// Get a reference to the current broadcast stream.
		ClientBroadcastStream stream = (ClientBroadcastStream) app.getBroadcastStream(
				conn.getScope(), &quot;hostStream&quot;);
		// Stop recording.
		stream.stopRecording();
	}

	...
}
</pre>
<p>This is where the meat of the application lies.  The broadcast client starts recording the stream by calling <tt>streamManager.recordShow()</tt> and stops it by calling <tt>streamManager.stopRecordingShow()</tt>.  In the example broadcast application, I've added a button to the Stage and created a simple <tt>onClick</tt> function to invoke the server-side methods.</p>
<p><strong>BroadcastController.as</strong></p>
<pre class="brush: as3;">
        /**
	 * Handle the record button click events.
	 */
	private function onClick(ev:Object):Void {
		// Record the stream by triggering a server event.
		if (ev.target.label == &quot;Record&quot;) {
			// Tell the remote server to start recording.
			conn.call(&quot;streamManager.recordShow&quot;, null);
			// Re-label the button.
			button.label = &quot;Stop&quot;;
		// Stop recording the stream.
		} else if (ev.target.label == &quot;Stop&quot;) {
			// Tell the remote server to stop recording.
			conn.call(&quot;streamManager.stopRecordingShow&quot;, null);
			// Re-label the button.
			button.label = &quot;Record&quot;;
		}
	}
</pre>
<p>Take note, the name of the recorded stream differs from that of the publishing stream.  I am using a simple timestamp as a unique name for each new FLV.  It is even possible to reuse an existing FLV and append new video data to it.  Simply change the second argument of the <tt>stream.saveAs()</tt> method call to <tt>true</tt> while reusing the same stream name. Check the streams directory of the recorder application for the output files.  Reviewing the FLVs is as easy as opening them up with an FLV player<a class="sup" href="#wimpy">[1]</a>.   </p>
<p>While this is an interesting bit of functionality, the possibilities are much greater.  Consider, for example, a security application that needs to record video when the camera detects movement and also needs to have a unique file for each incident. With some minor tweaks to this example, you've got exactly that.  In addition, it would be quite easy to extend this application to extract a JPEG preview snapshot from each FLV using FFMPEG<a class="sup" href="#ffmpeg">[2]</a>.</p>
<p>The example source code for this post can be downloaded <a href="http://garagetech.googlecode.com/files/Recorder.zip">here</a>.</p>
<p>1. <a name="wimpy" href="http://www.wimpyplayer.com/products/wimpy_standalone_flv_player.html">http://www.wimpyplayer.com</a> Wimpy Desktop FLV Player is a free cross platform (Mac and PC) standalone Flash Video FLV player for you, which will allow you to watch your FLV and SWF videos from your desktop.  Check it out.</p>
<p>2. <a name="ffmpeg" href="http://www.ffmpeg.org/">http://www.ffmpeg.org/</a> FFmpeg is a complete solution to record, convert and stream audio and video. It includes libavcodec, the leading audio/video codec library. FFmpeg is developed under Linux, but it can compiled under most operating systems, including Windows.</p>
]]></description>
		<wfw:commentRss>http://sziebert.net/posts/server-side-stream-recording-with-red5/feed/</wfw:commentRss>
		<slash:comments>66</slash:comments>
		</item>
		<item>
		<title>Server-side ActionScript plugin for Eclipse</title>
		<link>http://sziebert.net/posts/server-side-actionscript-plugin-for-eclipse/</link>
		<comments>http://sziebert.net/posts/server-side-actionscript-plugin-for-eclipse/#comments</comments>
		<pubDate>Fri, 24 Aug 2007 17:26:41 +0000</pubDate>
		<dc:creator>Carl Sziebert</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Flash Media Server]]></category>
		<category><![CDATA[SSAS]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://sziebert.net/posts/server-side-actionscript-plugin-for-eclipse/</guid>
		<description><![CDATA[<p>Server-side ActionScript (SSAS) has long been the bastard child of the ActionScript permutations.  There are a number of editors that offer syntax highlighting and in the case of the Flash development tool, the bare minimum of auto-completion features for SSAS.  That is until now.<!--more--> FCZone has put together an excellent plugin for the Eclipse platform that makes editing SSAS a joy.  They are even porting it to the Mac and other *nix operating systems for those of us that prefer not to work on Windows.</p>
<p><span style="text-decoration: line-through;">Grab the plugin here: </span><a href="http://fczone.com/eclipse/"><span style="text-decoration: line-through;">http://fczone.com/eclipse/</span></a></p>
<p>Seems as though the original link is no longer valid. Fret not for <a href="http://www.igorcosta.org/?p=151">Igor Costa</a> has created a mirror: <a href="http://www.igorcosta.org/downloads/fmseditor_eclipseplugin.zip">http:​/​/​www.igorcosta.org/​downloads/​fmseditor_eclipseplugin.zip</a></p>
]]></description>
		<wfw:commentRss>http://sziebert.net/posts/server-side-actionscript-plugin-for-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
