At A Glance Main Projects Tutorials Resume

Messenger


There currently is no messenger. Manually, you can contact me via:
AIM: TecGumbo

Google Talk: palen1c at gmail.com

Twitter: @Technogumbo



Recording Combined Audio and Video Streams With Flash and Red5 1.0.2 SNAPSHOT or FMS


This was written in September 2013 after examining Red5 1.0.2 SNAPSHOT. The example provided here has not been vetted for production use, but will be a good start for anyone just attempting to do video or audio recording with Flash Media Server or Red5 1.0.2 SNAPSHOT.

This example should be a little more simple than the other article on recording with split netstreams. The other article was put together based on experience with Red5 0.8. This example has been tested with 1.0.2 SNAPSHOT and Flash Media Development Server 4.5. As mentioned, this won't be able to just be thrown into production, but should help provide a basis when starting from scratch.

Problems Observed Up Front

Flash Media Server

I have not observed problems while testing this locally with Flash Media Server 4.5.

Red5 1.0.2 SNAPSHOT

  1. When putting a lot of data over the netstream with very high quality video, I have heard clicks or very breif gaps in audio.
  2. Some times during a recording playback, playback will just stop.
  3. Out of the box you'll see server side exceptions in 1.0.2 SNAPSHOT wile doing normal recording operations.
  4. Despite sending metadata right away from the client, some times recordings will not begin playback.
These problems were observed with a vanilla version of 1.0.2 SNAPSHOT, so there may be server-side configuration that could help out. All I did was start it using Red5.bat then started examining it with the “vod” application.

Red5 1.0.2 SNAPSHOT has been the best version for recording yet since 0.8 using the default codecs; this kind of work is very difficult. Great work Red5 team!

Example Flash Application

Here's the example application. When testing, I used Firefox, Chrome, and the standalone Flash Player 11 debugger.

Get Adobe Flash player

Download The Client Side Code

Download the swf of the application above (Save-As)

Download a zip of the entire source and FlashBuilder 4.5 project

Server Side Application

No server-side application is needed. On Red5, the default VOD application can be used. FMS will require some slight config changes to the default VOD application so you have permissions to record on the server side.

Server Side Configuration

Rijo Joy, a talented developer working with Red5 inside of Amazon AWS from low bandwidth cases in India provided great advice for Red5 1.0.1, which may also apply to 1.0.2. In order to help stabalize choppy recordings in low bandwidth situations he set the following in Red5's:

/conf/red5-common.xml configuration file
<bean id="fileConsumer" scope="prototype" lazy-init="true" class="org.red5.server.stream.consumer.FileConsumer">
   <property name="delayWrite" value="false"/>
   <property name="queueThreshold" value="3600"/>
</bean>



Comments

Charles
Charles
May 15, 2014 3:43 pm

Thanks for your work on that bad bug Octavian. I'm sure there are a lot of people that will be really happy.

Octavian Naicu
Octavian Naicu
May 7, 2014 08:46 am

navt1

Octavian Naicu
Octavian Naicu
May 7, 2014 08:43 am

The delayed write mechanism in Red5 1.0 final, 1.0.1 and 1.0.2 has a bug that leads to entire videos with only 1-2 video keyframes + sound when recording over slow connections or high quality video. During playback the image is stuck at the 1st or 2nd frame and the sound continues for the rest of the "video".

I created a patch for Red5 1.0.2 that fixes the issue. More details at: http://nusofthq.com/blog/recording-high-quality-hd-video-over-slow-connections-with-red5-is-now-possible/

Michael R.
Michael R.
September 28, 2013 10:23 pm

Charles, thank you for posting the configuration tip and your observations!

Comments are currently disabled.