[mythtv-users] OT: Linux Question

Joseph A. Caputo jcaputo1 at comcast.net
Thu Mar 11 12:34:51 EST 2004


On Thursday 11 March 2004 11:26, Jason Schloer wrote:
> Okay this is pretty offtopic, but I want it for my Myth box, so I
> figure I'd pick the brains of this well rounded list.
> The challenge is I want a fake directory setup which mirrors an
> actual directory (lists files, etc.), but runs a script on the files
> when they are accessed. Details follow:
>
> Basically I'm putting all of my CDs onto my myth box for use with
> Myth Music. I've then shared the directory out with Samba so that I
> can access it with windows boxes, etc. I just bought my girlfriend a
> new MP3 player and transferring to it works like a charm, however
> I've been encoding all of my CDs at high quality since I'll be
> playing them out of my stereo. But at high quality she gets very few
> songs on the 128MB that come with the Rio. So what I want to do is
> setup a directory which would mirror the mp3 directory and run a
> script on each file as it is accessed, so that I can recompress it on
> the fly. As it is I run icecast with ices to listen to my music at
> work, so I know I can recompress to 56kbps quickly and with decent
> enough quality for cheap earbud headphones. So in theory if I had
> this I could create a virtual directory like
> /var/music/recompress/56k or /var/music/recompress/128k. Then
> whenever I transfer a file from the directory it would recompress it.
> Then I could share it with Samba and get the files at lower quality
> automatically.
>
> Anyway, without rambling further, is this possible with existing
> features and tools in linux? Or will I need to look into writing
> something myself? Thanks in advance for the help

Sounds intriguing... off the top of my head, I'd guess this would 
require creating a new type of virtual filesystem, which would probably 
mean writing a kernel module.  You might want to google around for 
linux + virtual filesystem and see if anything like this exists.

In the meantime, the simple answer would be to set up a script or 
something to approximate this behavior.  If it were me, I'd consider 
writing a web interface that supported download of files, but which did 
the re-encoding on the fly before downloading.  As a matter of fact, 
I'd wager something like this already exists.  Google & Freshmeat are 
your friends!

-JAC


More information about the mythtv-users mailing list