Inline MPEG - 1 - player in JAVA (with MPEG layer I decoder)

Here shell be an Applet. You can't see it because you don't use a Java capable WWW browser or you didn't enable Java. Please check: Options --> Preferences --> Languages --> Enable Java This is a demonstration of an inline player for MPEG files. It is written as JAVA  APPLET and works in 3 steps:
  1. Loading and parsing of the MPEG-files;
  2. Reconstruction of the single frames;
  3. Playing of the frames as animation in a thread;

See also The Java inline H261 player


Please have a look at my new WebGL-Page!

If you are looking for solutions concerning the GigE Vision standard then have a look
at my GigE Vision solution page!

The decoding time is a bit disappointing except if you have an JIT (Java just-in-time compiler) as with IExplorer on Windows 95/NT. In this case you should also look at a special JIT version of this player.

I'm convinced a MPEG-plugin would solve the problem. But it is not so elegant.

I was asked to declare a copyright. So, I declare the software is under the GNU GENERAL PUBLIC LICENSE (http://www.fsf.org/copyleft/gpl.html). See also LICENSE.
Version 3.x can now deal with MPEG layer I AUDIO/VIDEO files. That does not mean it plays audio! The audio tracks are simply skipped (Playing audio will be. Perhaps ... (???))

Do not confuse MPEG Layer I and MPEG-2 (or so)! A short description can be found in MPEG file format. I enclosed the MPEG layer I decoder because I've got some e-mails concerning MPEG files which could not be played with this MPEG player. As I analysed them I determined that this were MPEG files containing a layer I structure. Some of them had an audio channel.

I was asked to enclose either an audio decoder or (at least) an MPEG layer I decoder which skips over the audio tracks. The latter I support with this version.

The author didn't understand the YUV color model correctly. Therefore the colors are not the best. But perhaps you can improve the colors. Refer to the color test page

Thanks to Chris Jones (chris@starseed.com)!!! He gave me the right formulas to translate the YCrCb colors into the RGB color system correctly. This change is made in Version 1.9.

See also The Java-inline-FLI/FLC-File-Player.


To use the MPEG player download the classfiles and place a text like this on your web page:

	<APPLET CODE="MPEG_Play.class" WIDTH=410 HEIGHT=310>
	<PARAM NAME=FILENAME VALUE="myfile.mpg">
	<PARAM NAME=DELAY VALUE=40>
	</APPLET>

If you don't have a GNU-Tar you can download the classfiles as ZIP archive here: classfils.zip. Note! Windows-95 users must not use the old 16bit "unzip.exe" because it cannot handle the 5-letter suffix ".class"! Refer to http://www.cdrom.com/pub/infozip/ or use "winzip" which is available on many sites in Internet!

The (optional) parameter "DELAY" describes the delay (in ms) between 2 images during animation default: 200. If "DELAY" is set to "user" a control panel appears and the user can determine the animation speed.

Likewise you can use the player as application. In this case call:

	java MPEG_Play <myfile.mpg> <delay>

Like in Applet the (optional) parameter "DELAY" can be set to "user".

Again the delay is optional.

Known problems:

And here (mpeg_java-3.6.tgz) is the source. To understand the implementation see also:

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License (http://www.fsf.org/copyleft/gpl.html) for more details.

If the program runs as Java applet it isn't "interactive" in the sense of the GNU General Public License. So paragraph 2c doesn't apply.

J.Anders,
Professur Rechnernetz u. verteilte Systeme
TU-Chemnitz