Sunday, December 13, 2015

Playing YouTube Videos on Raspberry Pi 2 Using POT and QtWebKit

This is the first attempt at playing YouTube videos using POT and QtWebKit on Raspberry Pi 2 (Raspbian Jessie). I tried two ways: one is from the YouTube website and one is using the iframe YouTube API. What you'll see in the video is done using the old WebKit 1 in QtWebKit with the OpenGL paint engine. This is good if you need to place a YouTube video in your application. Unfortunately this is still very experimental and cannot be placed in QML applications. Much more work is needed for that.

Unfortunately what you'll see in the demo is just HD quality (720p). YouTube doesn't seem to be willing to let my Pi have the 1080p version for some reason.

Have fun! ;-)


  1. What are the diferences between this and the older post ?

    1. Steps of the same journey. Not so much from the point of view of the implementation, but that demo did not include YouTube videos on purpose. As you can see YouTube website is heavy, it probably use much JavaScript and that makes the framerate of the video pretty bad (yet). Not sure if you can see that, this video is just 30fps. However the second implementation makes it possible to play YouTube videos far better using the YouTube API instead of the website. This allows to build an application that includes a complete YouTube player.

    2. I get confuse because when we are talking about hardware playing video I always think of it in a way that the CPU isn't doing anything about it.

      The only diference between these "I tried two ways: one is from the YouTube website and one is using the iframe YouTube API" is that on the first aproach the cpu need to take care of the webiste (js etc) and on the following one doesn't need to make much more than play the video, right?

      Why it doesn't work on QML as WebView uses QtWebKit?

    3. It is more complex than that. This is not using the WebView element. That would use WebKit 2, and implementing video acceleration on that software architecture is more involved. Doing better is possible but requires time investments. I may do it or not, it depends.

    4. Where can i find your example files?

    5. This portion has not been published yet.