We’re rolling out our new web cam video players (less flash, more iOS and HTML5 support!) to our clients. The first official release was for the Taos Ski Valley web site, which you can see and use here: http://skitaos.org/webcams
So what’s the geek back-story on these video players? Read on…
This AJAX controller polls our Wowza Server software to see how many people are watching the video, polls the JWPlayer to see if the video is being played or not, polls a Linux server to see how many people want control of the camera (a MySQL database tracks who’s in control, who wants control, how much time they have to wait, and which pre-set views each camera has available), and finally sends the camera control commands back to the Linux server where a PHP script redirects these commands back to the actual web cam.
The biggest challenge to all of this (besides getting the AJAX controller to work with Internet Explorer! Arrrgh!) was that the Sony SNCRZ25 all-weather web cams that many of our Ski Area clients use don’t produce video in a format that is compatible with iOS devices. Our solution was to use the latest version of ffmpeg to grab the video via http from the cameras, convert it from MPEG4-part 2 to rtmp, and then send the video to our Wowza server to be re-broadcast for the JWPlayers to pick up. Initially getting this ffmpeg to Wowza video conversion wasn’t too difficult, but it was CPU intensive and slow. Getting this process to quickly and efficiently happen was extremely time consuming as both ffmpeg and Wowza have a massive amount of settings that needed to be tweaked – mostly through trial and error – in order to make it all work fast and without taking down big servers.
All that just to get be able to watch a web camera move and play on iPads and iPhones!
But its all working swimmingly now and I’m very happy with the results.
If you are a developer that need ffmpeg settings or tips on how to get this done themselves, feel free to leave your questions in the comments below and I’ll get you pointed in the right direction (and might even supply you with some code.)