AVChat 3 feature highlight: Recording the Video Streams
This article has been updated as of 30 April 2013 to add info about recording to .mp4 files and the H.264 video codec.
AVChat 3 uses a media server (like Red5 and FMIS and Wowza) to stream audio and video between users. The audio and video data travels from the broadcaster user to the media server and from there to the receiver/viewer . While it passes through the media server the audio and video data can be captured and stored in .flv file, or, starting with build 2330, in .mp4 files. The file type that will be created depends on the video codec being used (Sorenson Spark or H.264).
Codecs being used…
The audio data will be encoded with wither the NellyMoser or Speex codec (depending on your audio settings) and the video data will be encoded with the Sorenson Spark video codec. Starting with build 2330 the H.264codec has also been added for video encoding.
The audio and video encoding is done by Flash Player (before it sends the data to the media server), and Flash Player can only encode with those codecs. Flash Player 11.1 or above is required for H.264 support.
So when the audio and video data hits the media server it is already encoded, the media server just saves the data into .flv or .mp4 files depending on the video codec.
Enabling audio/video streams recording
The feature is disabled by default because it tends to use large amounts of space over the time.
If you use Red5:
- edit avchat30/avchat3.properties
- set recordAudioVideoStreams=true
- restart Red5
Red5 will record the streams only in .flv format regardless of the video codec used.
Important note! The only version of Red5 (supported by AVChat 3) on which H.264 can be used is Red5 1.0 RC1
You will find the new .flv files in Red5/webapps/avchat30/streams/_definst_
The flv files are named like this: username+ “_”+ unique user id assigned by FMS + “_”+ timestamp (from when the userstarted publishing ).
If you use FMS/AMS:
- edit avchat30/settings.asc
- set recordAudioVideoStreams=true
- reload the avchat30 FMIS application using the FMIS Management Console (or restart FMIS)
FMS 3.5 or higher is required for recording in .mp4 format and streaming with H.264 encoding.
FMS will automatically record .mp4 files if the video codec used is H.264 or .flv files if Sorenson Spark is set.
Important note! For compatibility with the H.264 video codec, FMS requires the NellyMoser audio codec to be set. Using Speex may cause some files in some cases to not have audio.
You will find the new .flv/.mp4 files in FMS/applications/avchat30/streams/_definst_.
The flv/mp4 files are named like this: username+ “_”+ unique user id assigned by FMS + “_”+ timestamp (from when the user connected to FMIS).
If you use Wowza:
- edit Wowza/conf/avchat30/Application.xml
- On line 25 change live-lowlatency with live-record and save
- Restart Wowza
Wowza will automatically record .mp4 files if the video codec used is H.264 or .flv files if Sorenson Spark is set.
Important note! Wowza doesn’t support adding the NellyMoser audio codec in a mp4 container. So if the audio-video profile .xml is set to record with H.264 video and NellyMoser audio, the resulting .mp4 won’t have any audio. To avoid this always use the Speex audio codec when using H.264 video encoding with Wowza.
You will find the new .flv/.mp4 files in this folder: Wowza/content/ .
As oppsed to FMS and Red5, by default, the .flv/mp4 files are not grouped in folders by application and application-instance like this:
- Wowza/content/avchat30/_definst_
- Wowza/content/avchat30/_siteB
To group them like that you need to:
- edit Wowza/conf/avchat30/Application.xml
- On line 26 change the default folder path
${com.wowza.wms.AppHome}/content
WITH
${com.wowza.wms.AppHome}/content/${com.wowza.wms.context.Application}/${com.wowza.wms.context.ApplicationInstance}
and save - Restart Wowza
The .flv/.mp4 files are named like this: username+ “_”+ unique user id assigned by Wowza .
Audio Video Quality
On the media server it is recorded whatever gets sent from the client .swf file, so to increase the audio/video quality of the recordings you need to increase the audio/video quality used inside the video chat software.
Important: Because you are recording audio/video streams that are destined for live viewing, the quality of the recordings is not as high as the quality that you get with a dedicated Flash video recording software like our Flash Video Recorder. Live streams are maintained as “live” as possible by Flash Player and the media server by dropping video frames and even stopping the video data from being sent to the media server because audio data has higher priority than video data (this will only happen over slow connections tough where audio+video data just doesn’t fit trough in a “live” way).
Important 2: When you have auto bandwidth reduction turned on (it’s on by default) streams are passed trough the media server only when there is someone watching the respective stream. So even tough user X is broadcasting, his stream will only be recorded if he has one or more viewers. teh steram recording process will also stop when user X has no more viewers. You can turn off auto bandwidth reduction.
H.264 vs Sorenson Spark
Advantages:
- H.264 requires less bandwidth than Sorenson Spark
- H.264 causes less delay when streaming between the broadcaster and the receiver
- H.264 provides better image quality, smoother framerates and sharper edges and details.
Disadvantages:
- H.264 is more CPU intensive than Sorenson Spark. Having a lot of streams running at once may cause the AVChat client to have performance drawbacks for users with slower hardware.
Playing back the recorded files
.FLV
To play back the .flv or .mp4 files on your desktop you can use http://www.wimpyplayer.com.
To play back the .flv or .mp4 files on your website directly from the media server you can use any flash video player for websites that supports streaming. I recommend JW FLV Media Player or Flow Player. You can also move the video files from your media server to your web server and deliver them to your users via progressive download (YouTube in its first months).
.MP4 file recorded with Adobe Media Server
Flash Media Server version 3.5 and later and Adobe Flash Media Live Encoder 3 and later can record content in MPEG-4 (F4V) format using an industry-standard recording technology known as “fragments” or “moof atoms.” Some MPEG-4 compatible tools and players do not support moof atoms and therefore cannot recognize files recorded by Adobe Media Server (previously known as Flash Media Server). The F4V Post Processor tool aggregates the information from all the moof atoms into a single moov atom and outputs a new file. Use the F4V Post Processor tool to prepare F4V files for editing in Adobe Premiere® Pro software, delivery over HTTP, or in video players that support H.264 and AAC formats. This tool can be used in Windows or Linux.
Playing back the files locally before passing them trough the F4V Post Processor tool might not work.
.FLV files with no meta data
Because of the way they are recorded, some .flv files will end up having no duration metadata, thus resulting in funny playback. To fix this run those flv files trough flvmdi or flvtool2.
2 thoughts on “AVChat 3 feature highlight: Recording the Video Streams”