Topic: mplayer and chumby one

mplayer is running on chumby one. I can playback mpeg-4 320x240 at 25fps, 500kbps with aac @64kbps. If anybody wants i can provide a cross-compiled binary. For the moment I start it from an ssh session on the chumby. I'd like to add some kind of media playback interface to the chumby. What would be the best way to do it?

Re: mplayer and chumby one

Nice work!

You might want to take a look at the -input parameter.  You can point that at a fifo and send mplayer commands into that fifo to get them to control the player.

Re: mplayer and chumby one

I am not sure I understand what you mean by "You might want to take a look at the -input parameter". Are you referring to a script? or a flash API?

Thanks!

Re: mplayer and chumby one

mplayer lets you call it with "-input file=name_of_pipe", causing it to read commands from that file.  If it's a named pipe, that can be a convenient way of sending commands to mplayer.

But it occurs to me that you may be able to do some fancy things by making calls to ChumbyNative methods.  For starters, call _pipeOpen() from Flash and call mplayer, and then call _pipeWrite() to send it commands.  E.g. to play /mnt/storage/movie.avi, you'd call:

mplayer = _pipeOpen("/mnt/storage/mplayer /mnt/storage/movie.avi")

And then to pause the movie, you'd send a single Space character by calling:

_pipeWrite(mplayer, " ");

Or to quit, call:

_pipeWrite(mplayer, "q");

If you wanted to be really fancy, you'd call _setDisplay(1) first, and then fiddle around with chromakey and alpha to overlay your controls on top of the movie player behind your Flash widget.

Of course, this all assumes your widget is running as the master instance, which is what you get when you run stop_control_panel; chumbyflashplayer.x -i /path/to/your/widget.swf

Re: mplayer and chumby one

That is crystal clear thanks. I started a gforge project where i'll upload the binaries for people who also want to play with it. I'll post the link when available.

Re: mplayer and chumby one

I did what you recommended, started mplayer via a pipe. It is started properly but then I only have a frame displayed and no sound. Do you have any clues why?
Also, is there a way to start my local flash application from the control panel?

Re: mplayer and chumby one

It could be that it's blocking writing to stdout, and since there's nothing connected to that pipe it's just blocking.  Try starting up mplayer with > /dev/null

As to how to start the local flash application, someone else will need to comment on that, but I think a combination of lowering the privileges in flashplayer.cfg and a profile.xml file on a USB dongle will get you the functionality you're looking for.

8 (edited by sebr 2009-12-28 14:22:01)

Re: mplayer and chumby one

Actually now I understand better.

I added that in the flash application:
_root.onEnterFrame = function(){
        ChumbyNative._setDisplay(1);
}

So I can see the video. I do not know if it is the good way to do it but it works.

Regarding audio, the devices seems to be locked by the flash player. I compiled mplayer with oss audio output, so i'll try with ALSA to check if it behaves better. If not, I am not sure it is possible to have audio at all...
Woud you have a hint on that?

Then, how would you also do to start and external flash from the control panel? Is there some customizable control to which we can attach a script?

Thanks!

Re: mplayer and chumby one

ALSA would definitely be the way to go, as all ALSA devices go through dmix which allows them to share the sound device.  I never did get OSS to go through dmix

Duane will have to chime in on the framebuffer management stuff, but you'll probably want to set your flash player on /dev/fb1 (however you do that in Flash), and run mplayer on /dev/fb0.  Then you can fiddle with the overlay chroma setup and adjust the alpha to have semitransparent control buttons atop the video.

I'm not quite sure what you mean by "external flash".

Re: mplayer and chumby one

Thanks.

By external flash, I meant how to execute a custom flash application (or a script) from the control panel. Typically, what i'd like to do is play my videos which are on the file system from the usual chumby user interface. I understand I need to stop the control panel, execute my flash application and when over, restart the control panel. So is there a button or something that I can customize in the control panel to start my application?

Re: mplayer and chumby one

Ah.  I believe then what you want is to be able to mix local widgets into a channel.  Though if you do that, you'll have to contend with restrictions on being able to call chumbynative functions.

Re: mplayer and chumby one

Could you hook into the external music system to add local Flash widgets that get run with full privileges?  From looking at the docs, you could have a do-nothing Music Player.swf and then have a control panel that actually handled the mplayer control.

Re: mplayer and chumby one

Thanks.

I'll try to look in that direction.

Re: mplayer and chumby one

with mplayer using alsa I have both audio and video working in a flash application started via a pipe as described above. So now, I just have to find a nice way to start it from the user interface to avoid using ssh.

Thanks.

Re: mplayer and chumby one

sebr wrote:

with mplayer using alsa I have both audio and video working in a flash application started via a pipe as described above. So now, I just have to find a nice way to start it from the user interface to avoid using ssh.

Thanks.

How's about sharing the fruits of your efforts? I reckon there are many potential users of it.

Re: mplayer and chumby one

Of course I'll. I started a gforge project. I'll post the link when available.

Re: mplayer and chumby one

Hi Sebr,

Any chance of a link to the binary? (or perhaps instructions / patches to cross compile it?).

I presume the same binary should run on a Chumby classic? (perhaps a bit slower :-( though...).

M.

Re: mplayer and chumby one

No pb. Here is a link to the binary (it needs ncurses which i included in the zip).
http://dl.free.fr/fXtF9YwMg

Re: mplayer and chumby one

Thank you!

I did in the end manage to get the mplayer from here working:

http://www.angstrom-distribution.org/repo/

...although it needed 19 extra shared libraries before it would run, so yours is much neater. Did you compile your version with any ARM optimizations? Not sure how much difference that would make...

I'm now in the process of trying to make the get_iplayer script from here working... I'll keep you updated with results.

Re: mplayer and chumby one

I'm a happy chap - get_iplayer and mplayer running straight on the Chumby itself!

It's only working for radio streams at the moment (flvstreamer missing) - but I'm sure that can be rectified :-)

What a lovely gadget the Chumby is...

Re: mplayer and chumby one

sebr wrote:

No pb. Here is a link to the binary (it needs ncurses which i included in the zip).
http://dl.free.fr/fXtF9YwMg

For some reason I can't seem to extract the zip file above (I'm using unzip on Linux - I don't have a Windows box handy at the mo.).

Also any chance of build instructions / patches / scripts? Were there many difficult dependencies you had to deal with?

So far I've not had much luck with video playback using the openembedded version I downloaded (even ignoring flvstreamer) - a mixture of missing codecs and a flaky output scaler, so I've kinda accepted the fact I'm going to have to build it.

Re: mplayer and chumby one

pythag wrote:

For some reason I can't seem to extract the zip file above (I'm using unzip on Linux - I don't have a Windows box handy at the mo.).

It works okay here with Unzip 5.52 and whatever the built in ZIP handler is in Windows.

e34dc552e7697491d868bc075139dcc8  mplayer.zip

Re: mplayer and chumby one

tiersten wrote:
pythag wrote:

For some reason I can't seem to extract the zip file above (I'm using unzip on Linux - I don't have a Windows box handy at the mo.).

It works okay here with Unzip 5.52 and whatever the built in ZIP handler is in Windows.

e34dc552e7697491d868bc075139dcc8  mplayer.zip

Cheers - the md5 matches, so I guess it's the linux Unzip util. I'm chipping away at building mplayer myself so we'll see how that goes...

Re: mplayer and chumby one

Would that be possible for Chumby classic?

25 (edited by sebr 2009-12-30 08:25:02)

Re: mplayer and chumby one

Here are the options I used for the configure of mplayer
--target=arm-none-linux-gnueabi --enable-armv5te --enable-fbdev --enable-alsa --extra-libs-mplayer=-L../alsa/lib/ --extra-cflags=-I../alsa/include

it is best to enable armv5te as some color space conversion and decoders routines are optimized for it. Also make sure you have the header files for alsa available in your toochain.