3
mythtvfs - a FUSE filesystem for accessing and managing MythTV
9
mythtvfs [-V|--version]
10
mythtvfs [options] -o host=BACKEND ORIGPATH MOUNT
12
C<BACKEND> is the hostname of the MythTV backend system
14
C<ORIGPATH> is the path to MythTV's recordings directory
16
C<MOUNT> is a location to mount the new FUSE filesystem
17
mythtvfs will establish.
21
-h, --help prints a help message and exits
22
-V, --version prints the version and exits
23
-d, -o debug enable debug output (implies -f)
24
-f foreground operation
25
-s disable multi-threaded operation
26
-o host=HOST MythTV backend hostname
27
-o port=PORT MythTV backend port number
28
-o short-display shorter filename display format
29
-o logfile=FILE write verbose logging to FILE
30
-o backend-version=N force a specific backend version
31
-o program-width=N force a specific backend program width
32
-o <option[=value]> passes FUSE-specific options to the FUSE system
36
B<mythtvfs> is a "filesystem in userspace" (FUSE) interface to the
37
MythTV Personal Video Recorder (PVR) software, that allows you to
38
interact with mythtv as if it were a file system. It creates an overlay
39
filesystem that encodes recording metadata (title, episode, description,
40
etc.) into a filename so that systems that do not natively talk to
41
MythTV can still get information about a given show. This allows use of
42
standard UNIX programs (ls, grep, cut, sort) to search and select
43
programs, and permits running video software like mplayer directly from
44
the command line rather than via the normal MythTV GUI frontend.
46
The value of this is that it enables scripting of MythTV interactions
47
using any scripting language, through standard file system type
48
operations. Examples could include: a bash script for grepping through
49
the listings to find a show and play it with mplayer; a Perl script to
50
encode and copy episodes of your favorite television shows onto a video
51
iPod; a Python script that downsamples/compresses recordings of a given
52
tv series more than a month old to save disk space; a Ruby program to
53
generate an alternate GUI interface to list available recordings and
54
allow playing them via mplayer.
56
This may also be useful for users wishing to access mythtv and play
57
recordings from systems that cannot run mythtv (such as if they're
58
running different Linux distros).
60
A design goal is to provide compatibility with the in-filename metadata
61
extraction capabilities in Galleon. See Filename Structure below.
65
After installing the FUSE libraries and kernel modules, mythtvfs can be
66
built using the standard `./configure && make`.
68
Unless your MythTV backend is running locally, you will also need to
69
enable NFS on the backend, export the MythTV video repository (typically
70
/var/lib/mythtv) and establish an NFS mount locally (at, say,
73
MythTVfs can then be started from the command line as root:
75
mythtvfs -o host=mythtv.my.network /srv/myth/recordings /media/mythtvfs
77
or you can mount mythtvfs via fstab, for example:
79
mythtvfs#/media/mythtvfs /srv/myth/recordings fuse noauto,host=mythtv.my.network 0 0
81
See EXAMPLES below for more alternatives.
84
=head2 Filename Structure
86
Filenames in the MythTVfs filesystem are named based on their TV
87
Program's metadata. The elements are contained by the brace symbols
88
("{}") and have the original filename embedded, and then end with
91
{SERIES_TITLE}{AIR_DATE}{EPISODE_TITLE}{RECORD_DATE}{CHANNEL}{DURATION}{DESCRIPTION}FILE.mpg
93
Where "RECORD_DATE" has the format "07.15 PM Wed Mar 31, 2005", and
94
"AIR_DATE" has the format "2005-03-31". "DURATION" is measured in
95
seconds, and "CHANNEL" is the shortened channel "callsign". "FILE" is
96
the original MythTV filename for storage
97
(e.g. "1013_20051207210000_20051207220000.nuv"). The file ends with
98
".mpg" because Galleon will only recognize file extensions that it
99
expects the TiVo to be able to play.
102
=head2 Hooking to Galleon
104
You'll need a version of Galleon that understands this file format
105
layout. A patch against 2.1.0 is available on the MythTVfs homepage.
106
Just add a "GoBack" path that matches your MythTVfs mount point, and it
107
will automatically extract all the metadata from the filename.
114
=item B<-h>, B<--help>
116
Prints a synopsis of program usage and exits.
118
=item B<-V>, B<--version>
120
Prints the program version and exits.
122
=item B<-d>, B<-o debug>
124
Enable debug output (implies -f)
132
disable multi-threaded operation
134
=item B<-o> B<option>[=I<value>]
136
-o host=HOST MythTV backend hostname
138
-o port=PORT MythTV backend port number
140
-o short-display shorter filename display format
142
-o logfile=FILE write verbose logging to FILE
144
-o backend-version=N force a specific backend version
146
-o program-width=N force a specific backend program width
148
Other options passed directly to the FUSE system:
150
-o allow_other allow access to other users
152
-o allow_root allow access to root
154
-o nonempty allow mounts over non-empty file/dir
156
-o default_permissions enable permission checking by kernel
158
-o fsname=NAME set filesystem name
160
-o subtype=NAME set filesystem type
162
-o large_read issue large read requests (2.4 only)
164
-o max_read=N set maximum size of read requests
166
-o hard_remove immediate removal (don't hide files)
168
-o use_ino let filesystem set inode numbers
170
-o readdir_ino try to fill in d_ino in readdir
172
-o direct_io use direct I/O
174
-o kernel_cache cache files in kernel
176
-o [no]auto_cache enable caching based on modification times
178
-o umask=M set file permissions (octal)
180
-o uid=N set file owner
182
-o gid=N set file group
184
-o entry_timeout=T cache timeout for names (1.0s)
186
-o negative_timeout=T cache timeout for deleted names (0.0s)
188
-o attr_timeout=T cache timeout for attributes (1.0s)
190
-o ac_attr_timeout=T auto cache timeout for attributes (attr_timeout)
192
-o intr allow requests to be interrupted
194
-o intr_signal=NUM signal to send on interrupt (10)
196
-o modules=M1[:M2...] names of modules to push onto filesystem stack
198
-o max_write=N set maximum size of write requests
200
-o max_readahead=N set maximum readahead
202
-o async_read perform reads asynchronously (default)
204
-o sync_read perform reads synchronously
206
-o subdir=DIR prepend this directory to all paths
208
-o [no]rellinks transform absolute symlinks to relative
210
-o from_code=CHARSET original encoding of file names (default: UTF-8)
212
-o to_code=CHARSET new encoding of the file names (default: ANSI_X3.4-1968)
216
=head2 Filesystem Mount Examples
218
To create a /media/mythtvfs on a local MythTV system (both backend and
219
frontend are on the same system)
221
mythtvfs -o host=localhost /var/lib/mythtv/recordings /media/mythtvfs
223
For mounting against a remote host named 'sparky', with its mythtv dir
224
NFS mounted locally at /myth, you might do:
226
mythtvfs -o allow_other,host=sparky /myth/recordings /media/mythtvfs
229
=head2 Command Line Use
231
Show a listing of all recorded titles and number of episodes for each:
233
# ls | cut -d} -f 1 | sed -e "s/{//" | uniq -c
238
26 The Colbert Report
239
42 The Daily Show With Jon Stewart
241
Listing Nature programs sorted by original air date with newest first:
243
# ls {Nature}* | cut -d} -f 2,3 | sed -e "s/{//g" | sed -e "s/}/ /g" | sort -r
245
2007-11-11 The Cheetah Orphans
246
2007-11-04 In the Valley of the Wolves
247
2007-10-28 Silence of the Bees
248
2007-02-11 Supersize Crocs
249
2005-02-13 From Orphan to King
250
2005-01-09 Violent Hawaii
253
Play the oldest episode of Dark Angel by original air date:
255
# ls {Dark\ Angel}* | cut -d} -f 2,8 | sort -r | \
256
sed -e "s/.*\}\(.*\)\.mpg$/\1/" | head -1 | xargs mplayer
261
L<http://outflux.net/software/pkgs/mythtvfs-fuse/>
265
=head2 No listings in /media/mythtvfs, but files present in /myth/recordings
267
Check that the mythtv system's mysql process is running.
269
=head2 "myhost: Connection timed out"
271
Doublecheck that the second argument to mythtvfs is a valid hostname
272
that is network accessible. Try running `ping myhost`.
274
=head2 "fuse: bad mount point `/media/mythtvfs': Transport endpoint is not connected"
276
Something appears to have killed the mythtvfs process or mythtvfs has
277
otherwise died (perhaps due to a bug you should report?) rendering its
278
mount point unavailable. Try umount'ing the mount point, killing the
279
mythtvfs process (if it's hung), and re-establishing the mythtvfs
280
process. In the worst case, it may be required to reboot the system to
281
get things back to normal.
283
=head2 "umount: /media/mythtvfs: device is busy"
285
A process is still accessing the mythtvfs file system, preventing it
286
from being unmounted. Try running `lsof | grep mythtvfs` to find
287
processes that may have open file handles in the file system.
292
Please report bugs directly to the author.
297
B<mythtvfs> was written initially with the motivation to connect mythtv
301
=head1 COPYRIGHT AND LICENSE
303
B<Copyright (C)> 2005-2008 by Kees Cook
305
B<mythtvfs> is free software; you can redistribute it and/or modify it
306
under the terms of the GPL.
308
Manpage B<Copyright (C)> 2007 by Bryce Harrington (licensed under the same
309
terms as mythtvfs itself).