IgnorantGuru's Blog

Linux software, news, and tips

Introducing SpaceTV – A New SpaceFM Plugin For Home Theaters

I recently discovered the mpv video player, which is an actively developed and feature-rich fork of the mplayer/mplayer2 video players. They’ve cleaned up a lot of code and added some nice options (see the differences).

What especially caught my interest is mpv’s ability to automatically save resume points for videos, so the next time you play that video, it plays where you left off, and it also restores the mpv volume and other settings used. Because of this, I have dropped use of my old mplayerstart script, which added resume functions to mplayer.

Like mplayer, mpv does not include a GUI, though it does include a new on-screen control panel. It’s the kind of video player that you control with command line options, usually run in fullscreen, and largely control with key shortcuts. This makes for a great HTPC video player that can be adjusted to operate exactly as you want.

IG SpaceTV plugin for SpaceFM
Toward this end, I have created a new plugin for SpaceFM which aims to turn SpaceFM into a simple media center. The plugin basically makes SpaceFM act as mpv’s GUI for selecting videos, and extends mpv’s resume abilities.

The basic idea is that when you open any video file in SpaceFM, the video immediately plays in fullscreen mode. If you played the video previously and didn’t finish it, it will automatically resume where you left off. mpv also remembers volume and other settings on a per video basis. Plus, you can resume the last video you had been playing (without navigating to it), play prior videos stepping backwards, or browse unfinished videos. You can also set mpv options within SpaceFM, and can play a given video with different options.

Of course there are many other ways to create similar behavior in SpaceFM, but I think mpv provides a great base for this. This plugin is fairly simple, and is intended as a starting point for building and customizing your HTPC (or any media PC). It also shows good examples for how to show simple dialogs, and other features of SpaceFM custom commands. One advantage to using a single script to play all videos is that you can customize this script, allowing it to use special options for some file types, etc.

In addition, the spacetv.sh script can be used independently of SpaceFM to extend mpv’s resume abilities – it only requires mpv. Normally mpv doesn’t remember the names of recently played videos, so it can’t resume the last video you played unless you navigate to it and open it again. With this script, names are remembered so you can resume the last video, or step through prior videos.

I strongly recommend reading the README file to get the most out of this plugin. It works best if set as an opener for all video files (so it’s automatic rather than needing to select it in a menu), and system-wide key shortcuts for Resume Last, etc. are recommended there. To get started visit IG SpaceTV Plugin.

January 19, 2014 - Posted by | Scripts, Software

1 Comment

  1. Usefull note:
    echo save-position-on-quit >> ~/.mpv/config

    Comment by Ian Kelling | January 31, 2014

Sorry, the comment form is closed at this time.