Showing posts with label mplayer. Show all posts
Showing posts with label mplayer. Show all posts

Tuesday, June 23, 2009

Sound not working in Flash? Here's a possible fix.

Here's the symptom: your sound works fine, except in Flash. You've tried multiple browsers and Flash sound doesn't work in any of them.

The problem is that you're using PulseAudio as a sound engine and sometimes Flash doesn't work well with it.

To fix this, remove the libpulse0 package. As root:

yast --remove libpulse0


When I did this, it ended up removing MPlayer due to dependecies. I reinstalled MPlayer from the repositories which brought back one PulseAudio package, but sound still worked in Flash.

Sunday, June 7, 2009

Create a movie using Fortran

Recently, I posted a method for making images in Fortran. With a couple of commands, its easy to turn those images into a movie.

I'm assuming that you're following my previous hack and you've got a directory of ppm image files, each one containing a single image of the movie you want to create. First, you'll need to convert each one to jpg:

convert IMAGE.ppm IMAGE.jpg


Then convert the jpg's to an avi file. This requires mencoder, which is included with the MPlayer package, which is part of the Packman repositories.

mencoder "mf://*.jpg" -mf fps=1 -o VIDEO.avi -ovc lavc -lavcopts vcodec=wmv2


The video is encoded using wmv2 which is playable on every Windows and Linux machine I've come across. This plays the video at 1 frame per second. You can increase or decrease the fps switch to set the speed at whatever you like (such as "fps=3.5"). The images are read in alphabetical order, so numbering your images 0001.jpg, 0002.jpg, and so on is not a bad idea.

Here's movie that I recently created as part of my thesis research:



It probably doesn't make a lot of sense what's going, but the important thing is that this entire video was created using a couple hundred lines of Fortran, my data files, and a couple of scripts.