Streaming Multiple Video Sources To Mixify Using CamTwist and Flash Media Live Encoder

I was recently given an early access to a new Flash Media Live Encoder streaming option for streaming synced video and audio to a Mixify livestream. Here’s a short howto of using multiple webcams and other video sources to stream video to Mixify using CamTwist and Flash Media Live Encoder and first impressions of using this new option.

CamTwist Studio

Most of the DJ:s on Mixify who use live video streams use just one static Webcam that sits in one place and doesn’t move. With modern live video tools there’s so much more you can do with live video with only a little more effort. CamTwist is a free live video broadcasting software for Mac (for PC there is at least Manycam which is a bit simpler but also free. If you know alternatives, feel free to tell us about them in the comments!) that enables you to use and mix multiple video sources into one video stream that can be used just like an ordinary webcam.

The development of CamTwist hasn’t been very active in recent years but the most recent version 2.5 is quite stable and works well with OS X Maverixcks and with Flash Media Live Encode (of which we’ll get to later).

Cam Twist Studio

CamTwist works like a professional video broadcasting app; it has a “Preview” display of video that is ready to be switched on, and “Program” displat that plays the currently live video. The video inputs can be almost anything, for example webcams, desktop windows and quicktime video clips. CamTwist also has lots of built-in effects that enable you to modify the video for example to add lower thirds or other static image overlays. Switching from Preview to Program is done just by selecting the video and effects for the next shot and then switcing it on either by cutting, dissolving or using an effect.

CamTwist shows up in your Macs video generators like a regular webcam so you can use it for example for recording to YouTube from your browser or streaming live video to Mixify via the “old” way. But there’s a better way to push your video (and audio) stream online: the free Flash Media Live Encoder from Adobe.

Flash Media Live Encoder

Flash Media Live Encoder

Flash Media Live Encoder of FMLE for short is, like it name implies, a live encoding application for Flash media servers. It takes your input media and in real time encodes it to your preferences and streams it out to a specified server. You can stream video, audio or both perfectly synced. The upside of using dedicated application instead of the browser flash plugin is that you can control virtually every aspect of the encoding and streaming process and therefore you get a lot better video.

The new Mixify streaming option gives you a (per event changing) download link on the Live Stream page for an XML profile that, when opened in FMLE, fills in all the necassary details to point the stream to Mixify servers. After opening the XML and setting up your video and audio details, press start and off you go! The FMLE also gives you lots of data during the streaming process about the in- and outgoing bitrates, dropped frames etc.

First Impressions And My configuration For Streaming To Mixify With FMLE

First off, setting up CamTwist correctly can be a bit of work. For me it took over two days to figure everything out and to set up 2 webcams, 1 video renderer app, 3 live desktop screencapture streams (via Apple Remote Desktop) and a static image overlay. To be fair, wanted to make it bit more complex to test out all the possibilities. Also, after the one-time initial setup, using CamTwist is very easy.

In hoping that my struggles may help you get things working faster, here are the settings that worked best for me were in CamTwist 2.5 (the 3.0 beta DOES NOT WORK with FMLE):

  • frame rate 25 FPS,
  • video size (custom) 1280×720,
  • Syphon server OFF and
  • Webcams at their native resolution

Then, in FMLE, after few test events I ended up with using

  • custom preset with CamTwist as video source,
  • h.264 encoder,
  • 25fps and 1280×720 input size with “Maintain Aspect Ratio” checked.
  • One output stream with 1000kbps (turn this up if you have the bandwith and CPU to handle the load) and
  • output size 758×426. (Note: not using original input size as Mixify event page scales it down and downsizing it here frees up some bandwith.)

I have a separate laptop for DJing so for audio device I selected

  • Line in,
  • format AAC,
  • Sample rate 44k and
  • bit rate 128kbps.

Opening the XML profile given by Mixify event page yields some error about missing metadata but it loads just fine. After everything is set up and started, monitoring the incoming and outgoing stats like fps and bitrate is very easy (and helpful).

Some things to notice if you want to design pixel-perfect graphics/video: Mixify does not maintain the original aspect ratio of the video but rather scales it vertically so your image will be skewed by a factor of ~0,28 when using default 16:9 aspect ratio like 1280×720. For most purposes that isn’t a problem but if you want to make for example a sharp static image overlay, you can stretch the image in Photoshop to counter-effect the scaling. Worked perfectly for me, YMMV :)

I also tried LOTS of different output resolution / video bitrate combinations but in the end it’s really up to your CPU to do the heavy lifting and bandwith to deliver the result if you want sharper video. For me the 1000kpbs video bitrate was a sweetspot for a 2,8 GHz Core i7 iMac and 10/3 MBit Web connection. It’s also worth to notice that FMLE is quite “dumb” encoder, so while it has some options for adjusting under pressure (drop frames or lower quality) it still doesn’t do very good job for example with static overlays over heavily changing video content because you can’t specify areas that need more attention. But OTOH, what can you expect from a software that costs you 0 EUR :)

In the end, the video quality of FMLE compared to the browser flash plugin when using CamTwist input is hugely better. The sound is also very good quality and the fact that the two are in sync is just awesome. If you’re just using one webcam, the difference in video quality is propably small but having video and audio in sync is well worth losing the Traktor metadata you get when using IceCast streaming. (Also, worth noting that at the time of writing this FMLE streaming option does not work with mobile devices! So, if you are one of the lucky ones that get to test FMLE streaming out and you have lots of mobile listeners you’ll be better off to wait for Mixify devs to get these kind of details ironed out before switching to FMLE streams.)

Other Things to Consider

Controlling CamTwist while spinning is far from ideal no matter if you’re using one or two computers. In theory one could write AppleScript helpers to map MIDI notes to different CamTwist actions/cams but luckily the CamTwist devs are developing a native MIDI compatibility for the upcoming 3.0 version. But the development hasn’t been very fast lately so I decided to try a different route: by using AirDisplay and an iPad you can use the iPad as a wireless extra display to your Mac, move CamTwist on that display and then use touchscreen to control CamTwist. It’s not ideal but it works quite well and the iPad can easily be positioned so that you have an easy access to it while you play.

Placing webcams can be a bit tricky, especially if you want exotic cam angles or place the cam far away from the computer. Luckily there are active USB cables which can be over 10 metres long. You can pick up one for about 20 euros — very recommended for getting a bit more creative with your cam. But there’s more: if you have an iPhone, you can use it as a wireless webcam with an app called AirBeam. Now you can place your phone wherever you want, or give it to your friend to do some wireless video freestyling! (Just use CamTwists Desktop+ to capture the display as another video source.) I’m sure there are other and non-Mac/iOS solutions, too, just google for them! And please, feel free to tell about your findings and experiences in the comments!

Happy multivideostreaming!

Yksi kommentti artikkeliin ”Streaming Multiple Video Sources To Mixify Using CamTwist and Flash Media Live Encoder”

Kommentointi on suljettu.