Note: The pipeline in this post is horribly inefficient and lacks audio. Please see Ray Strode’s blogpost on usability video pipelines to obtain a much improved version of the pipeline in this blog post.
Thanks to all the folks who responded so quickly to help out on my last blog post! Because of your help, a bug got filed and fixed upstream in gstreamer, and a new build of gstreamer containing the fix for Fedora is on the way.
So I bet you were wondering why I was so interested in getting AVF videos into gstreamer, right? Well, I’m going to tell you anyway.
I’m in the process of putting together a portable usability testing lab. The key component to this usability testing lab is a quad-video-input video mixer / DVR unit. It can be hooked up to 3 cameras and one scan converter so you can have 3 panels of the user / testing environment and one panel showing the screen of the system they’re using. The particular unit I decided to get is the AVer Media AVerDiGi EB1304NET SATA+.
Now, there are a couple quirks to the EB1304. The first I noticed was that its audio input/output jacks are, well, a little unique:
Yes. It takes bare wires with little metal clips. I haven’t tested it yet, but the fine technical support folks at CCTV Wholesalers (who, by the way, I highly recommend for price, shipping speed, and speedy & helpful support) assure me it’ll work, so that’s something I’ll be testing out soon.
The second quirk, of course, is more crucial to the usefulness of the unit – the video files it outputs. While this little unit is an embedded Linux product (woo!), the file formats it produces unfortunately are not so open & standard. As I mentioned in my previous blog post about AVF files, it provides you with both an AVF (which is really just an AVI file with a slightly tainted header) and a TBL file for each of the four input videos. Now, these play fine in mplayer, vlc, and very soon gstreamer-backed players, but, one of the reasons I want to capture four videos at once is to produce usability testing videos that show both what the user is working on and their reaction, ideally a single video with all four inputs in a quad-split screen. AVer Media provides a CD-ROM with a bunch of Windows-only programs to do this in software – and they don’t even run in Wine. So, I wanted to try to get the AVFs working in gstreamer so that I could use gstreamer pipelines to achieve this quad-split video.
Well, since the updated gstreamer for Fedora wasn’t yet available this morning, I took Nicu’s advice and used mencoder to convert the AVF files to AVI:
mencoder -oac copy -ovc copy -o ch1.avi 2009_08_25_21_07_59_ch1.avf
Next, the ever-amazing Ray Strode hacked on putting together the gstreamer pipeline necessary to stitch them together into one video:
gst-launch -v filesrc location=ch2.avi ! decodebin ! videoscale ! video/x-raw-yuv,width=720,height=480 ! videobox left=-720 top=-480 border-alpha=0 ! videomixer name=right ! videomixer name=three ! videomixer name=all ! alpha ! ffmpegcolorspace ! theoraenc ! oggmux ! filesink location=all.ogv filesrc location=ch1.avi ! decodebin ! videoscale ! video/x-raw-yuv,width=720,height=480 ! videobox border-alpha=0.0 left=-720 ! alpha ! ffmpegcolorspace ! all. filesrc location=ch4.avi ! decodebin ! videoscale ! video/x-raw-yuv,width=720,height=480 ! videobox border-alpha=0.0 top=-480 ! alpha ! ffmpegcolorspace ! three. filesrc location=ch3.avi ! decodebin ! videoscale ! video/x-raw-yuv,width=720,height=480 ! alpha ! ffmpegcolorspace ! right.
AWESOME, right? Here’s the result, although I took the video of me out and replaced it with another copy of the screen video because I’m shy :
As we go through this process, I’m making sure to document everything so anybody else who wanted to put together a similar kit without having to run proprietary software to do so can learn from this experience. One of my next blog posts is going to be a rundown of all of the equipment I ordered for our kit with photos and writeups of how to use it all so if you are interested in this, you can look forward to that.
Next up is figuring out that little beastie of an audio input and then updating the pipeline to handle the audio. Wish me luck!