omxplayer, now with added gui


34 posts   Page 1 of 2   1, 2
by KenT » Tue Sep 04, 2012 10:13 pm
I've written a python/tkinter application that uses jbaiter's pyomxplayer wrapper to control omxplayer.

It's a lightweight gui audio and video player with playlist support.

You can download it here https://github.com/KenT2/tboplayer. The Readme has the installation instructions.
Pi Presents - A display package for museums, visitor centres, and more
Download from http://pipresents.wordpress.com
Posts: 534
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
by KenT » Mon Oct 15, 2012 7:39 pm
I've updated TBOPlayer to deal with filenames that have spaces. Code and instructions on Github as in OP.

A short video filmed by raspi.tv at the 2nd Milton Keynes Jam is at http://raspi.tv/2012/tboplayer-a-gui-front-end-for-omxplayer
Pi Presents - A display package for museums, visitor centres, and more
Download from http://pipresents.wordpress.com
Posts: 534
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
by Wanderlei » Sat Oct 20, 2012 7:19 am
Nice work Ken.
Posts: 79
Joined: Tue Aug 21, 2012 2:01 pm
by RoyalWulf » Sun Oct 21, 2012 7:36 am
Hi.
I tried to follow your instructions - I am new to linux.
I installed pexpect
I downloaded tboplayer.py
Sorry , your instructions were not too clear to me so I went:
wget https://github.com/KenT2/tboplayer/blob ... oplayer.py

I then went:
python tboplayer.py


and got this error:

python tboplayer.py
File "tboplayer.py", line 4
<!DOCTYPE html>
^
SyntaxError: invalid syntax

How do I fix that?
Cheers
Posts: 6
Joined: Thu Jul 26, 2012 12:02 am
by KenT » Sun Oct 21, 2012 8:36 am
Hi
Yes the instructions are not too clear, mainly because I don't know how to do it myself :oops:

It looks like you have picked up some of the HTML off the web page.

I'm not sure wget works with github. I get the impression that git clone is the proper way to go but that seems to require the installation of git-core on the pi.

Meanwhile if you go to https://github.com/KenT2/tboplayer you will see a download button on the righthand side of the page. Download the .zip for windows or the .tar.gz for pi and unpack it. I imagine xarchiver will do the unpacking for the pi and it is in the utility menu.

Anybody else like to fill me in as to a procedure for downloading python software from git without having to install git-core. Installing git-core is just another barrier for newbies. Windows ex-pats like me understand .zip etc.
Pi Presents - A display package for museums, visitor centres, and more
Download from http://pipresents.wordpress.com
Posts: 534
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
by malakai » Sun Oct 21, 2012 9:38 am
Let me try:


First install dependency pexpect:
Code: Select all
wget http://pexpect.sourceforge.net/pexpect-2.3.tar.gz
tar xzf pexpect-2.3.tar.gz
cd pexpect-2.3
sudo python ./setup.py install
cd ..


Now install Player tboplayer:
Code: Select all
wget https://github.com/KenT2/tboplayer/zipball/master/KenT2-tboplayer-522a7d6.zip
unzip KenT2-tboplayer-522a7d6.zip
cd KenT2-tboplayer-522a7d6/
python tboplayer.py


Now if someone can help link it like maybe create a desktop file or something

I figured it out

Create a soft link to the file we want to run and put it on the desktop
Code: Select all
ln -s /home/pi/KenT2-tboplayer-522a7d6/tboplayer.py /home/pi/Desktop/tboplayer


Open up File Manager in Accessories
Navigate to tboplayer.py right click properties set permissions click Make executable
Click on new file on your desktop when prompted choose execute not execute in terminal
Chose this option to stick with the Windows theme.

I did open tboplayer.py in geany while fiddling around and shouldn't the first line be:

#!/usr/bin/python

No spaces no extra remarks I don't know python still learning but other posts have said this is what should be there in linux I did change it before making the desktop link and it works figured I would just unzip and overwrite the changes just not sure which is right.
Attachments
executable_file.png
executable_file.png (11.76 KiB) Viewed 11956 times
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)
User avatar
Posts: 1383
Joined: Sat Sep 15, 2012 10:35 am
by KenT » Sun Oct 21, 2012 1:09 pm
Hi Malakai

Great stuff, I'll link to this thread from Github.

Here is the desktop file I use. It goes in /home/pi/Desktop

Code: Select all
[Desktop Entry]
Name=TBOPlayer
Comment=Media Player
Path= /home/pi/tboplayer
Exec=python /home/pi/tboplayer/tboplayer.py
Icon=/usr/share/pixmaps/python.xpm
Terminal=false
Type=Application
Categories=Application;
StartupNotify=true


It will need adjusting for different directory names.

All I need now is a nice icon to replace the default python one.

I'd quite like to include an installer file in git. Is there any way that the user can control which directory the various files will eventually be stored in and divert different files to different places. e.g TBOplayer.py goes into, say, /pi/tboplayer whereas the desktop file goes into /pi/Desktop.

You don't need #!/usr/bin/python if you run TBOPlayer with 'python TBOplayer.py'. I believe missing out the #!... means that the file can be imported as a module into another larger program.
Pi Presents - A display package for museums, visitor centres, and more
Download from http://pipresents.wordpress.com
Posts: 534
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
by ScottBouch » Tue Nov 06, 2012 11:33 am
Hi, I've followed your instructions, and this works a treat!! Thanks for sharing!!!

One question, when adding files to play, how can I add more than one at a time? Can I add a folder? Currently if i want to play an album, I have to browse to it for each song.

Also noticed some MP3's won't play. Do I need any codecs?

The interface is good, I like what you've done!

Thanks, Scott.
http://www.scottbouch.posterous.com - - - - - - - - - Personal Blog
http://www.flightgear.posterous.com - - - - - - - - - - Aircrew Equipment blog
http://www.youtube.com/user/sbscottmonkey - - - YouTube Channel
User avatar
Posts: 146
Joined: Wed Jun 06, 2012 12:32 pm
Location: Midlands, UK
by KenT » Tue Nov 06, 2012 1:26 pm
Hi

Glad you like it. You cannot add all the files in a folder. However it wouldn't be too difficult to write a function and attach it to a menu item to do it. There is a python library that steps through all the files in a directory, can't remember what it is called though.

The other possibility would be to expand the track>add dialog box to enable selection of multiple files, you would need to read the Tkinter docs at effbot.org to see if this was possible.

I'm not actively developing TBOPlayer any more, too many other things to do. Why not fork TBOPlayer on git and add what you want?

On mp3's, TBOPlayer is as good or bad as OMXPlayer in what it will and will not play. All it does is use the OMXPlayer command from Python.

Try playing the tracks from the command line 'omxplayer -o hdmi mtfile.mp3'. If It works on the command line and not in TBOPlayer I would like to know about it.
Pi Presents - A display package for museums, visitor centres, and more
Download from http://pipresents.wordpress.com
Posts: 534
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
by dylanpank » Tue Nov 13, 2012 1:45 am
It may still be a bit fussy with names. I found it (either TBO or OMX) was refusing to play files with some punctuation marks. I had to go and remove all the apostrophes from the I'ds You'ves and We'lls in titles of .mp3s on my seven year old's Pi, much to her disgust.

Other than that and the usual OMX quirks it works a fine. Many thanks Mr Thompson!
Posts: 4
Joined: Tue Apr 17, 2012 9:31 am
by KenT » Tue Nov 13, 2012 7:54 am
Ah yes, the ' within strings gotcha. I should be able to fix it easily if its a TBO problem. It's on my todo list.
Pi Presents - A display package for museums, visitor centres, and more
Download from http://pipresents.wordpress.com
Posts: 534
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
by ScottBouch » Tue Nov 13, 2012 8:02 am
I'll re visit this, (been tied up with other things of late) as you may have hit the ail on the head with your ideas on punctuation! I found ita bit random how most songs froman album woUld play ok, and one or two would not... I'll test your idea!

The ideas that KenT had on making changes to the source code are a little beyond my current skills and capabilities, but i may have a stab in the dark... Nothing lost!

Cheers, Scott
http://www.scottbouch.posterous.com - - - - - - - - - Personal Blog
http://www.flightgear.posterous.com - - - - - - - - - - Aircrew Equipment blog
http://www.youtube.com/user/sbscottmonkey - - - YouTube Channel
User avatar
Posts: 146
Joined: Wed Jun 06, 2012 12:32 pm
Location: Midlands, UK
by KenT » Thu Nov 22, 2012 8:36 pm
There is an updated version of TBOPlayer on Github which fixes the single quotes in filenames bug. It will not cope with double quotes though.

https://github.com/KenT2/tboplayer
Pi Presents - A display package for museums, visitor centres, and more
Download from http://pipresents.wordpress.com
Posts: 534
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
by sajal147 » Wed Dec 05, 2012 5:06 am
RoyalWulf wrote:Hi.
I tried to follow your instructions - I am new to linux.
I installed pexpect
I downloaded tboplayer.py
Sorry , your instructions were not too clear to me so I went:
wget https://github.com/KenT2/tboplayer/blob ... oplayer.py

I then went:
python tboplayer.py


and got this error:

python tboplayer.py
File "tboplayer.py", line 4
<!DOCTYPE html>
^
SyntaxError: invalid syntax

How do I fix that?
Cheers


hi,
The thing is, you did not download the code.
open the file in leafpad and check if it's the same code written as mentioned here.
It might be the HTML script of the webpage.
Posts: 12
Joined: Mon Dec 03, 2012 3:45 pm
Location: Mumbai
by KenT » Wed Dec 05, 2012 8:27 am
Better instructions here and referenced from the Readme.md

http://www.raspberrypi.org/phpBB3/viewtopic.php?f=38&t=16462#p198849
Pi Presents - A display package for museums, visitor centres, and more
Download from http://pipresents.wordpress.com
Posts: 534
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
by pgonzalez115 » Sat Dec 08, 2012 4:11 am
I can confirm that an mp3 with no special characters plays fine from omxplayer, but does not wok from within tbo. It hangs at 0:0.
Posts: 4
Joined: Fri Dec 07, 2012 10:45 pm
by KenT » Sat Dec 08, 2012 9:45 am
pgonzalez115 wrote:I can confirm that an mp3 with no special characters plays fine from omxplayer, but does not wok from within tbo. It hangs at 0:0.


The time display does not work with mp3's, but I assume you cannot hear any sound.

Have you selected the correct sound output in TBOPlayer's options.

Could you turn the debug option on and then restart TBOPlayer from a terminal window opened in the TBOplayer folder. (python tboplayer.py) Send me the displayed line that starts >Play

Ken
Pi Presents - A display package for museums, visitor centres, and more
Download from http://pipresents.wordpress.com
Posts: 534
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
by pgonzalez115 » Sat Dec 08, 2012 10:46 pm
The time display does not work with mp3's, but I assume you cannot hear any sound.

Have you selected the correct sound output in TBOPlayer's options.

Could you turn the debug option on and then restart TBOPlayer from a terminal window opened in the TBOplayer folder. (python tboplayer.py) Send me the displayed line that starts >Play

Ken


Wow, stupid me. Who would've thought to actually go into the options menu... ha.

Thanks Ken, this is some great work.
Posts: 4
Joined: Fri Dec 07, 2012 10:45 pm
by pgonzalez115 » Sun Dec 09, 2012 9:46 pm
Hey Guys! I've successfully added a file tree to Ken's original design. This way, people can manage large music libraries with TBO on their Pi! For me, It's much faster than opening a dialog each time to add a track. Just double click on a file in the browser on the left, and it get's added to the playlist! Check out the screenshot below. If people are interested, I can upload the script to the forum (with permission from Ken of course ;) )Image
Posts: 4
Joined: Fri Dec 07, 2012 10:45 pm
by 8on3s » Wed Dec 12, 2012 10:25 pm
pgonzalez115 wrote:Hey Guys! I've successfully added a file tree to Ken's original design. This way, people can manage large music libraries with TBO on their Pi! For me, It's much faster than opening a dialog each time to add a track. Just double click on a file in the browser on the left, and it get's added to the playlist! Check out the screenshot below. If people are interested, I can upload the script to the forum (with permission from Ken of course ;) )Image



I would be very interested, I don't suppose you could give me a link?
Posts: 2
Joined: Wed Dec 12, 2012 10:18 pm
by tbrauch » Sat Dec 15, 2012 3:28 am
Maybe I'm missing something... I tried everything listed above, and I can get TBOPlayer to work. But, when I play a video, it takes over the whole screen and I can't use any of the buttons in TBOPlayer. I'm using the stock Raspbian Wheezy. The only things I've done is updated, changed the keyboard to US, and followed the directions posted above.

The movie plays fine, sound and everything, but it takes up the whole screen and there's nothing I can do about it.
Posts: 1
Joined: Sat Dec 15, 2012 3:15 am
by KenT » Sat Dec 15, 2012 8:32 am
Taking over the whole screen is a limitation of omxplayer. When playing a full screen video you need to use the keyboard to control it. List of keys is in the help menu.
Pi Presents - A display package for museums, visitor centres, and more
Download from http://pipresents.wordpress.com
Posts: 534
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
by 8on3s » Mon Dec 17, 2012 5:20 pm
This gui works awesome, the only issue I see and it has nothing to do with this frontend is omxplayer does not re-size videos, or at the very least black out unused parts of the screen, but hey it plays 1080p on the pi without a hitch so whatever right?
Posts: 2
Joined: Wed Dec 12, 2012 10:18 pm
by Rozan » Fri Dec 28, 2012 1:34 pm
Hello everybody,
Today I made package of the tboplayer for Arch Linux ( AUR ). You can download the tarball at:
https://aur.archlinux.org/packages/tboplayer-git/
I hope it works, if not please let me know in the comments and i will fix it.
Great project by the way.
Rozan
Posts: 4
Joined: Fri Dec 28, 2012 1:22 pm
by Knight4 » Wed Jan 02, 2013 5:44 pm
Great work!

I don't suppose there's a way to smoothen the transitions between each video of a playlist, is there ? :/
Posts: 10
Joined: Wed Dec 26, 2012 5:27 pm