Fluendo mp3 decoder: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
m (Added mention of multimedia rather than only MP3.)
 
(26 intermediate revisions by 11 users not shown)
Line 1: Line 1:
The MP3 decoder shared object file, <tt>libgstflump3dec.so</tt>, is no longer available from [http://www.fluendo.com/ Fluendo]. For multimedia capabilities including MP3, add [http://en.wikipedia.org/wiki/GStreamer gstreamer] according to the [[GStreamer|instructions]].

{{proprietary}}
{{proprietary}}


==Deprecated Introduction==


The majority of podcasts are made available as mp3 files, which cannot be viewed by the OLPC by default. To enable mp3 playback, an extra codec has to be installed.
The majority of podcasts are made available as mp3 files, which cannot be viewed by the OLPC by default. To enable mp3 playback, an extra codec has to be installed.


[https://shop.fluendo.com/ Fluendo] has made available a [http://en.wikipedia.org/wiki/Gratis_versus_Libre free (as in beer)] codec, with a free (as in speech) implementation with a paid up license for the Gstreamer code framework. This requires execution of a [http://www.fluendo.com/resources/fluendo_mp3.php license agreement for redistribution]; unfortunately, the agreement does not permit sub-licensing, so while including it would be convenient and OLPC may choose to execute this agreement in the future, those redistributing our software would still have to execute this agreement to legally redistribute the codec.
[http://www.fluendo.com/ Fluendo] has made available a [http://en.wikipedia.org/wiki/Gratis_versus_Libre free (as in beer)] codec, with a free (as in speech) implementation with a paid up license for the [[GStreamer]] code framework. This requires execution of a [http://www.fluendo.com/resources/fluendo_mp3.php license agreement for redistribution]; unfortunately, the agreement does not permit sub-licensing, so while including it would be convenient and OLPC may choose to execute this agreement in the future, those redistributing our software would still have to execute this agreement to legally redistribute the codec.



==Scripted Installation==
==Installation==
su
Your goal is to obtain a driver file, <tt>libgstflump3dec.so</tt>, from a download and to copy or move the file into the directory <tt>/usr/lib/gstreamer-0.10</tt> on the XO. The following instructions worked for the XO-1 and the XO-1.5 with releases 11.3.0 and 13.2.0. The archive is no longer available from fluendo.com via the specified link and at 2014-10-01 the instructions no longer work. For release 13.2.1 refer to the discussion page.

The Fluendo MP3 decoder was free from http://www.fluendo.com/shop/product/fluendo-mp3-decoder/. After registering and "purchasing" at zero price, "package for Linux generic i386" could be retrieved. The retrieved archive file was named '''fluendo-mp3-''versionNN''.i386.tar.bz2'''. Note that in Firefox in the Gnome environment on the XO, automated retrieval brought '''fluendo-codecs-mp3-''versionNN''.i386.rpm''' which did not work. An effective method was to retrieve the '''tar.bz2''' file to another PC and move it to the XO with a USB flash drive.

=== Installation steps using USB flash drive ===

If you "purchased" onto another PC, then transfer the file '''fluendo-mp3-''versionNN''.i386.tar.bz2''' to your XO (e.g. using a USB flash drive), then unpack it into a temp directory on your XO.

In [[Terminal activity]], one set of commands to do so is:
mkdir tempmp3
mkdir tempmp3
cd tempmp3
cd tempmp3
wget "http://shop.fluendo.com/pub/fluendo-mp3-1.i386.tar.bz2"
tar -jxvf /media/''USB_DRIVE_NAME''/fluendo-mp3-''versionNN''.i386.tar.bz2
sudo mv -i codecs/libgstflump3dec.so /usr/lib/gstreamer-0.10/
tar -jxvf fluendo-mp3-1.i386.tar.bz2
mv fluendo-mp3-i386/libgstflump3dec.so /usr/lib/gstreamer-0.10/
cd -
cd -
rm -r tempmp3
rm -r tempmp3


You should now be able to play MP3s using [[totem]] from the command line, gst commands on the command line, and by clicking .mp3 URLs in Browse.
==Installation==


To verify that GStreamer can find the codec, enter
In order to download the codec you have to "buy" the Fluendo mp3 decoder from their store for $0.00 from [https://shop.fluendo.com/ here].
gst-inspect flump3dec
Unless this command reports back "No such element or plugin 'flump3dec", the codec should be successfully installed.


Note that the Fluendo MP3 codec will be lost from <tt>/usr/lib/gstreamer-0.10</tt> the next time you upgrade to a new OS build, so you will have to repeat this process.
You are then allowed to download the file '''fluendo-mp3-2.i386.tar.bz2'''


=== Associating MP3 files with Browse in the Journal ===
It is easier to use a web browser such as [[Opera]] that allows you to save files to the filesystem, instead of saving to the Journal. Nevertheless, you can retrieve it from the Journal if you download with the default web browser [[Browse]]:
The [[Totem]] plug-in tells [[Browse]] that it can play MP3 files even if you don't have the necessary codec installed, as you can verify by entering <tt>about:plugins</tt> in Browse's location field.


However, Browse does not tell the Journal that it can handle the MP3 mime type. Even after installing the codec, if you download an MP3 file to the Journal, or if you browse a USB flash drive containing MP3 files in the Journal, the Journal will not know how to Start the file. To associate .mp3 files with the Browse activity, you can edit its <tt>activity.info</tt> file to add <tt>audio/mpeg</tt> to its list of supported mimetypes. One way to do so:
Go to the datastore:
# enter <tt>nano -w ~/Activities/Browse.activity/activity/activity.info</tt> in [[Terminal activity]] to edit the file
# navigate to the end of the <tt>mime_types</tt> line and add <tt>;audio/mpeg</tt> (note the semicolon)
# press Ctrl+X to exit, saving the file.
# restart Sugar by pressing Ctrl+Alt+Erase, or by [[reboot|rebooting]]
Now .mp3 files in the Journal should display the Browse icon, and start Browse when you click them.


=== Avoiding other installation directories ===
cd ~/.sugar/default/datastore/store/
GStreamer also looks for codecs in <tt>~/.gstreamer-0.10/plugins</tt>. ''However'', if you put the codec in here, you will not be able to play .mp3s in Browse, probably due to [[Rainbow]]'s activity isolation.


==Detailed installation on the XO==
and find out which filename is the plugin:


In order to download the codec you have to "buy" the Fluendo mp3 decoder from their store for $0.00.
file * | grep bzip2


You are then allowed to download the file '''fluendo-mp3-''versionNN''.i386.tar.bz2'''
It's highly likely that you will only get one result. Copy the file to your home directory, while giving it a more sensible name:


It is easier to use a web browser such as [[Opera]] that allows you to save files to the filesystem, instead of saving to the Journal. Nevertheless, you can retrieve it from the Journal if you download with the default web browser [[Browse]]:
cp filename_found_in_datastore ~/fluendo-mp3.tar.bz2
Having the file now, unzip it with [[bunzip2]] and [[tar]]:


In [[Terminal activity]], become the [[root]] user.
bunzip2 filename.tar.bz2
tar xvf filename.tar


Go to the datastore:
Create a plugins directory for gstreamer:
cd ~/.sugar/default/datastore/store/
mkdir ~/.gstreamer-0.10/plugins
and find out which filename is the plugin:
and copy the file '''libgstflump3dec.so''' to it:
file * | grep bzip2
cp ~/fluendo-mp3-i386/libgstflump3dec.so ~/.gstreamer-0.10/plugins


It's highly likely that you will only get one result. Copy the file to your home directory, while giving it a more sensible name:
Or you can instead copy it to
/usr/lib/gstreamer-0.10


cd ~olpc
If you use this second position then the plugin will be lost the next time you upgrade to a new OS build.
mkdir tempmp3
cd tempmp3
cp ''filename_found_in_datastore'' fluendo-mp3.tar.bz2
Having the file now, unzip it with [[tar]]:


tar -jxvf fluendo-mp3.tar.bz2
Once it is copied over, verify that gstreamer recognises the plugin by doing a 'gst-inspect-0.10 flump3dec'.


As in the main example above, move the file '''libgstflump3dec.so''' to <tt>/usr/lib/gstreamer-0.10</tt>:
Unless this command reports back 'No such element or plugin 'flump3dec' the plugin should be sucessfully installed and you should have access to playing back MP3 files using GStreamer applications.
mv -i codecs/libgstflump3dec.so /usr/lib/gstreamer-0.10


== To playback a file ==
== To playback a file ==
*In [[Terminal activity]],
gst-launch-0.10 playbin uri=file:///''path/to/file.mp3''
* or to have a user interface
totem ''path/to/file''.mp3
* or navigate to it in Browse to run [[totem]] as a browser plug-in


[[Category:Audio]]
gst-launch-0.10 playbin uri=file:///path/to/file.mp3

Latest revision as of 12:14, 27 October 2014

The MP3 decoder shared object file, libgstflump3dec.so, is no longer available from Fluendo. For multimedia capabilities including MP3, add gstreamer according to the instructions.

This page describes third-party software that does not meet the OLPC standards for software freedom. The use of such software is unsupported; OLPC does not endorse or encourage its use.


Deprecated Introduction

The majority of podcasts are made available as mp3 files, which cannot be viewed by the OLPC by default. To enable mp3 playback, an extra codec has to be installed.

Fluendo has made available a free (as in beer) codec, with a free (as in speech) implementation with a paid up license for the GStreamer code framework. This requires execution of a license agreement for redistribution; unfortunately, the agreement does not permit sub-licensing, so while including it would be convenient and OLPC may choose to execute this agreement in the future, those redistributing our software would still have to execute this agreement to legally redistribute the codec.


Installation

Your goal is to obtain a driver file, libgstflump3dec.so, from a download and to copy or move the file into the directory /usr/lib/gstreamer-0.10 on the XO. The following instructions worked for the XO-1 and the XO-1.5 with releases 11.3.0 and 13.2.0. The archive is no longer available from fluendo.com via the specified link and at 2014-10-01 the instructions no longer work. For release 13.2.1 refer to the discussion page.

The Fluendo MP3 decoder was free from http://www.fluendo.com/shop/product/fluendo-mp3-decoder/. After registering and "purchasing" at zero price, "package for Linux generic i386" could be retrieved. The retrieved archive file was named fluendo-mp3-versionNN.i386.tar.bz2. Note that in Firefox in the Gnome environment on the XO, automated retrieval brought fluendo-codecs-mp3-versionNN.i386.rpm which did not work. An effective method was to retrieve the tar.bz2 file to another PC and move it to the XO with a USB flash drive.

Installation steps using USB flash drive

If you "purchased" onto another PC, then transfer the file fluendo-mp3-versionNN.i386.tar.bz2 to your XO (e.g. using a USB flash drive), then unpack it into a temp directory on your XO.

In Terminal activity, one set of commands to do so is:

mkdir tempmp3
cd tempmp3 
tar -jxvf /media/USB_DRIVE_NAME/fluendo-mp3-versionNN.i386.tar.bz2 
sudo mv -i codecs/libgstflump3dec.so /usr/lib/gstreamer-0.10/
cd -
rm -r tempmp3

You should now be able to play MP3s using totem from the command line, gst commands on the command line, and by clicking .mp3 URLs in Browse.

To verify that GStreamer can find the codec, enter

gst-inspect flump3dec

Unless this command reports back "No such element or plugin 'flump3dec", the codec should be successfully installed.

Note that the Fluendo MP3 codec will be lost from /usr/lib/gstreamer-0.10 the next time you upgrade to a new OS build, so you will have to repeat this process.

Associating MP3 files with Browse in the Journal

The Totem plug-in tells Browse that it can play MP3 files even if you don't have the necessary codec installed, as you can verify by entering about:plugins in Browse's location field.

However, Browse does not tell the Journal that it can handle the MP3 mime type. Even after installing the codec, if you download an MP3 file to the Journal, or if you browse a USB flash drive containing MP3 files in the Journal, the Journal will not know how to Start the file. To associate .mp3 files with the Browse activity, you can edit its activity.info file to add audio/mpeg to its list of supported mimetypes. One way to do so:

  1. enter nano -w ~/Activities/Browse.activity/activity/activity.info in Terminal activity to edit the file
  2. navigate to the end of the mime_types line and add ;audio/mpeg (note the semicolon)
  3. press Ctrl+X to exit, saving the file.
  4. restart Sugar by pressing Ctrl+Alt+Erase, or by rebooting

Now .mp3 files in the Journal should display the Browse icon, and start Browse when you click them.

Avoiding other installation directories

GStreamer also looks for codecs in ~/.gstreamer-0.10/plugins. However, if you put the codec in here, you will not be able to play .mp3s in Browse, probably due to Rainbow's activity isolation.

Detailed installation on the XO

In order to download the codec you have to "buy" the Fluendo mp3 decoder from their store for $0.00.

You are then allowed to download the file fluendo-mp3-versionNN.i386.tar.bz2

It is easier to use a web browser such as Opera that allows you to save files to the filesystem, instead of saving to the Journal. Nevertheless, you can retrieve it from the Journal if you download with the default web browser Browse:

In Terminal activity, become the root user.

Go to the datastore:

cd ~/.sugar/default/datastore/store/

and find out which filename is the plugin:

file * | grep bzip2

It's highly likely that you will only get one result. Copy the file to your home directory, while giving it a more sensible name:

cd ~olpc
mkdir tempmp3
cd tempmp3
cp filename_found_in_datastore fluendo-mp3.tar.bz2
 

Having the file now, unzip it with tar:

tar -jxvf fluendo-mp3.tar.bz2

As in the main example above, move the file libgstflump3dec.so to /usr/lib/gstreamer-0.10:

mv -i codecs/libgstflump3dec.so /usr/lib/gstreamer-0.10

To playback a file

gst-launch-0.10 playbin uri=file:///path/to/file.mp3
  • or to have a user interface
totem path/to/file.mp3
  • or navigate to it in Browse to run totem as a browser plug-in