HD Recording with HDFVR (build 505) and Red5 v0.8.0 on Windows XP
This article details the issue of trying to get HD recordings to work with HDFVR and Red5 Media Server v0.8.0. HDFVR is being served by an IIS 7.5 web server running on Windows 2008. Red5 v0.8.0 is running on a Windows XP machine that is also being used as a Kiosk client with a Logitech HD Pro Webcam C920.
This post is meant for HDFVR + Red5 administrators and/or installers that have done the basic installs of HDFVR and Red5, but can’t seem to get Video & Audio to record properly in HD. This solution was used in a Kiosk machine for recording on a LAN with the web server serving the HDFVR front end code. So, all traffic is on a LAN, even the Red5 server is inside the LAN (actually it’s running on the Kiosk machine).
We purchased and HDFVR HD license, but couldn’t get the video codec Sorenson to record with synchronized audio & video, we tried the h264 (h264_r for Red5) and the FLA files produced were near perfect but they wouldn’t playback in the HDFVR frontend (not being able to review the video before posting it was a stopper on our project). Much research, Googling, and some back-and-forth with the HDFVR team made it sound like Red5 v0.8 wasn’t going to be able to handle the HD stream (NOTE: Red5 v1 rc 1 or 2 wouldn’t install and record on our XP or a Win7 box). However, after seeing that the h264 was recording properly, it just wouldn’t playback in the HDFVR SWF, I became dubious that it “couldn’t” be done. During my research I noticed several posts about the SWF/Flash Player having a throughput barrier around 1MBps, so I crunched some numbers and got the stream down under that at 1/2 the video size (480×270) and voila! it recorded without anomalies.
In short, what happens is once the video starts buffering on the SWF then Red5 v0.8 doesn’t know how to properly put the audio and video back together. The SWF keeps sending the audio thinking that the other end of the stream will still want audio even if the video is being held up. We were seeing choppiness, skipping and then fast forward and catch up in the last couple seconds of a video, which I assume was Red5 trying to re-synchronize the Video to the Audio.
- Web Server
- IIS v7.5 on Windows 2008 Server
- HDFVR build 505
- Kiosk Machine
- Logitech HD Pro Webcam C920
- Java 1.6
- Red 5 v0.8.0 Final on Windows XP
- Firefox v13.0.1
I played with the recording video sizes, did some sample recordings, and then looked at the screen shot image info. From the SS image info I got the file size (45 – 75kB @ 640×480) and multiplied it by the number of frames per second (FPS).
480×270: 25kB * 30fps = 768 KBps
640×360: 75kB * 15fps = ~1.15 MBps
I tried 640×360@24fps, but it would bog down, especially with movement or busy visuals. We just couldn’t rely on it. I then tried 480×270 and had it expand to fit the specified SWF display size of 640×480, but the stretching degraded/pixelized the image enough that we were thinking of going back to SD.
I also found information on the embed element’s quality attribute on Adobe’s site (link below). I started at “low” and worked up to “autohigh” and this seems to help keep the image size down to a useable size.
My math may be off, and I may be wrong on some of these things, but it works. Depending on the quality of your video camera you may have to adjust the numbers differently for it to work for you. I am not sure exactly what the cut-off is, or if it is the SWF/Flash Player or our LAN speed between the machines, but this solution is up and running in a high traffic museum exhibit
Web page SWF embed code:
NOTE: you may need the object code. Since our solution is being run on a Kiosk we had the bonus of being able to choose a fixed client browser (Firefox v13.x).
<embed src="VideoRecorder.swf?userId=Anonymous&recorderId=123" quality="autohigh" bgcolor="#98AEB5" name="VideoRecorder" play="true" loop="false" allowscriptaccess="always" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" height="420" width="692">