Mar 20

Affordable SSL CDN with AppEngine

At Panda we just switched our CDN from CloudFront to AppEngine to be able to support SSL on our cdn.pandastream.com domain. It means that for the uploader script can use the new URL:

<script src="//cdn.pandastream.com/u/1.4/jquery.panda-uploader.min.js" type="text/javascript"></script>

instead of:

<script src="//d21qbsp9m249bi.cloudfront.net/u/1.4/jquery.panda-uploader.min.js" type="text/javascript"></script>

It’s a detail. But at Panda we like to take care of details.

AppEngine is primarily meant to host applications but a lesser known feature is that it uses Google’s CDN to serve static assets. Once you have your app up and running you can tie it to a Google Apps domain and then add a SSL certificate to it.

At the moment the edge traffic is free on appengine so all this will just cost you the price of the VIP that’s used for SSL: $39 / month.

All this together makes it a great combo. In comparison, CloudFrount doesn’t support custom SSL certificates and Akamai asks for $1500.- just for the setup. The cheapest we found until now was MaxCDN that charges $39.- / zone / month.

Create your CDN

Sign up for appengine and create a new project.

Install the app-engine toolkit on your machine. On my mac: brew install google-app-engine

Create a new local folder and add an “app.yaml” in it:

---
application: your-cdn
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /u
  static_dir: u

Then put some files in the u/ sub-folder. You might want to make it a git repo too but it’s up to you.

Push your code: appcfg.py update . (add —oauth2 if you use 2-factor auth)

Now your content should be available at http://your-cdn.appspot.com/u/…

Custom domain and SSL

You need to have Google Apps setup for that domain and billing setup to pay for the SSL options. And a SSL certificate. You can obtain free SSL certificates at StartSSL

First you need to tie the app to the domain. For that go to the “Application settings” page in your app and click to “Add domain”. Follow the instructions.

For SSL, the VIP option (you want this one if you’re targeting IE8 or less) is only available after the first charge on the credit card. To generate some billing sum you can install the SNI version in the mean-time.

Back in a month, create a VIP, tie to domain. Done.

Enjoy, Jonas

Nov 21

socketmaster: Zero Downtime Restart for Your Apps

Hi developers!

I have just released yet another Open-Source project. This was gracefully sponsored by PandaStream, so I thought I might as well post here. Let me introduce you to socketmaster.

In the tradition of UNIX, socketmaster does just one thing but does it well; it helps your app to restart without losing or refusing a single connection. socketmaster is the gatekeeper, keeping your sockets warm under the fire of restarts (christmas starts sooner every year isn’t it ? ho ho ho!).

To port your app to socketmaster you just need to do two things:

  1. Change the startup code to open the file-descriptor 3 as a socket listener.
  2. Gracefully shutdown on SIGHUP.

socketmaster will then take care of the rest for you. To get a better example of how it works, the example folder in the project’s source tree has a Go and ruby example as well as an upstart script for you: https://github.com/pandastream/socketmaster/tree/master/examples .

The tool is written in Go which allowed me to shorten my development time considerably compared to C. Go allowed me to tap into the lower-level POSIX constructs while also having access to handy higher-level abstractions. For you, it means that it can easily be cross-compiled and distributed in a binary form.

Panda is now using socketmaster in production. Needless to say, you can count on it to be supported. If you find any bugs, want to contribute or send pull-requests, just get in touch and I’ll respond quickly.

Cheers, Jonas

PS: Are you a hacker looking for a job in London ? We’d like to meet you and make you part of our team. http://pandastream.com/jobs

Oct 02

You’re smart ! We’re hiring.

Panda makes it easy for people to transcode their videos into any format, fast. We’re a profitable SaaS business, now part of MediaCore (working to transform online video learning). A large and growing number of customers depend on our platform on a daily basis to transcode large volumes of video. We’ve got big plans to push the platform forward with new encoding technologies and partnerships. With your help we can do it faster and better.

We need someone special. Someone who lives and breathes new technology. The platform is primarily Ruby and FFmpeg, along with Redis, Beanstalkd, EventMachine, and is deployed within AWS. We need someone who will be at ease with this stack, and also someone who can be relied on to manage it all within a production environment. Having a background in video transcoding is obviously a big plus !

We’re looking for someone to join us full time in London, UK.

You will be working in a beautiful offices during flexible work hours. We provide you with the setup you need to do great work (MacBook, CinemaDisplay, great chair). We also have a fantastic remote team in Victoria BC, Canada that brings the opportunity for travel and a great company culture overall. You can make a difference, in our team, and on a wider scale by contributing to related Open-Source projects.

To apply, let us know about yourself, your past experience and what you see yourself contributing to our platform. Show us what you’re passionate about.

Feel free to ask us if you have any questions about the position.

Contact: jobs@pandastream.com

Sep 26

Customer Spotlight: Artplayer

ArtPlayer.tv

At Panda, we have some truly great customers and are always interested to see how they’re integrating Panda with their apps and sites.

Artplayer is a unique online video platform aiming to showcase the best video content from the UK arts industry. In addition to a desktop and mobile web presence, Artplayer offers mobile apps, exclusive editorial content, access to major UK Arts organisations and a range of video services including production and training.

Chris Nolan of the Foundation for Art and Creative Technology (FACT) was kind enough to take some time to detail why Artplayer chose Panda and how they’ve integrated it into their platform:

“For a previous project we wrote our own encoding queue using Ruby on Rails with an ffmpeg backend. So, we learnt the hard way that encoding videos in a high-availability site is a very difficult technical challenge. The main difficulties we encountered were managing the queue during peak periods - especially controlling concurrent jobs - and the impact that would have on CPU and resource usage. For Artplayer we decided to look into alternative ways to do this and it soon became clear that this is a service we needed to be handled by the cloud.

I trialed a number of services including Heywatch and Ankoder, both of which are very capable - but the ease of integration with Panda using the supplied libraries won me over. Within less than 30 minutes I’d created a fully-functioning test implementation of Panda and it became immediately clear that it would both provide all the features we require whilst being able to easily integrate with our site’s workflow.

Today, Panda handles all of Artplayer’s video encoding. Each video is encoded into three profiles, providing us with a range of bitrates for HD, SD and mobile encoded videos, which allows us to reach the majority of today’s connected devices. We use jwPlayer to allow playback on both HTML5 and Flash enabled devices.

Integration is facilitated through Panda’s PHP library, which provides API access to Panda, while the Panda HTML5/Flash smart widget provides a widely compatible and simple upload process. The entire integration is transparent to the users who always remain on the Artplayer site. Our videos are passed from Panda to Amazon S3 where we use Amazon’s Cloudfront Content Delivery Network to provide advanced streaming of videos to our visitors.

Another strength of Panda is the API, which strikes the difficult-to-achieve perfect balance between being feature-rich and simple to use. Additionally, Panda’s admin interface is excellent, and when I’ve needed their support they have always been available and have been exceptional in helping to answer my questions and resolve any issues we encountered.

We’ve now been using Panda for over 12 months in our pilot and live sites and are really happy with the service.”

Thanks for the kind words Chris Nolan.

Aug 14

PandaStream + MediaCore

We’re excited to officially announce that PandaStream has been acquired by MediaCore. Delivering the best online video experience has always been important to us and joining the amazing team at MediaCore will allow us to continue to pursue this goal with greater resources and a secure future.

We believe video should be a seamless experience for everyone involved, from the content creator to the audience. Working with MediaCore will allow us to address the whole process—from upload to playback—in a way that will not only provide a better experience overall, but also completely transform the way millions of people learn on a daily basis.

Our customers are still our number one priority, and always will be. You can be sure we will continue to innovate and operate our successful video encoding platform indefinitely. We’re extremely excited to see what the future has in store for us and to work with MediaCore to revolutionize the way the world uses video.

May 31

New design

Today we&#8217;re excited to announce the launch of our beautiful new site. Check it out here: http://www.pandastream.com. We&#8217;ve been working hard on this over the past several weeks, so we do hope you enjoy the finished product as much as we do.

Simplified pricing

Along with our new site, we have simplified the pricing down to 4 plans which we feel better reflect the usage patterns we have seen over the years. You can read more about the new plans here: http://www.pandastream.com/pricing-signup .

Transition for existing customers

If you are on our free sandbox plan, nothing has changed. If you are currently on a paid encoder plan, there is no immediate action you must take and you will be able to continue on your current plan indefinitely. However, should you wish you switch to one of the new plans, you can do so at any time by logging-in and heading to the &#8216;Plans &amp; Billing&#8217; section.

We would like to thank all of our customers for their continued support over the years. As always, if you have any questions please don&#8217;t hesitate emailing (info@pandastream.com) or sending us a tweet (@pandastream).

Best,

The Panda Team.

New design

Today we’re excited to announce the launch of our beautiful new site. Check it out here: http://www.pandastream.com. We’ve been working hard on this over the past several weeks, so we do hope you enjoy the finished product as much as we do.

Simplified pricing

Along with our new site, we have simplified the pricing down to 4 plans which we feel better reflect the usage patterns we have seen over the years. You can read more about the new plans here: http://www.pandastream.com/pricing-signup .

Transition for existing customers

If you are on our free sandbox plan, nothing has changed. If you are currently on a paid encoder plan, there is no immediate action you must take and you will be able to continue on your current plan indefinitely. However, should you wish you switch to one of the new plans, you can do so at any time by logging-in and heading to the ‘Plans & Billing’ section.

We would like to thank all of our customers for their continued support over the years. As always, if you have any questions please don’t hesitate emailing (info@pandastream.com) or sending us a tweet (@pandastream).

Best,

The Panda Team.

Feb 15

Efficient Realtime Dashboard with Pusher WebHooks

Today we want to talk about a code update we have made on Panda, taking advantage of the Pusher web hooks released a few days ago.

This is a fantastic feature for us as it has considerably reduced the number of api calls made to Pusher, saving us bandwidth and money.

One of the great features of Panda is it’s real time dashboard. Panda can display the new encoding jobs, their progress, and your stats instantly with no effort. Thanks to Pusher, implementing this was really easy.

At such a scale the right design for your software is to separate your app into smaller apps, small apis and workers. In our case, the encoding dashboard is completely separated from the api but they share the same Pusher app. When an event occurs on Panda (like a job progress), the api triggers a Pusher Event and the web app reflect that change immediately.

Before the release, we were facing one problem: we were sending a lot of unnecessary api calls to Pusher.

Panda’s api has no interaction with the user. It only communicates through private and public apis. This means it doesn’t know whether someone is listening to the Pusher channel. We are then pushing thousands of messages even if nobody is looking at the dashboard. The api triggers messages, the web app listens. This is not a two way messaging.

Now with Pusher Web Hooks, our api is able to know when at least one person is looking at the dashboard. As each customer uses a different private channel, that solves our problem.

Our Pusher dashboard is self-explanatory.

Now we would like to show you how we implemented it. First we need to setup an endpoint for the web hooks. Let’s make a small Sinatra app and use the Pusher::WebHook object, which comes with the new gem.

class PusherWebHooks < Sinatra::Base

    post '/pusher' do
        wh = Pusher::WebHook.new(request)
        if wh.valid?
            wh.events.each do |event|
            case event["name"]
                when "channel_occupied"
                    channel_occupied(event["channel"])
                when "channel_vacated"
                    channel_vacated(event["channel"])
                end
            end
        else
            status 401
        end

        return
    end
end

We can setup our notification url inside the Pusher dashboard and we are ready to receive web hooks.

Because splitting your code is the right thing to do, Panda’s encoders are not communicating directly from the api neither. So we somehow need to send this information to them. To do that, we will use Redis Sets as we already use Redis to distribute messages across our farm of encoders.

def channel_occupied(channel_name)
  redis.sadd("pusher:channels", channel_name)
end

def channel_vacated(channel_name)
  redis.srem("pusher:channels", channel_name)
end

Now our Panda encoders can use this information to check whether the channel we are sending the message to is occupied.

 def push_websocket(channel_name, event_name, data)
    if redis.sismember("pusher:channels", channel_name)
      Pusher[channel_name].trigger!(event_name, data)
      true
    else
      false
    end
 end

Redis commands on sets are O(1) operations which makes the design very efficient.

How simple is that? More information is available inside the Pusher docs. Now you have no excuse not to implement Pusher WebHooks. :)

Vivien Schilis

Feb 13

Introducing stacks for advanced profiles

Friday we realeased a feature that we called Stacks. A stack is an encoding environment including a set of encoding tools and commands. This feature will provide us a way to upgrade ffmpeg without breaking your encoding commands.

The current stack, called 'corepack-1' is still the one used by default. The new stack we are introducing is called 'corepack-2' and brings speed plus lots of new formats and codecs.

If you are using some advanced profiles, you should consider:

Here is an example on how to migrate your profile to the new stack using Ruby.

$ rails c
profile = Panda::Profile.find '12345'

profile.command 
> "ffmpeg06 -i $input_file$ -vcodec libx264 -acodec libfaac -vb $video_bitrate$k -ab $audio_bitrate$k -y $output_file$"

profile.command = "ffmpeg -i $input_file$ -threads 0 -c:v libx264 -c:a libfaac $audio_sample_rate$ $video_quality$ $audio_bitrate$ $fps$ -y $output_file$"
profile.audio_sample_rate = 44100
profile.stack = 'corepack-2'

profile.save!
> true

Instructions when upgrading to the new stack:

In about a month 'corepack-2' will become the default stack for the newly created profiles. Make sure you specify the stack name if you consider running on the old stack.

POST /profiles.json, {..., 'stack': 'corepack-1'}

Stack on presets cannot be set as they run on their own private stack constantly updated.

Vivien Schilis

Jul 15

Interview with Panda co-founder

Last week we had the pleasure of being interviewed by the folks at VidCompare. Head over here to read the full interview where I speak about what got us to where we are and what the future holds for Panda!

Jun 01

Status update

It’s time we break the silence !

Since the last post, your host has arrived on the team. I am excited to bring my experience in Video, Linux, and Web development that I gained during the last years at STVS, another amazing company. But for now, let me tell you of the latest updates on the PandaStream platform.

Web interface speedup

After our ruby 1.9 migration, the average page response got divided by two, down to around 350ms. Missing, is the /cloud page that still takes around 1 second to load so that is something we are going to work on next.

Web+Heroku ♥

For the Heroku customers ; you can now access to a specialized version of our interface by logging into Heroku and choosing the Panda Stream Add-on. This can be handy if you want to follow visually the progress of your encoding and get real-time notifications. You can also access it by typing the following command in your console. Enjoy !

$ heroku addons:open pandastream --app your_app_name

Watermarking support for the API

Watermark support has been added last week and it works on all video format. I proposed that we follow the CSS absolute element convention for the image positioning and it works like that :

p = Panda::Profile.find(your_id)
p.watermark_url = "http://www.pandastream.com/images/panda_logo.png”
p.watermark_bottom = 5  # in pixels
p.watermark_right = 5   # in pixels
p.save

http://www.pandastream.com/docs/encoding_profiles#watermarking

In the process, we also added some more fields for the custom presets that might be useful for you :

$max_audio_bitrate$ : keeps the original bitrate until it goes over audio_bitrate
$max_video_bitrate$ : keeps the original bitrate until it goes over video_bitrate
$fps$  : value of the original framerate
$filters$: scale your video considering the `aspect_mode` attribute of your profile and apply watermarking options (only avaiable for ffmpeg06)

http://www.pandastream.com/docs/encoding_profiles#variables

WebM speed-up

After we updated our FFmpeg build, we saw almost a double speedup for the WebM encodings. This brings WebM up to speed with the h.264 transcoding. Next, we will publish some encoding speed results for your eyes so that you can compare our platform to our competitors.

Uploader CDN

v1.3 of the uploaded is now avaible on our CDN for your very convenience. You can link directly to the below url and we take care of the rest. In any case there is a JavaScript bug, we deploy the new version and you have nothing to do. the /1.3 path also guarantees that we won’t push backward-incompatible changes to this version.

How to use ? Just add the following script to your page and you are ready to go !

<script 
  src="http://cdn.pandastream.com/u/1.3/jquery.panda-uploader.min.js"
  type="text/javascript"></script>

For more details, check-out the documentation

A big props goes to the awesome JBundle which we use to package and distribute the uploader to the CDN.

Check it out : https://github.com/ismasan/jbundle

To keep you informed on the new platform updates, follow this blog or our twitter account