BlitzMax MPlayer mod and frontend

Community Forums/Showcase/BlitzMax MPlayer mod and frontend

TeaVirus(Posted 2006) [#1]
Hi! I've been playing around with using MPlayer to display video in a Max GUI for a project I'm working on. This mod and frontend for MPlayer are the result so far. I don't want to mess around with the front end any more (mainly wrote it for testing) so I thought I'd post it in case anyone else is interested in playing around with it. It will play pretty much any media file you can throw at it as well as streaming content. Also, I haven't used anything Win32 specific so I think it should work on OSX and Linux provided the proper mplayer executable. Here's the mod:



Frontend:


There are a couple requirements to get it working. You'll need Fabian's handy pub.ProcessStream mod available here:
http://www.blitzmax.com/codearcs/codearcs.php?code=1558

And, of course, you'll need MPlayer available here:
http://ftp5.mplayerhq.hu/mplayer/releases/win32/

Wherever you end up placing the MPlayer executable, make sure you also have the sub folder that contains it's config file and OSD font or it acts strangely.


ozak(Posted 2006) [#2]
Finally got around to playing around with this interesting piece of code :)

Had to add the following to keep it from crashing :)

If (mp.mplayer <> Null) Then

AddTextAreaText(mp.txaLog, mp.mplayer.GetDebugMsg()+"~n")

End If


I do however have a small question.
If I don't touch the app, the movie plays fine but if I press anything in the window it completely freezes to the point of nothing in the window being updated.
I think the app might hang somewhere waiting for events or something but I haven't been able to locate it.

Would be cool if anyone could see what is wrong :)

Thanks in advance


TeaVirus(Posted 2006) [#3]
Hmmm.. The only time I remember seeing strangeness like that was when I removed the mplayer config file. I'll take a look at this when I get home from work tonight and see if I can come up with anything.


LAB[au](Posted 2007) [#4]
After some try-outs under Linux, this works partially for me. I can compile it, I can select a file, it plays but I have no image just sound and I can't use any of the buttons/menu. I found that the update method doesn't happen, it appears like mplayer would suspend Blitzmax execution. Anybody could point me to a possible direction for using mplayer with MaxGUI?


LAB[au](Posted 2007) [#5]
Tested it and it works fine on windows.

On linux I managed to have the Gui working, you have to call mplayer in "-slave -quiet" mode, still no picture but I am working on it ...


Bremer(Posted 2007) [#6]
So you are getting both sound and video embedded in the window on Windows?

I can only get the sound to work, there is no video. And I had to cut out everything except the function that starts the video to get it to work at all. It keept saying that the video file could not load.


LAB[au](Posted 2007) [#7]
Probably a problem with the codecs ... otherwise yes I have everything running fine on windows, on Linux not ... I found out that's because an incorrect window handle but I found no time to go further.


LAB[au](Posted 2007) [#8]
Here is the code of the frontend... for windows. I did some changes but I don't remember where...