Showing posts with label media. Show all posts
Showing posts with label media. Show all posts

Saturday, June 20, 2009

The less consuming radio player ever

Hello,
multimedia always killed desktop performance, also audio with all such effect-based players out there. I've been using deezer for a long time, but sometimes I'm tired to see my desktop lagging.
I don't need that, I need random music from internet while I'm either programming or studying, and my computer has only 512mb ram and 2.4ghz amd64 (onLY??? yes nowadays it's a little amount).

Let's see what we can do using gst-launch:

while [ 1 ]; do wget -q -O - http://66.250.45.112:80/hard.ogg|gst-launch fdsrc fd=0 ! decodebin ! audioconvert ! alsasink; done

The URL above is a hard rock station :) The while ensures re-connection. I think performances are great, 6% cpu and 2% ram.

But there's yet a bettere solution (see comments):

mplayer http://66.250.45.112:80/hard.ogg

Tuesday, February 24, 2009

JMF and MPEG

Hello,
I'm recently writing a game with Java AWT/Swing/SwingX/JMF for a university exam.
If you are using the Java Media Framework and most of the formats (all the well known and used formats) can't be handled by the library here's your definitive solution to the problem.
You will usually get "Unable to handle format: MPEG" or something like that.

How do you get rid of that and make things work? There's a great plugin named jffmpeg which handles a huge number of audio and video formats (including ogg/vob).
Just follow the instructions on the project website to install the plugins.

Alternatively you can register only the codec and demux you use from within your application code as follows (e.g. only handle MPEG video format on input):

Format[] inFormats = { new VideoFormat ("MPEG") };

PlugInManager.addPlugIn ("net.sourceforge.jffmpeg.VideoDecoder", inFormats, null, PlugInManager.CODEC);

PlugInManager.commit ();