MythVideo player. Supports Random Search, DVD, VCD, FSD, Playlists, Streaming media

This is a MythVideo player that wraps mplayer/xine/vlc and enables -

  1. Playlists
    1. Create a MythVideo file containing all videos to play.
  2. Random play
    1. Create a MythVideo file containing search options. Possible searches
    2. randomcat:category. Random video from category
    3. randomfile:directory. Random video. Goes down tree from dir
    4. randomvid:title search string. Random video matching search
    5. randomrec:title search string. Random recording matching search
    6. random:title search string. Search videos & recordings
    7. leastplayed:title search string. Random least played video matching search
    8. mostplayed:title search string. Random most played video matching search
    9. oldestplayed:title search string. Random oldest played matching search
    10. youngestplayed:title search string. Random youngest played matching search
    11. highestrating:title search string. Random highest rated matching search
    12. cast:person search string. Random with matching person in.
    13. director:person search string. Random directed by matching person search
  3. DVD playing and managing in MythVideo
    1. Create a MythVideo file containing meta data, possibly containing title, audio channel to play
    2. When selected will prompt for the DVD to be inserted and play
  4. Streaming Media playing (You can use XBMC strm files)
    1. Create a MythVideo file containing MRL and player.
  5. VCD playing and managing in MythVideo
    1. Create a MythVideo file containing meta data, possibly containing title, audio channel to play
    2. When selected will prompt for the VCD to be inserted and play
  6. Myth Recordings playing
    1. Create a MythVideo file containing MythRecording
  7. Filesystem CD/DVD playing and managing in MythVideo
    1. Create a MythVideo file containing meta data, possibly containing file to play
    2. When selected will prompt for the CD/DVD to be inserted and play
  8. Snapshot to update MythVideo coverfile
    1. When a snapshot is taken the MythVideo coverfile will be changed to it.
  9. Zip, rar archive playing.


Disadvantages
Although you can use the internal MythTV player for some types, mostly you will be using mplayer/xine to play your videos. This means you will need to setup lirc for them, hopefully with similar buttons and MythTV bookmarks (starting where you stopped) won't work.
See lircrc file with matching keys for MythTV, MPlayer, Xine, VLC, Rhythmboxfor assistance with lirc


Current Version: 1.18


IMPORTANT

  1. Won't work with MythVideo Storage Groups.
  2. Requires your linux to be setup to auto mount a DVD when inserted. Most distro have this enabled by default. If you don't have this check your distro documentation on how to enable this.
  3. Turn off auto start of programs to play DVD/VCD's.

Installation

  1. Create a new file type for extension dvd
    Utilities/Setup -> Setup -> Media Settings -> Video Settings -> File Types
    Select new
    enter extension dvd
    select create new extension
    enter command for this extension as mythvideoplayer.sh %s
    untick use default player (You can't use the internal player)

  2. Do the same for extensions vcd, fsd, pls, rec, strm, zip and rar
  3. For the random searches to work correctly you need to change all video file types to use player mythvideoplayer.sh %s. See Notes below.
  4. Install mythvideoplayer.sh to a directory that is in your PATH
  5. READ and EDIT the configurable items section in mythvideoplayer.sh
    In particular Set LIRCENDCONFIG LIRCSNAPSHOTCONFIG. These also need entries in you .lircrc file. Read comments
    Also set DVDPLAYERCMD, VCDPLAYERCMD, FSDPLAYERCMD, PLSPLAYERCMD, STRXINEPLAYERCMD, STRMPLAYERPLAYERCMD, STRVLCPLAYERCMD to the programs you want to play DVD, VCD, Filesystem, Play Lists and Streams with.
    These can be overridden with the MythVideo "unique player command" entry of the MythVideo entry. However this requires a special format as we still need mythvideoplayer.sh %s as the base play command so need to include it plus our new play command. Use the shell terminate command ";" and the shell null command ":" (The : command must have a space after it) to separate mythvideoplayer.sh from the new play command. i.e. "mythvideoplayer.sh %s ;: dvdplayer dvdplayeroptions"
    e.g. mythvideoplayer.sh %s ;: mplayer -fs -zoom -quiet -monitoraspect 16:9 -ac hwac3,
    Don't include the MRL.

  6. Create the MythVideo files. More details on the formats of these files are available in mythvideoplayer.sh. This is just a quick overview.
    1. Enter your DVD's into MythVideo.
      In your MythVideo directory create a file for each of your DVD's with .dvd as their extension. Use _ instead of spaces
      e.g.
      touch Star_Wars.dvd
      All file contents starting with a Capital letter will be include in the prompt. So for TV series you could include Box and Disc details in the file.
      e.g.
      cat > Series:S01E01:Episode_Name.dvd
      Box:1
      Disc:1
      Control D
      To auto start playing a particular title include a titleno:# entry
      e.g.
      cat > Series:S01E03:Episode_Name.dvd
      Box:1
      Disc:1
      titleno:4
      Control D
      For a particular audio id include
      audioid:#

    2. Enter your VCD's into MythVideo. These must include a videotrack:# entry to specify which track to play.
      e.g.
      cat > Hello_World.vcd
      Disc:1
      videotrack:2
      Control D
      For a particular audio track include
      audiotrack:#

    3. Enter your Filesytem (fsd) into MythVideo. These must include a file:name entry to specify which file to play. This is the full path from the base of the dvd/cd
      e.g.
      cat > Foo_Bar.fsd
      file:Season1/Episode1.avi
      Control D

    4. Enter your Playlists (pls) into MythVideo. These must be full paths to the MythVideo entries to play.
      e.g.
      cat > Play_List_1.pls
      /usr/local/MythVideo/Video1.avi
      /usr/local/MythVideo/Video2.dvd
      /usr/local/MythVideo/Video3.mkv
      Control D
      Can also select a random video
      via category
      randomcat:comedy
      via directory tree
      randomfile:/videobasedir/SciFi/Stargate
      This can also use option skipsubdirs
      randomfile:/videobasedir/SciFi skipsubdirs
      via title search. (sql wildcards, so % for any character)
      Random Video
      randomvid:%Stargate%
      Random Recording
      randomrec:%Stargate%
      Random Video or Recording
      random:%Stargate%
      Least played
      leastplayed:%Stargate%
      Most played
      mostplayed:%Stargate%
      Oldest played
      oldestplayed:%Stargate%
      Youngest played
      youngestplayed:%Stargate%
      Higest rated
      highestrating:%Stargate%
      Cast Member
      cast:%Humphrey Bogart%
      Director
      director:%Stanley Kubrick%
      These can also use options
      skipmountmedia - Skip over dvd/vcd/fsd's
      skiprepeats - Don't repeat same video in a random playlist
      skiplongerthan60 - Skip media longer than 60 mins.
      skipshorterthan60 - Skip media shorter than 60 mins.
      Read the script for further details on how to setup playlist.

    5. Enter Myth recordings (rec) into MythVideo.
      e.g.
      cat > Video_X.rec
      title:Series X
      subtitle:Episode Y
      Control D
      or
      cat > Video_X.rec
      recordingfile:2004_20080927042700.nuv
      Control D
      (recordingfile can be a full path, so this can be used to play any video in your filesystem)

    6. Enter Streams into MythVideo.
      e.g.
      cat > Stream_X.strm
      mrl:http://www.nasa.gov/55644main_NASATV_Windows.asx
      player:xine
      Control D
      Supported players are xine, mplayer, vlc, firefox.

    7. Run Video Manager and enter IMDB data as per normal operation.

Now when you run one of these Video entries in MythVideo, it will prompt for the DVD to be inserted and then play the DVD.
Or for *.pls, play each entry in turn, select and play the random video.
Or for *strm, play the stream.

Notes/
Creates a new table (videometadataplay) in database. This is where dvd volume name and lastplayed, playcount is stored. If mythvideoplayer.sh is not used for all video file types then the playcount/playtime searches (leastplayed, mostplayed, oldestplayed, youngestplayed) will have incomplete data and won't be accurate. If you don't won't to use these searches, then I would suggest not using mythvideoplayer.sh for all video file types.


The first time a title is played the Disc volume name and date is added to the database This is used on subsequent plays to check if the disc is already mounted and so eject/prompt can be skipped. Useful for playing multiple episodes from the same disc. However can't be worked out until a disk has been played once. If you label all your disc the same name and date then this will screw up. If this is the case add alwaysprompt option. e.g. mythvideoplayer.sh alwaysprompt %s. This can be done on a video by video basis via the MythVideo "unique player command"


Read the comments at the top of the script and set your play commands.
Read the comments at the top of the script for all options available for each MythVideo type.


By default playlists will run to completion (You can exit each title via the standard quit command for your player, but it will go onto the next title). To completely exit a Playlist you need to set LIRCENDCONFIG AND setup a remote button like.

begin
        remote = grayHauppauge
        prog = mythvideoplayer
        button = (Your remote button)
        repeat = 0
        config = quit
end


To take a snapshot and update the MythVideo coverfile you need to set LIRCSNAPSHOTCONFIG AND setup a remote button.
The same lirc button MUST be mapped in .lircrc for mythvideoplayer/mplayer/xine/vlc/mythtv screenshot functions.

begin   
        remote = grayHauppauge
        prog = mythvideoplayer
        button = pictures
        repeat = 0
        config = screenshot
end
begin  
       remote = grayHauppauge
       prog = mplayer
       button = pictures
       repeat = 0
       config = screenshot
end
begin
        remote = grayHauppauge
        prog   = xine
        button = pictures
        repeat = 0
        config = Snapshot
end


If you use firefox in any strm (Streams) you might find it useful to setup lircmd (Lirc mouse control) See http://www.lirc.org/html/index.html.
Also Firefox addon https://addons.mozilla.org/en-US/firefox/addon/8107 can be used to add a quit shortcut and then irxevent can be used to send this. See http://www.lirc.org/html/index.html for irxevent setup procedures.
e.g.

### irxevent ###
begin
        remote = grayHauppauge
        prog = irxevent
        button = hash
        config = Key ctrl-q CurrentWindow
end

See http://web.aanet.com.au/~auric/?q=node/22 for a full copy of my .lircrc file.
The irxevent process must be running. See http://web.aanet.com.au/~auric/?q=node/11 for a procedure to start this, just replace irexec with irxevent.
Finally https://addons.mozilla.org/en-US/firefox/addon/810 can be used to give firefox "fullscreen" ability.


See http://www.xbmc-tv.com/ for a list of XBMC strm files.
XBMC strm files don't have mrl: or player: tags thats OK if the mrl is the only entry in the file. If it does not work try it manually with mplayer, xine, vlc and if one of them works edit the strm file and add mrl: and player: tags.


Logs to /tmp/mythvideoplayer.log.


Sometimes the MythTV internal player will not auto play a DVD's menu and just show a blank screen. If this is the case hit you menu key and select DVD root menu.
You can use a strm file to start any program, just use it as the player: entry. However mrl: cannot be empty.
e.g. to start xbmc
mrl: NA
player: xbmc


Required Applications

  1. xosd - RPM xosd.
  2. xine, vlc or mplayer or something to play the source.

Change History
31 Dec 2009 V1.18 Bunch of fixes, including allowing spaces in directory/file names.
14 Sep 2009 V1.16 Remove volnorm filter which was a bad idea.
10 Sep 2009 V1.15 Many changes and additions
27 May 2009 V1.12 Major cleanup. zip/rar added (rar untested)
19 May 2009 V1.10 Fixed higestated. Added director, skipsubdirs. Cleanup
16 May 2009 V1.9 Fixed fsd, which I broke in 1.7
14 May 2009 V1.7 Added skipmountmedia skipreats options. Cleanup of pls code.
3 May 2009 V1.6 (Changed named. Massive changes)
-----------------------
19 Mar 2009 V1.26 Added another search location for mysql.txt file
25 Feb 2009 V1.25 Added Play Count info
5 Jan 2009 V1.24 Fix VCD bug.
6 Dec 2008 V1.23 Added Myth Internal player support. Fixed cleanup code.
24 Nov 2008 V1.22 Added XBMC strm support
23 Nov 2008 V1.21 Added Streaming media support
1 Nov 2008 V1.20 Better storage group support. cleanup random vid selection
29 Oct 2008 V1.19 added storage group support
11 Oct 2008 V1.18 added selecting a random video to pls. Plus some cleanups and possible fixes
27 Sep 2008 V1.16 added rec (myth recording) support
16 Sep 2008 V1.15 added pls (play list) support
9 Sep 2008 V1.14 added disc date to the volume name check
8 Sep 2008 V1.13 added disc volume check and skip eject/prompt if correct volume already mounted
6 Sep 2008 V1.12 added audio track selection and "filesystem" dvd support
23 Aug 2008 V1.10 added vcd support. (not well tested)
23 Aug 2008 V1.7 prompt includes contents of .dvd file. Changed to bash.
23 Aug 2008 V1.1 Initial release

reply

Sometimes the MythTV internal player will not auto play a DVD's menu and just show a blank screen. If this is the case hit you menu key and select DVD root menu.
You can use a strm file to start any program, just use it as the player: entry. However mrl: cannot be empty.
george
--------------------------
Thanks for the input

Auric