[mythtv-users] How to update video list when copying over a new video?

Raymond Wagner raymond at wagnerrp.com
Sat Mar 24 21:29:56 UTC 2012


On 3/24/2012 16:07, Nick Rout wrote:
> On Sun, Mar 25, 2012 at 3:32 AM, Raymond Wagner<raymond at wagnerrp.com>  wrote:
>> On 3/24/2012 08:49, George Nassas wrote:
>>>> If you want to use external players, you'll have to use the old local-mount-based video setup
>>> No, you'll have to wrap your external player in a trivial shell script which strips off the myth junk to get the relative path and prepends something to place that path in your filesystem.
>> Or better yet, you wrap your external player in a less trivial
>> application that injects itself into the file access routines and makes
>> those external players capable handling myth:// URIs and remote
>> content.  This is the current plan.
> Has anyone written such a program?

For MythTV?  Not that I'm aware of.  Specifically, this wouldn't so much 
be an application, but a library that is applied through the LD_PRELOAD 
environmental variable.  This mechanism forces the library into the 
dynamic linker before anything else is loaded, including basic things 
like libc.  That allows you to override things like the file access 
routines, so for example when mplayer thinks it is opening 
'myth://Videos@yourbackend:6543/somefile.avi' from the filesystem, it is 
actually calling out through some shared MythTV library and streaming 
from a remote frontend.

Now this kind of thing can be a bit screwy, since you're trying to 
replace known, existing functions.  There is at least one set of tuner 
drivers that operates using such dark magic, and it seems wrong when you 
could just as easily just write a kernel module.  Additionally, the 
player may notice the '://' construct and try to open it as an internet 
URL, so you would likely want to give it some special filename that 
would be converted back to the information needed to access the file.

> ie something that takes a myth url and spits the resulting stream out on stdout?

Not that I know of, but it would only take a couple lines using the Perl 
or Python bindings to do so.  Both of which support remote file access, 
after which it's simply a matter of writing a loop to pump small amounts 
of data from the backend and into the stdout pipe.  Considering the 
standard pipe is only 64KB large, it would probably be advantageous to 
write some ringbuffer to store a couple MB of data, and push it into the 
pipe as it becomes available, rather than have the two stall waiting on 
each other.


More information about the mythtv-users mailing list