Gadgetguy
Posts: 131
Joined: Fri Aug 15, 2014 2:55 am

Smplayer some updated suggestions

Mon Jan 06, 2020 11:31 am

As I have mentioned in previous posts on raspberry forums I believe smplayer as a gui for mpv media player enhances it’s utilty, efficiency and pleasure not only for the new raspberry pi 4 ( but also and particularly for Pi 2 and Pi 3 where to achieve hardware acceleration requires displaying video output as an mmal overlay and therefore when in full screen relies solely on keyboard control and also loses the ability to easily multitask while watching a video )

While a fairly recent smplayer version is found in Raspbian’s Buster repository and works well, it is older than the latest stable version of smplayer. Therefore Raspbian’s Buster version is lacking at least one very useful feature. Smplayer incorporates it’s own lightning-fast built-in code to load youtube videos quickly, otherwise it uses the somewhat slower youtube-dl utility The version of smplayer in the repositiory is slightly behind the changes youtube periodically makes to it’s code and therefore if one wishes to benefit from this faster loading of youtube videos it is necessary from time either to compile smplayer from source or if we are lucky to download an up to date precompiled version for the armhf architecture. (we are lucky see below!!)

In it’s preferences menu under network settings smplayer allows the user to specify when loading youtube videos either to use smplayer’s own internal youtube code or instead to use the mpv + youtube-dl utility which is a bit slower (or alternatively still, auto-choose to allow smplayer to use the quickest available method. Thus even if using an older version, smplayer should still play youtube videos as long as youtube-dl is installed on your system and kept updated:

sudo pip install --upgrade youtube-dl

I have recently discovered that there is a pre-compiled armhf version of the latest smplayer available from a reliable source, ie the debian bullseye repository!! If your Raspbian is up to date I believe all the dependencies are met (they were on my system) to install smplayer from this source ( using your package manager. I use Gdebi) :

https://packages.debian.org/bullseye/smplayer

However, If you wish to compile smplayer from source visit its download page at:

https://www.smplayer.info/en/downloads

If you want the very latest smplayer download the svn version as changes to youtube’s code don’t happen too often but can happen unexpectedly and updates to youtube code are usually incorporated in the svn version before the stable version is released . If you download the svn version you will need to have subversion installed (an easy install) on your system.

Extract the downloaded file into your home directory. You can find the compile instructions in the Install.txt file. First as noted in the install file install the dependencies:
sudo apt-get install libqt4-dev zlib1g-dev fakeroot build-essential devscripts debhelper g++ qtbase5-dev qt5-qmake qt5-default qtscript5-dev qttools5-dev-tools qtbase5-private-dev libqt5webkit5-dev

Then open the extracted folder in terminal and type :


./create_deb.sh


It does take about 20 or 30 minutes to create and install a smplayer deb file (which you should save for future use), however Cpu usage during this compilation is quite low so you should still be able to use your Raspberry Pi for web browsing etc during this time.

Note smtube a useful standalone youtube browser that can also utilize other media players such as vlc or omxplayergui as well as smplayer to play videos can be compiled much more quickly using the same dependencies and instructions. Unfortunately an up to date version of smtube is not available in the raspbian or debian repositories but its source code can be downloaded from here:

https://www.smtube.org/


Incidentally it should be noted smplayer/smtube has its own forum. I sometimes consult it since youtube code breakages are usually quickly reported there and promptly fixed.

https://forum.smplayer.info/


After this compiled or precompiled smplayer is installed it must of course be configured for use via it’s preferences menu. When smplayer is opened for the first time it creates its own configuration folder:

/home/pi/.config/smplayer and the configuration file therein is smplayer.ini


Configuring smplayer :

under preferences/ general specify mpv as the engine, audio -alsa ,video-default; under performance tab select auto under hardware decoding;under the network tab i usually have under support for video sites checked as auto, and under playback quality I usually have adaptive streams selected that is if you want to play youtube videos that deliver separate audio video streams( usually needed to get the higher resolutions). ( downside is that it is sometimes a little slower to fast forward through a video)

When using my raspberry pi 4. my /home/pi/.config/mpv/mpv.conf
file reads :

geometry=20%
ytdl-format=bestvideo[ext=mp4][width<=1920][height<=1080]+bestaudio[ext=m4a]/best[ext=mp4]/best


This particular mpv configuration means mpv and also smplayer will open in a small widow first which can be quickly toggled to full screen and back. It also means mpv and smplayer will only chose mp4 videos up to or below 1920p resolution. Mp4 videos are fully hardware accelerated on the pi whereas webm uses higher cpu as it is software decoded. Although I note smplarer on my pi 4 4g will play vp9 codec up to 2k video at 30fps albeit at higher cpu usage.


Smplayer will honour your mpv configuration file unless you overide it (only when using smplayer) by specifying otherwise under the advanced tab under mpv options.

My suggestion when using smplayer with mpv on the Pi 2 or Pi 3 but not the pi 4 are :

one key setting is found under preferences/advanced/mplayer/mpv tab. Here you should check the box instructing mpv to run in its own window. Another key setting under this same tab allows you to pass special instructions to mpv which will while you are using smplayer overide any instructions found in mpv’s own configuration file. The instructions I inserted here are as follows:

--ytdl-format=bestvideo[ext=mp4][width<=1920][height<=1080]+bestaudio[ext=m4a]/best[ext=mp4]/best --rpi-background=yes –geometry=20%+1075+550

Of course the geometry settings can be customized to taste

Another key setting is found under the performance tab set hardware decoding to auto
All these and other configuration settings are found in the smplayer.ini file found in the aforementioned folder :

/home/pi/.config/smplayer

(For a 1080p display you might wish to replace the settings geometry=20%+1075+550 with geometry=20%+1500+825)

By using these settings on a pi2 or pi 3 you can toggle back and forth between full screen and a small overlay window which will be placed at an inconspicuous place on your display so as to allow multi-tasking and also utilization of smplayer’s panoply of control options such as fast forward etc. You can also drag and drop youtube , or a youtube playlist or local videos into smplayer’s interface and have it commence playback.

Finally a very useful web browser extension available in Chromium, Vivaldi and firefox (later version firefox from debian repo at the moment not available in firefox-esr is “openwith” :


https://chrome.google.com/webstore/deta ... anlcbchlno


In “openwith” settings add a media player of your choice ie smplayer,
mpv, vlc. Open with will put a dialog in your context menus so that you can quickly play even the youtube videos appearing in the suggested column without loading the page first.

Note one of the many nice features of smplayer is that you can also drag and drop youtube , or a youtube playlist or local videos into smplayer’s interface and have it commence playback.

Enough for now!

Return to “Graphics, sound and multimedia”