mythtvfs [-h|--help] mythtvfs [-V|--version] mythtvfs [options] -o host=BACKEND ORIGPATH MOUNT
"BACKEND" is the hostname of the MythTV backend system
"ORIGPATH" is the path to MythTV's recordings directory
"MOUNT" is a location to mount the new FUSE filesystem mythtvfs will establish.
Options:
-h, --help prints a help message and exits
-V, --version prints the version and exits
-d, -o debug enable debug output (implies -f)
-f foreground operation
-s disable multi-threaded operation
-o host=HOST MythTV backend hostname
-o port=PORT MythTV backend port number
-o format=FORMAT format to use for filename
-o date_format=FORMAT format to use for date fields (i.e. airdate)
-o datetime_format=S format to use for date+time fields (i.e. start)
-o short-display shorter filename display format
-o logfile=FILE write verbose logging to FILE
-o backend-version=N force a specific backend version
-o program-width=N force a specific backend program width
-o invalid-chars=STR list of characters not allowed in filenames
-o replacement-char=C character to replace invalid characters with
-o <option[=value]> passes FUSE-specific options to the FUSE system
The value of this is that it enables scripting of MythTV interactions using any scripting language, through standard file system type operations. Examples could include: a bash script for grepping through the listings to find a show and play it with mplayer; a Perl script to encode and copy episodes of your favorite television shows onto a video iPod; a Python script that downsamples/compresses recordings of a given tv series more than a month old to save disk space; a Ruby program to generate an alternate GUI interface to list available recordings and allow playing them via mplayer.
This may also be useful for users wishing to access mythtv and play recordings from systems that cannot run mythtv (such as if they're running different Linux distros).
A design goal is to provide compatibility with the in-filename metadata extraction capabilities in Galleon. See Filename Structure below.
Unless your MythTV backend is running locally, you will also need to enable NFS on the backend, export the MythTV video repository (typically /var/lib/mythtv) and establish an NFS mount locally (at, say, /srv/myth).
MythTVfs can then be started from the command line as root:
mythtvfs -o host=mythtv.my.network /srv/myth/recordings /media/mythtvfs
or you can mount mythtvfs via fstab, for example:
mythtvfs#/media/mythtvfs /srv/myth/recordings fuse noauto,host=mythtv.my.network 0 0
See EXAMPLES below for more alternatives.
{SERIES_TITLE}{AIR_DATE}{EPISODE_TITLE}{RECORD_DATE}{CHANNEL}{DURATION}{DESCRIPTION}FILE.mpg
Where ``RECORD_DATE'' has the format ``Sat Jan 24 22:58:00 2009'', and ``AIR_DATE'' has the format ``2005-03-31''. ``DURATION'' is measured in seconds, and ``CHANNEL'' is the shortened channel ``callsign''. ``FILE'' is the original MythTV filename for storage (e.g. ``1013_20051207210000_20051207220000.nuv''). The file ends with ``.mpg'' because Galleon will only recognize file extensions that it expects the TiVo to be able to play.
If you dislike the default filename format, you can change it using the ``format'' option.
-o port=PORT MythTV backend port number
-o format=FORMAT Format to use for filenames. Defaults to ``{%T}{%a}{%S}{%s}{%c}{%d}{%D}%f.mpg''. See below for what the various tags mean.
-o date_format=S Format to use within date fields, i.e. airdate. These tags follow strftime(1) rules.
-o datetime_format=S Format to use within date+time fields, i.e. start. These tags follow strftime(1) rules.
-o short-display shorter filename display format. Equivalent to setting format=``{%T}{%a}{%S}{%s}{%c}{%d}%f.mpg'', except for a slight change in the internal format of %s.
-o logfile=FILE write verbose logging to FILE
-o backend-version=N force a specific backend version
-o program-width=N force a specific backend program width
-o invalid-chars=STR list of characters not allowed in filenames
-o replacement-char=C character to replace invalid characters with
Other options passed directly to the FUSE system:
-o allow_other allow access to other users
-o allow_root allow access to root
-o nonempty allow mounts over non-empty file/dir
-o default_permissions enable permission checking by kernel
-o fsname=NAME set filesystem name
-o subtype=NAME set filesystem type
-o large_read issue large read requests (2.4 only)
-o max_read=N set maximum size of read requests
-o hard_remove immediate removal (don't hide files)
-o use_ino let filesystem set inode numbers
-o readdir_ino try to fill in d_ino in readdir
-o direct_io use direct I/O
-o kernel_cache cache files in kernel
-o [no]auto_cache enable caching based on modification times
-o umask=M set file permissions (octal)
-o uid=N set file owner
-o gid=N set file group
-o entry_timeout=T cache timeout for names (1.0s)
-o negative_timeout=T cache timeout for deleted names (0.0s)
-o attr_timeout=T cache timeout for attributes (1.0s)
-o ac_attr_timeout=T auto cache timeout for attributes (attr_timeout)
-o intr allow requests to be interrupted
-o intr_signal=NUM signal to send on interrupt (10)
-o modules=M1[:M2...] names of modules to push onto filesystem stack
-o max_write=N set maximum size of write requests
-o max_readahead=N set maximum readahead
-o async_read perform reads asynchronously (default)
-o sync_read perform reads synchronously
-o subdir=DIR prepend this directory to all paths
-o [no]rellinks transform absolute symlinks to relative
-o from_code=CHARSET original encoding of file names (default: UTF-8)
-o to_code=CHARSET new encoding of the file names (default: ANSI_X3.4-1968)
%a Airdate, e.g. ``1961-11-17'', defined by -o date_format
%c Station callsign, e.g. ``SCIFI''
%D Show description, e.g. ``The Earth begins moving closer to the sun.''
%d Show duration in seconds, e.g. ``1800''
%f mythtv file basename, e.g. ``1029_20090201053000.mpg''.
%S Show subtitle, e.g. ``The Midnight Sun''
%s Start time, e.g. ``05.30 AM Sun Feb 01, 2009'', defined by -o datetime_format
%T Show title, e.g. ``The Twilight Zone''
mythtvfs -o host=localhost /var/lib/mythtv/recordings /media/mythtvfs
For mounting against a remote host named 'sparky', with its mythtv dir NFS mounted locally at /myth, you might do:
mythtvfs -o allow_other,host=sparky /myth/recordings /media/mythtvfs
If you prefer a different file name format:
mythtvfs -o host=localhost,format="%T - %S - %s.mpg" /myth /mythtvfs
# ls | cut -d} -f 1 | sed -e ``s/{//'' | uniq -c
23 Dark Angel
7 Nature
4 Survivorman
26 The Colbert Report
42 The Daily Show With Jon Stewart
Listing Nature programs sorted by original air date with newest first:
# ls {Nature}* | cut -d} -f 2,3 | sed -e ``s/{//g'' | sed -e ``s/}/ /g'' | sort -r
2007-11-11 The Cheetah Orphans 2007-11-04 In the Valley of the Wolves 2007-10-28 Silence of the Bees 2007-02-11 Supersize Crocs 2005-02-13 From Orphan to King 2005-01-09 Violent Hawaii 2004-02-08 Diamonds
Play the oldest episode of Dark Angel by original air date:
# ls {Dark\ Angel}* | cut -d} -f 2,8 | sort -r | \
sed -e ``s/.*\}\(.*\)\.mpg$/\1/'' | head -1 | xargs mplayer
mythtvfs is free software; you can redistribute it and/or modify it under the terms of the GPL.
Manpage Copyright (C) 2007 by Bryce Harrington (licensed under the same terms as mythtvfs itself).
Format support based on work by Morty Abzug, and licensed under the same terms as mythtvfs itself.