Difference between revisions of "Java/Java Media Framework"
(→Extending JMF) |
(→Troubleshooting) |
||
(16 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
− | On Linux and other Unix-like | + | On Linux and other Unix-like systems, |
− | OpenOffice.org requires to install the <b>Java Media Framework</b> in order to play sound and video. | + | OpenOffice.org requires to install the <b>Java Media Framework (JMF)</b> in order to play sound and video. |
− | This page explains how to install the <b>Java Media Framework</b> and | + | This page explains how to install the <b>Java Media Framework</b> and how to configure it for OpenOffice.org. |
− | = Download = | + | == Download == |
First we will download the required software. In the following examples, we suppose you download it to the usual directory (on Linux, it's named /home/user/Download [replace 'user' with your user name], although it may vary according to your locale - in Spanish, for example, it's /home/user/Descargas). | First we will download the required software. In the following examples, we suppose you download it to the usual directory (on Linux, it's named /home/user/Download [replace 'user' with your user name], although it may vary according to your locale - in Spanish, for example, it's /home/user/Descargas). | ||
− | Download the <b>JMF Performance Pack</b> for Linux from | + | Download the <b>JMF Performance Pack</b> for Linux from Oracle's site: |
− | http:// | + | http://www.oracle.com/technetwork/java/javase/download-142937.html |
Do not choose the *.zip version, but the *.bin (the latest is named <b>jmf-2_1_1e-linux-i586.bin</b>). | Do not choose the *.zip version, but the *.bin (the latest is named <b>jmf-2_1_1e-linux-i586.bin</b>). | ||
− | And download also the <b>JMF MP3 Plugin</b>, if you are interested in mp3 support (a quite common format nowadays). You can find it also in | + | And download also the <b>JMF MP3 Plugin</b>, if you are interested in mp3 support (a quite common format nowadays). You can find it also in Oracle's site: |
− | http:// | + | http://www.oracle.com/technetwork/java/javase/download-137625.html |
− | = Installation = | + | == Installation == |
− | In this section we explain how to install the JMF. Instead of following the guidelines given in Sun's site, we try show a more simple way. | + | In this section we explain how to install the JMF. Instead of following the guidelines given in Sun's site, we try to show a more simple way. |
− | First we give the instructions to install the software for the current user only. If you are interested in installing the JMF system-wide, follow the same instructions, you will only need to add then a few extra steps. | + | First, we give the instructions to install the software for the current user only. If you are interested in installing the JMF system-wide, follow the same instructions, you will only need to add then a few extra steps. |
− | == Single user == | + | === Single user === |
− | === Java Media Framework === | + | ==== Java Media Framework ==== |
We suppose you have downloaded the required software in /home/user/Download. | We suppose you have downloaded the required software in /home/user/Download. | ||
Line 65: | Line 65: | ||
The license text will be displayed on your terminal screen. | The license text will be displayed on your terminal screen. | ||
− | Scroll down the license by pressing | + | Scroll down the license by pressing Enter, until you reach the agreement question: |
<pre> | <pre> | ||
Line 72: | Line 72: | ||
Type <code>yes</code> to accept it. | Type <code>yes</code> to accept it. | ||
− | You will be asked with two more | + | You will be asked with two more questions. Answer <code>no</code> to them: |
<pre> | <pre> | ||
Line 127: | Line 127: | ||
Next step is installing the mp3 plug-in, if you want support for mp3 files. | Next step is installing the mp3 plug-in, if you want support for mp3 files. | ||
− | === JMF MP3 plug-in === | + | ==== JMF MP3 plug-in ==== |
Change the current directory to the place where you downloaded the plug-in zip file (latest version is named <b>javamp3-1_0.zip</b>): | Change the current directory to the place where you downloaded the plug-in zip file (latest version is named <b>javamp3-1_0.zip</b>): | ||
Line 165: | Line 165: | ||
</source> | </source> | ||
− | === JMF Configuration === | + | ==== JMF Configuration ==== |
Once moved to our home directory, we are ready to launch the JMStudio, test the configuration, and add the mp3 plug-in. | Once moved to our home directory, we are ready to launch the JMStudio, test the configuration, and add the mp3 plug-in. | ||
Line 171: | Line 171: | ||
To launch the JMStudio, type the following: | To launch the JMStudio, type the following: | ||
− | < | + | <syntaxhighlight lang="bash"> |
[user@localhost Download]$ cd ~/JMF-2.1.1e/bin/ | [user@localhost Download]$ cd ~/JMF-2.1.1e/bin/ | ||
[user@localhost ~]$ ./jmstudio | [user@localhost ~]$ ./jmstudio | ||
− | </ | + | </syntaxhighlight> |
+ | |||
You will see a window like the following: | You will see a window like the following: | ||
− | [[Image:OOo_JavaMediaFramework_JMStudio.png |Java Media Studio]] | + | [[Image:OOo_JavaMediaFramework_JMStudio.png|none|thumb|200px| Java Media Studio]] |
+ | |||
+ | Select the menu '''File > Preferences''' to open the JMF Registry Editor. | ||
+ | In the '''Capture device''' tab, there may be at least the JavaSound audio capture. If not, press '''Detect Capture Devices'''. Problems in this area may be related to your hardware and/or operating system, you should contact their support in case of troubles. | ||
+ | |||
+ | In the '''Plugins''' tab, select '''Codec'''; enter <code>com.sun.media.codec.audio.mp3.JavaDecoder</code>. Press '''Add''', and then '''Commit'''. | ||
− | |||
− | |||
− | + | [[Image:OOo_JavaMediaFramework_JMFRegistry.png|none|thumb|650px| JMF Registry Editor]] | |
− | + | If nothing went wrong, close the JMF Registry Editor. You could now play an mp3 audio file. | |
+ | But if a "JMF Registry Error" window pops up displaying an error message ("Could not add item"), and the terminal outputs "java.lang.ClassNotFoundException", then you must close the JMStudio and set some environment variables, then restart the JMStudio and add the mp3 codec as explained above: | ||
− | + | <syntaxhighlight lang="bash"> | |
+ | user@localhost:~/JMF-2.1.1e/bin$ ./jmstudio | ||
+ | java.lang.ClassNotFoundException | ||
+ | user@localhost:~/JMF-2.1.1e/bin$ export JMFHOME=/home/user/JMF-2.1.1e | ||
+ | user@localhost:~/JMF-2.1.1e/bin$ export CLASSPATH=$JMFHOME/lib/jmf.jar:$JMFHOME/lib/mp3plugin.jar:$CLASSPATH | ||
+ | user@localhost:~/JMF-2.1.1e/bin$ export LD_LIBRARY_PATH=$JMFHOME/lib:$LD_LIBRARY_PATH | ||
+ | user@localhost:~/JMF-2.1.1e/bin$ ./jmstudio | ||
+ | </syntaxhighlight> | ||
If you have followed these steps, you should be able to configure now OpenOffice.org to use the JMF. Notice that if you want the JMF to be accessible for other (Java) applications, like web applets, you should set some environment variables. Read the following section for instructions. | If you have followed these steps, you should be able to configure now OpenOffice.org to use the JMF. Notice that if you want the JMF to be accessible for other (Java) applications, like web applets, you should set some environment variables. Read the following section for instructions. | ||
− | == Multi-user == | + | === Multi-user === |
If you want to install the JMF system-wide, so that it is available for every user, follow the same steps as above, and move the <code>~/JMF-2.1.1e</code> folder from your home to a system-wide location. We will choose <code>/opt</code>. Notice that setting up the JMF will require then root privileges. | If you want to install the JMF system-wide, so that it is available for every user, follow the same steps as above, and move the <code>~/JMF-2.1.1e</code> folder from your home to a system-wide location. We will choose <code>/opt</code>. Notice that setting up the JMF will require then root privileges. | ||
Line 199: | Line 211: | ||
Then move the JMF to its new location (don't forget to replace 'user' with your user directory name): | Then move the JMF to its new location (don't forget to replace 'user' with your user directory name): | ||
− | < | + | <syntaxhighlight lang="bash"> |
[root@localhost ~]$ mv /home/user/JMF-2.1.1e /opt/ | [root@localhost ~]$ mv /home/user/JMF-2.1.1e /opt/ | ||
− | </ | + | </syntaxhighlight> |
Create a symbolic link to reference in the environment variables (this way it's easier to update): | Create a symbolic link to reference in the environment variables (this way it's easier to update): | ||
− | < | + | <syntaxhighlight lang="bash"> |
[root@localhost ~]$ ln -s /opt/JMF-2.1.1e /opt/JMF | [root@localhost ~]$ ln -s /opt/JMF-2.1.1e /opt/JMF | ||
− | </ | + | </syntaxhighlight> |
Next we have to set global environment variables. We do so by editing (or creating, in case it doesn't exist) a file named <code>java.sh</code> in <code>/etc/profile.d/java.sh</code>, with the following content: | Next we have to set global environment variables. We do so by editing (or creating, in case it doesn't exist) a file named <code>java.sh</code> in <code>/etc/profile.d/java.sh</code>, with the following content: | ||
− | < | + | <syntaxhighlight lang="bash"> |
export JAVA_HOME=/opt/jdk | export JAVA_HOME=/opt/jdk | ||
export JMFHOME=/opt/JMF | export JMFHOME=/opt/JMF | ||
Line 217: | Line 229: | ||
export LD_LIBRARY_PATH=$JMFHOME/lib:$LD_LIBRARY_PATH | export LD_LIBRARY_PATH=$JMFHOME/lib:$LD_LIBRARY_PATH | ||
export PATH=$JAVA_HOME/bin:$JMFHOME/bin:$PATH | export PATH=$JAVA_HOME/bin:$JMFHOME/bin:$PATH | ||
− | </ | + | </syntaxhighlight> |
− | Change <code>JAVA_HOME</code> to the location of the JRE (or JDK). Later we | + | Change <code>JAVA_HOME</code> to the location of the JRE (or JDK). Later we will talk about <code>fobs4jmf.jar</code>. Note that every <code>export</code> command must be in only one line; if the Wiki engine changes that when laying out this page, please write your <code>/etc/profile.d/java.sh</code> removing the extra line breaks if you copy and paste from here. |
After rebooting your system, every user could type <code>jmstudio</code> from the command line to launch the JMStudio, with no need to this from the installation directory (<code>/opt/JMF-2.1.1e/bin/</code>). | After rebooting your system, every user could type <code>jmstudio</code> from the command line to launch the JMStudio, with no need to this from the installation directory (<code>/opt/JMF-2.1.1e/bin/</code>). | ||
+ | == OpenOffice Configuration == | ||
− | + | Before being able to use the Java Media Framework to reproduce audio and video in OpenOffice, you must add the JMF library folder to the class path of the Java Virtual Machine launched by OpenOffice.org. You do so with the dialog under '''Tools > Options''': | |
− | + | [[Image:OOo_JavaMediaFramework_Tools_Options_Java.png|none|thumb|600px| Tools > Options dialog, Java settings.]] | |
− | |||
− | Press the "Class Path" button, and add the JMF library folder (if you have | + | Press the "Class Path" button, and add the JMF library folder (if you have chosen the system-wide installation, it is <code>/opt/JMF/lib</code>; if you have installed the JMF just in your home directory, it is <code>/home/user/JMF-2.1.1e/lib</code>). |
− | [[Image:OOo_JavaMediaFramework_Tools_Options_Java_Classpath.png]] | + | [[Image:OOo_JavaMediaFramework_Tools_Options_Java_Classpath.png|none|thumb|500px| Java class path settings.]] |
− | |||
− | + | You will need to restart OpenOffice for these changes to take effect. | |
− | + | [[Image:OOo_JavaMediaFramework_Tools_Options_Java_Restart.png|none|thumb|600px| ]] | |
− | |||
+ | After restart, you should be able to play audio and sound supported by JMF. You can try playing one of the sounds from the gallery: | ||
− | = Troubleshooting = | + | |
+ | [[Image:OOo_JavaMediaFramework_GalleryMediaPlayer.png|none|thumb|700px| Media Player]] | ||
+ | |||
+ | == Troubleshooting == | ||
If you get an error similar to the following: | If you get an error similar to the following: | ||
Line 261: | Line 275: | ||
First we have to clear things up, because this error corrupts the installer file. You can test this by checking its size: | First we have to clear things up, because this error corrupts the installer file. You can test this by checking its size: | ||
− | < | + | <syntaxhighlight lang="bash"> |
[user@localhost ~]$ cd Download/JMF/ | [user@localhost ~]$ cd Download/JMF/ | ||
[user@localhost JMF]$ ls -l . | [user@localhost JMF]$ ls -l . | ||
Line 267: | Line 281: | ||
-rwxrw-r-- 1 user user 4022 ene 21 09:44 install.sfx.25050 | -rwxrw-r-- 1 user user 4022 ene 21 09:44 install.sfx.25050 | ||
-rwxr-xr-x 1 user user 0 ene 21 09:44 jmf-2_1_1e-linux-i586.bin | -rwxr-xr-x 1 user user 0 ene 21 09:44 jmf-2_1_1e-linux-i586.bin | ||
− | </ | + | </syntaxhighlight> |
So remove everything and copy back the file downloaded: | So remove everything and copy back the file downloaded: | ||
− | < | + | <syntaxhighlight lang="bash"> |
[user@localhost JMF]$ rm -f * | [user@localhost JMF]$ rm -f * | ||
[user@localhost JMF]$ cp ../jmf-2_1_1e-linux-i586.bin . | [user@localhost JMF]$ cp ../jmf-2_1_1e-linux-i586.bin . | ||
[user@localhost JMF]$ chmod +x jmf-2_1_1e-linux-i586.bin | [user@localhost JMF]$ chmod +x jmf-2_1_1e-linux-i586.bin | ||
− | </ | + | </syntaxhighlight> |
Open the file with vim in binary mode: | Open the file with vim in binary mode: | ||
− | < | + | <syntaxhighlight lang="bash"> |
[user@localhost JMF]$ vim -b jmf-2_1_1e-linux-i586.bin | [user@localhost JMF]$ vim -b jmf-2_1_1e-linux-i586.bin | ||
− | </ | + | </syntaxhighlight> |
+ | |||
+ | |||
+ | [[Image:OOo_JavaMediaFramework_issue_vim_1.png|none|thumb|700px| ]] | ||
− | |||
In the vim editor, type <code>/tail</code> and press ENTER to look for the line to be fixed: | In the vim editor, type <code>/tail</code> and press ENTER to look for the line to be fixed: | ||
− | [[Image:OOo_JavaMediaFramework_issue_vim_2.png]] | + | |
+ | [[Image:OOo_JavaMediaFramework_issue_vim_2.png|none|thumb|700px| ]] | ||
+ | |||
This will find the problematic line. | This will find the problematic line. | ||
− | [[Image:OOo_JavaMediaFramework_issue_vim_3.png]] | + | |
+ | [[Image:OOo_JavaMediaFramework_issue_vim_3.png|none|thumb|700px| ]] | ||
+ | |||
Then press the key l to move to the left on that line, until the sign +. | Then press the key l to move to the left on that line, until the sign +. | ||
Line 297: | Line 317: | ||
Press i to insert text, and insert <code>-n </code>, with a space | Press i to insert text, and insert <code>-n </code>, with a space | ||
− | [[Image:OOo_JavaMediaFramework_issue_vim_4.png]] | + | |
+ | [[Image:OOo_JavaMediaFramework_issue_vim_4.png|none|thumb|700px| ]] | ||
+ | |||
Press ESC to stop inserting, and type <code>:wq</code> to write the changes and quit. | Press ESC to stop inserting, and type <code>:wq</code> to write the changes and quit. | ||
− | = Extending JMF = | + | == Extending JMF == |
Sun's Java Media Framework comes with support for few formats. You can extend it by installing Fobs4JMF, which is a JMF wrapper for the popular ffmpeg, it can play the most common formats and codecs (ogg, mp3, m4a, divx, xvid, h264, mov, avi, etc): | Sun's Java Media Framework comes with support for few formats. You can extend it by installing Fobs4JMF, which is a JMF wrapper for the popular ffmpeg, it can play the most common formats and codecs (ogg, mp3, m4a, divx, xvid, h264, mov, avi, etc): | ||
Line 313: | Line 335: | ||
Once compiled, you don't need to install anything, you just have to copy fobs4jmf.jar and libfobs4jmf.so in /opt/JMF/lib/. | Once compiled, you don't need to install anything, you just have to copy fobs4jmf.jar and libfobs4jmf.so in /opt/JMF/lib/. | ||
− | TODO: not very complicated explanation of how to compile it (at least in Ubuntu) on people's demand. | + | TODO: not very complicated explanation of how to compile it (at least in Ubuntu) on people's demand... |
+ | See Discussion tab, where this request has been requested, of those able to do, and thanks! | ||
+ | |||
+ | [[Category:Java]] | ||
+ | [[Category:Documentation/How Tos/Installation]] | ||
+ | [[Category:Documentation/Setup]] |
Latest revision as of 13:55, 31 August 2022
On Linux and other Unix-like systems, OpenOffice.org requires to install the Java Media Framework (JMF) in order to play sound and video.
This page explains how to install the Java Media Framework and how to configure it for OpenOffice.org.
Contents
Download
First we will download the required software. In the following examples, we suppose you download it to the usual directory (on Linux, it's named /home/user/Download [replace 'user' with your user name], although it may vary according to your locale - in Spanish, for example, it's /home/user/Descargas).
Download the JMF Performance Pack for Linux from Oracle's site:
http://www.oracle.com/technetwork/java/javase/download-142937.html
Do not choose the *.zip version, but the *.bin (the latest is named jmf-2_1_1e-linux-i586.bin).
And download also the JMF MP3 Plugin, if you are interested in mp3 support (a quite common format nowadays). You can find it also in Oracle's site:
http://www.oracle.com/technetwork/java/javase/download-137625.html
Installation
In this section we explain how to install the JMF. Instead of following the guidelines given in Sun's site, we try to show a more simple way. First, we give the instructions to install the software for the current user only. If you are interested in installing the JMF system-wide, follow the same instructions, you will only need to add then a few extra steps.
Single user
Java Media Framework
We suppose you have downloaded the required software in /home/user/Download. Open a terminal (in the Gnome desktop it is called gnome-terminal, in KDE it is the Konsole), and change the current directory to the place where you downloaded the software:
[user@localhost ~]$ cd Download
Create a new directory to unpack the software. We name it JMF:
[user@localhost Download]$ mkdir JMF
Copy the JMF Performance Pack binary in that directory (it is better to work with a copy of the downloaded file, because there may be problems during the installation, as several users have reported).
[user@localhost Download]$ cp jmf-2_1_1e-linux-i586.bin JMF/jmf-2_1_1e-linux-i586.bin
Change the working directory to JMF:
[user@localhost Download]$ cd JMF
Now change the file mode to make it executable:
[user@localhost JMF]$ chmod +x jmf-2_1_1e-linux-i586.bin
And execute the "installer" (you don't need root privileges because it will only unpack the files in the current directory, instead of installing them):
[user@localhost JMF]$ ./jmf-2_1_1e-linux-i586.bin
The license text will be displayed on your terminal screen. Scroll down the license by pressing Enter, until you reach the agreement question:
Do you agree to the above license terms? [yes or no]
Type yes
to accept it.
You will be asked with two more questions. Answer no
to them:
Permit recording from an applet? (see readme.html) [yes or no] no Permit writing local files from an applet? (recommend no, see readme.html) [yes or no] no
After answering to these questions, the unpacking process will start.
At this point, you may get an error similar to the following:
Unpacking... tail: cannot open `+309' for reading: No such file or directory Extracting... ./install.sfx.25050: line 1: ==: No such file or directory ./install.sfx.25050: line 3: syntax error near unexpected token `)'
If so, please refer to the "Troubleshooting" section below.
The JMF will try to find the devices in your system. Don't panic if you get some messages telling that it couldn't open some devices:
java.lang.Error: Can't open video card 1 java.lang.Error: Can't open video card 2 java.lang.Error: Can't open video card 3 java.lang.Error: Can't open video card 4 java.lang.Error: Can't open video card 5 java.lang.Error: Can't open video card 6 ...
The important thing is that it finds your sound card (and video card, in case you have one). You can check this later from within the JMStudio, installed with the JMF.
If everything went good, the JMF should be unpacked in /home/user/Download/JMF/JMF-2.1.1e/
.
Now we can move the JMF folder to a permanent location in our home directory:
[user@localhost Download]$ mv JMF/JMF-2.1.1e ~/
Finally, we can remove the temporal folder:
[user@localhost Download]$ rm -rf JMF
Next step is installing the mp3 plug-in, if you want support for mp3 files.
JMF MP3 plug-in
Change the current directory to the place where you downloaded the plug-in zip file (latest version is named javamp3-1_0.zip):
[user@localhost ~]$ cd Download
Create a new directory to unpack it. We name it JAVAMP3:
[user@localhost Download]$ mkdir JAVAMP3
Extract the zip file inside this new folder:
[user@localhost Download]$ unzip javamp3-1_0.zip -d JAVAMP3/ Archive: javamp3-1_0.zip inflating: JAVAMP3/copyright.txt inflating: JAVAMP3/license.txt creating: JAVAMP3/lib/ creating: JAVAMP3/lib/ext/ inflating: JAVAMP3/lib/ext/mp3plugin.jar
Then copy the plug-in Java Archive (mp3plugin.jar) inside the JMF folder, together with the other JARs (/home/user/JMF-2.1.1e/lib/):
[user@localhost Download]$ cp JAVAMP3/lib/ext/mp3plugin.jar ~/JMF-2.1.1e/lib/
Finally, we can remove the temporal folder:
[user@localhost Download]$ rm -rf JAVAMP3
JMF Configuration
Once moved to our home directory, we are ready to launch the JMStudio, test the configuration, and add the mp3 plug-in.
To launch the JMStudio, type the following:
[user@localhost Download]$ cd ~/JMF-2.1.1e/bin/ [user@localhost ~]$ ./jmstudio
You will see a window like the following:
Select the menu File > Preferences to open the JMF Registry Editor. In the Capture device tab, there may be at least the JavaSound audio capture. If not, press Detect Capture Devices. Problems in this area may be related to your hardware and/or operating system, you should contact their support in case of troubles.
In the Plugins tab, select Codec; enter com.sun.media.codec.audio.mp3.JavaDecoder
. Press Add, and then Commit.
If nothing went wrong, close the JMF Registry Editor. You could now play an mp3 audio file. But if a "JMF Registry Error" window pops up displaying an error message ("Could not add item"), and the terminal outputs "java.lang.ClassNotFoundException", then you must close the JMStudio and set some environment variables, then restart the JMStudio and add the mp3 codec as explained above:
user@localhost:~/JMF-2.1.1e/bin$ ./jmstudio java.lang.ClassNotFoundException user@localhost:~/JMF-2.1.1e/bin$ export JMFHOME=/home/user/JMF-2.1.1e user@localhost:~/JMF-2.1.1e/bin$ export CLASSPATH=$JMFHOME/lib/jmf.jar:$JMFHOME/lib/mp3plugin.jar:$CLASSPATH user@localhost:~/JMF-2.1.1e/bin$ export LD_LIBRARY_PATH=$JMFHOME/lib:$LD_LIBRARY_PATH user@localhost:~/JMF-2.1.1e/bin$ ./jmstudio
If you have followed these steps, you should be able to configure now OpenOffice.org to use the JMF. Notice that if you want the JMF to be accessible for other (Java) applications, like web applets, you should set some environment variables. Read the following section for instructions.
Multi-user
If you want to install the JMF system-wide, so that it is available for every user, follow the same steps as above, and move the ~/JMF-2.1.1e
folder from your home to a system-wide location. We will choose /opt
. Notice that setting up the JMF will require then root privileges.
Open a terminal, type su
and enter the system administrator password.
Then move the JMF to its new location (don't forget to replace 'user' with your user directory name):
[root@localhost ~]$ mv /home/user/JMF-2.1.1e /opt/
Create a symbolic link to reference in the environment variables (this way it's easier to update):
[root@localhost ~]$ ln -s /opt/JMF-2.1.1e /opt/JMF
Next we have to set global environment variables. We do so by editing (or creating, in case it doesn't exist) a file named java.sh
in /etc/profile.d/java.sh
, with the following content:
export JAVA_HOME=/opt/jdk export JMFHOME=/opt/JMF export CLASSPATH=$JMFHOME/lib/jmf.jar:$JMFHOME/lib/mp3plugin.jar:$JMFHOME/lib/fobs4jmf.jar:$CLASSPATH export LD_LIBRARY_PATH=$JMFHOME/lib:$LD_LIBRARY_PATH export PATH=$JAVA_HOME/bin:$JMFHOME/bin:$PATH
Change JAVA_HOME
to the location of the JRE (or JDK). Later we will talk about fobs4jmf.jar
. Note that every export
command must be in only one line; if the Wiki engine changes that when laying out this page, please write your /etc/profile.d/java.sh
removing the extra line breaks if you copy and paste from here.
After rebooting your system, every user could type jmstudio
from the command line to launch the JMStudio, with no need to this from the installation directory (/opt/JMF-2.1.1e/bin/
).
OpenOffice Configuration
Before being able to use the Java Media Framework to reproduce audio and video in OpenOffice, you must add the JMF library folder to the class path of the Java Virtual Machine launched by OpenOffice.org. You do so with the dialog under Tools > Options:
Press the "Class Path" button, and add the JMF library folder (if you have chosen the system-wide installation, it is /opt/JMF/lib
; if you have installed the JMF just in your home directory, it is /home/user/JMF-2.1.1e/lib
).
You will need to restart OpenOffice for these changes to take effect.
After restart, you should be able to play audio and sound supported by JMF. You can try playing one of the sounds from the gallery:
Troubleshooting
If you get an error similar to the following:
Unpacking... tail: cannot open `+309' for reading: No such file or directory Extracting... ./install.sfx.25050: line 1: ==: No such file or directory ./install.sfx.25050: line 3: syntax error near unexpected token `)'
you will have to edit the installer and correct a line.
There are different ways of doing this, we will use the vim editor.
First we have to clear things up, because this error corrupts the installer file. You can test this by checking its size:
[user@localhost ~]$ cd Download/JMF/ [user@localhost JMF]$ ls -l . total 8 -rwxrw-r-- 1 user user 4022 ene 21 09:44 install.sfx.25050 -rwxr-xr-x 1 user user 0 ene 21 09:44 jmf-2_1_1e-linux-i586.bin
So remove everything and copy back the file downloaded:
[user@localhost JMF]$ rm -f * [user@localhost JMF]$ cp ../jmf-2_1_1e-linux-i586.bin . [user@localhost JMF]$ chmod +x jmf-2_1_1e-linux-i586.bin
Open the file with vim in binary mode:
[user@localhost JMF]$ vim -b jmf-2_1_1e-linux-i586.bin
In the vim editor, type /tail
and press ENTER to look for the line to be fixed:
This will find the problematic line.
Then press the key l to move to the left on that line, until the sign +.
Press i to insert text, and insert -n
, with a space
Press ESC to stop inserting, and type :wq
to write the changes and quit.
Extending JMF
Sun's Java Media Framework comes with support for few formats. You can extend it by installing Fobs4JMF, which is a JMF wrapper for the popular ffmpeg, it can play the most common formats and codecs (ogg, mp3, m4a, divx, xvid, h264, mov, avi, etc):
Please refer to http://fobs.sourceforge.net for more details.
Unfortunately there are no recent binaries for Linux (see http://sourceforge.net/project/showfiles.php?group_id=105646&package_id=117443), so you will have to compile it from the sources.
Once compiled, you don't need to install anything, you just have to copy fobs4jmf.jar and libfobs4jmf.so in /opt/JMF/lib/.
TODO: not very complicated explanation of how to compile it (at least in Ubuntu) on people's demand... See Discussion tab, where this request has been requested, of those able to do, and thanks!