Monday, June 27, 2016

Streaming from VLC to a Qt App on HTTP Using POT

The latest version of POT (5.3.0-beta1) implements some kind of buffering which makes it also possible to do some streaming. ffmpeg provides what is needed to work on protocols like HTTP. This video is a little demo showing how simple it is to stream from VLC on HTTP, remuxing to mpeg-ts, and decoding/rendering on Raspberry Pi in an accelerated Qt application using POT.
Such feature can be useful when dealing with streams coming from many sources, like an IP camera for instance.
Have fun! Bye ;-)

Sunday, June 12, 2016

Binaries for POT 5.3.0-beta1 on Qt 5.6.0 and Experimental Accelerated QtWebKit

This is an experimental version of POT that includes a few new features. The driver now includes an experimental version of playback of remote content including proper buffering of the media and the QtWebKit library is able to play videos using proper hardware acceleration.

Features

The driver can now be used through the regular Qt/QML interface to play content over protocols different from file://. I only tested HTTP but others should be available.
This new feature allowed me to also implement a new player in QtWebKit using the POT driver to stream content to the regular Qt QWebView. Unfortunately I could only find the time to implement this in the WebKit 1 branch, not in WebKit 2 which requires more work. This makes the implementation hardly useful, but it is a start. If anyone wanted to contribute this is where to start. This video shows the new implementation in action:
As QtWebKit now uses the GPU properly, I could also implement a YouTube player app using the same QWebView with just a few lines of code of regular Qt code:

In the video you can also see an application I wrote to implement a YouTube fullscreen player using the YouTube iframe API. Such a sample app is also included in the package.
Of course the real target would be to implement this in QtWebEngine. I was never able to find a version of QtWebEngine with video acceleration for Pi. Anyone who knows one?


Package

The package now includes:

  • build_valgrind.tar: a build of valgrind to analyse your code;
  • libpiomxtextures_qmlutils.so: QML plugin to provide a video probe in QML;
  • piomxtextures_browser_we: an application that tests the QtWebEngine module (run passing a URL, ./piomxtextures_browser_we http://www.youtube.com);
  • piomxtextures_browser_wk: an application that tests the QtWebKit module:
    • you can run on WebKit 1 like ./piomxtextures_browser_wk http://www.youtube.com;
    • or you can run on WebKit 2 like ./piomxtextures_browser_wk --wk2 http://www.youtube.com;
  • piomxtextures_pocplayer: a sample QML player;
  • piomxtextures_pocplayer_yt: a youtube sample player (run passing a video ID like ./piomxtextures_pocplayer_yt 71UvXMzVgx4);
  • qtdeps.tar: the usual libs needed by Qt and POT;
  • Qt-rasp2-5.6.0.tar: a build of Qt 5.6.0 stable including:
    • regular Qt 5.6.0 modules;
    • untested bluetooth module including BLE support;
    • untested MySQL plugin;
    • untested QtFtp module;
    • untested Qt hat tools module;
    • QtWebEngine;
    • QtWebKit.
Please report any bug you find on github. Don't use in production. Sources will be available shortly. Have fun! ;-)

Download POT 5.3.0-beta1 for Raspbian Jessie Lite Pi2 (also tested on Pi3) here (md5: edbe0ad2a552a5c8280e3876d16b237d).