Aug 212013
 

Aka how to view YouTube videos on your Raspberry Pi from Midori or Chromium!

youtube-on-the-raspberry-pi

We have pulled together some software magic and are proud to announce an easy installation procedure for PiVid, the YouTube / HTML5 Video / VeeHD Raspberry Pi video enabler:

Installation

Open a shell – for instance LXTerminal, if you are working on the Raspberry Pi desktop, it can be opened by double-clicking the LXTerminal icon – and enter the following commands:

Step I: Please add our Repository

sudo wget -O /etc/apt/sources.list.d/repository.pi3g.com.list http://repository.pi3g.com/sources.list
sudo wget -O - http://repository.pi3g.com/pubkey | sudo apt-key add -
sudo aptitude update

This will:

  • set up our repository as an additional package source on your Raspberry Pi (your main sources.list will not be modified in any way)
  • get our public key
  • fetch the available packages from our repository server

Step II: Install PiVid

sudo aptitude install pivid

This will:

  • install PiVid and dependencies (other packages which PiVid requires to work)

Please press “Enter” when asked whether you want to continue, and once again “Enter” during the installation process of the youtube-dl package, when asked to.

Step III: Activate PiVid

service pivid start

This will:

  • start the pivid service (it talks to your browser and to omxplayer to play your video)

If you want to stop the pivid service, simply use “service pivid stop” – this will save a small amount of computing resources.

Step IV: Install PiVid in your browser

Install PiVid in Midori:

To use the userscript in Midori (Raspbians default browser), you have to activate the “User addons” extension. Start Midori. Open the preferences dialog (Menu>Preferences), select the Extensions tab and tick “User addons”. (“User addons” is the very last entry, use the scroll bar to find it). Click “Close”.

Then simply open the script ( file:///usr/share/pivid/replace.user.js ) in your browser (copy & paste the link into your URL bar, and press enter) and click “Install user script” when asked.

pivid-userscript-midori

 

Install PiVid in Chromium:

To install pivid in Chromium, please open a shell in the X desktop environment (e.g. LXTerminal), and start Chromium like this:

# chromium --enable-easy-off-store-extension-install /usr/share/pivid/replace.user.js

pivid-userscript-chromium

Please click “Continue”, and then click “Add” on the “Confirm New Extension” dialogue:

click-add

Chrome will confirm, that the extension has been added.

Usage

Please note: after every reboot, you need to start the pivid service, as described above. Open LXTerminal, and (as user pi), enter:

service pivid start

You can close LXTerminal after starting the service, if you want. If the service pivid is already running, it will tell you so – you don’t need to worry about entering it twice by accident.

Starting PiVid will open a web server on your Raspberry Pi’s port 3000. This will be accessible on your local network – and can be used to control video playback (of external URLs) on the Raspberry. This is by design, and we plan to release more documentation about this soon.

YouTube

youtube-raspberry-chromium

Navigate to a YouTube video (for example: Xcylin, shooting with a frickin’ laser). First, the browsers will display “Flash Player missing”, but after some seconds, the web site should reload, and display the PiVid play button, as seen above for Chromium.

Simply click this button, and the video should launch in a short while. This will be indicated by a “pause” button:

youtube-raspberry-c-pause

If you want to see the video again, please reload the page – PiVid currently can’t identify when the video has stopped playing.  The pause button currently has no function, but you can use omxplayer keyboard control (see below).

VeeHD

VeeHD is an alternative video hosting platform / community, sporting an interesting selection of movies, documentaries, etc.

PiVid supports playback on VeeHD. You may need to log in as a VeeHD user for some videos to work, and some videos are hosted on very slow servers – where streaming is impossible with PiVid. Please download the video and play it with omxplayer instead.

Usage: Search with the VeeHD search, and click on the video you would like to see. PiVid will show you the play button after a short while:

veehd-raspberry-pi

Omxplayer keyboard control

Space or p = Pause / Resume
– / + = Decrease / Increase Volume
q = Quit

 

Problem handling

YouTube play button not showing

If the PiVid play button does not show up on a YouTube video, instead of the warning about an incompatible browser, please try to simply reload the page – it should show up now.

Restarting the service

If you run into any unexpected problems using the software, try restarting the pivid service:

service pivid restart

If this does not help, try restarting your Raspberry, and starting the service after that. If still stuck, comment below. (Use “pivid” instead of “service pivid start” to see some advanced debugging output).

update-rc.d

Please note, that update-rc.d can’t be used right now to install the service as autostart on boot – we are investigating the cause and will release an update soon. (pivid service will start, but without video playback.) Please use the manual starting method ( service pivid start ) in the meantime – thank you!

Background

PiVid works as a server (written in the uber-cool Node.JS), which will display an IFRAME in your browser. Through a user script, the browser can submit the URL needed to retrieve and play the video. Once you click on the “play” button, PiVid will invoke some software incantations (sprinkle the equivalent of magic fairy dust – we’re building on the shoulders of giants – you guys know who you are :-) – and voilà – the video location will be passed to omxplayer, the trusty workhorse of Raspberry Pi video playback!

You can, of course, fork us on GitHUB.

By the way – we have also packaged a newer version of Node.JS to go along with PiVid on our repository – package name is “nodejs”. Stay tuned for more about this.

The idea for PiVid was taken from a very similar client-server approach, which was coded in Python, but seems to be abandoned now. Thank you for the inspiration!

Reference

Jul 032013
 

That’s what we all want to see – a functioning, lightning-fast modern browser on the Raspberry Pi.

Some resources I collected on the web look pretty promising.

XWayland server

The XWayland server has already been demoed, although not released to the broad public yet. We have seen Midori (or Chromium?) and LibreOffice running on top of it. Pretty smoothly, it seems.

This SHOULD be available soon and support all “classical” X software.

The future: Webkit

The company Igalia, amongst many others, is working to allow WebKitGTK+ run on a Wayland backend.

WebKit is the base of the most modern browsers (even Opera started to use it, AFAIK. One notable exception of course is Microsoft with it’s Trident engine. I bet we will grow old to see it arrive on the Raspberry, though).

Epiphany, the default web browser of GNOME, is based on WebKit. Chromium is also based on WebKit.

Igalia has a blog, in which these two entries seem the most interesting to me:

Briefly, this post outlines why it would be a good thing to have the Core IV GPU of the Raspberry do the heavy lifting of layer-composition, instead of the CPU (which could focus on JavaScript, for instance …)

The post explains some background, has a YouTube demo video of Epiphany running under Wayland (showing off some 3D effects) and goes on to outline the current state of the work. “GTK3 is already providing a Wayland backend, WebKitGTK+ needs to use GTK3 only”.

Most notably, full screen video playback (GStreamer) and plugins may be problematic. We all can / should live without Flash by now, which will probably never get ported to GTK3. Adobe’s phasing Flash out, too. HTML5 is the way to go!

As GNOME is betting huge on Wayland, and Epiphany is its flagship browser, it is only a matter of time until Webkit-based browsers (Midori, Chromium, …) WILL be available for the Raspberry Pi.

More Information

is one of the few good collections of the current state of Wayland support. Not everything applies to the Raspberry of course, but we can “feel, see and touch the future” here. GTK+ support seems to be complete – which is quite promising for many applications. It also lists the all-important browsers. Apparently Chromium removed Wayland support?? It was added back in in a fork / patch it seems, this is already one year old.

On the Wayland mailing list it was shared, that Midori has finished preliminary support for Wayland. This is news as of the end of April 2013, and will probably take some time to come to the Raspi. Will midori be the first browser we use with Wayland?

Webkit-clutter seems to be another possible approach to Weston. (Clutter is apparently another application toolkit, an alternative to GTK+). As we all know Collabora is the company behind the Weston/Wayland software on the Pi, we may expect something from this, too. Here’s some more background info on Clutter & Webkit.

Meanwhile:

This video shows a comparison of several browsers available on the Pi. Netsurf does not run JavaScript, this is where the huge performance gains when rendering arise from. Chromium was apparently no easy task to compile for a Raspberry, but it works now – albeit quite slow. We’re not taking it for granted Winking smile

 

Gomoto’s Browser

This is an interesting light-weight WebKit-based browser. Supporting JavaScript, CSS, etc – yet the code is so short you can easily read it, modify it, and recompile it. In fact I have experimented with it tonight.

Read the following thread to obtain more information

Or go directly to Google Code Homepage of “minimal-web-browser”. Download the browser package or the source.

Installation instructions:

  • wget the omxgtk package
  • aptitude install xterm
  • dpkg –i omxgtk_0.1_rc3_armhf.deb
  • wget the web package
  • dpkg –I web_1.0-6_rc3_armhf.deb

now you can start the browser from an X session with “web”.

This browser CAN ALSO SUPPORT YOUTUBE PLAYBACK! You need to create a shell script to support this, and install youtube-dl. The author also added Radio playback.

Guenter Kreidl has built a Minimal Kiosk Browser on the base of Gomoto’s browser. Look at this Raspberry Pi forum thread to find out more. It looks quite promising, incorporating some interesting features (have a look at the README he attached to a post).

FireFox OS for Raspberry Pi

A guy called Philipp Wagner has released a FireFox-based software stack for the Raspberry Pi, which operates without using the X server! It is a mixture of Linux and OpenGL which he runs on top of.

Apparently, right now, there is no input support for mouse / keyboard, but this could be great for digital signage-class systems.

If you like his work, you can get him something nice from his Amazon wishlist Winking smile

I’ll be testing the performance of the FireFox OS after I post this, and will report back in the comments.

Optimization WordPress Plugins & Solutions by W3 EDGE