[mythtv-users] WISH: "Surf Mode" like ATI Media Center

f-myth-users at media.mit.edu f-myth-users at media.mit.edu
Tue Oct 31 22:50:36 UTC 2006


    Date: Tue, 31 Oct 2006 15:48:16 -0600
    From: Jerome Yuzyk <jerome at supernet.ab.ca>

    Maybe this is too much of a "TV" feature vs a "PVR" feature, but one handy 
    feature I miss from the ATI Media Center (pretty much a TV-only product) 
    is something they call "Surf Mode", wherein a grid of miniature snapshots  
    of each channel is updated sequentially from channel 1 to N. Clicking once 
    on a snapshot would play a configurable number of seconds of that channel. 
    Double-clicking would select that channel. It was handy as a live-ish 
    channel-selector, a "just looking for something to watch" grazing, and 
    also kinda cool to just keep running as wallpaper.

    I wish I knew enough to whip this up myself but I haven't a clue where to 
    start.

That's kind of a cute idea.

Here are a couple ideas for quick hacks to implement it; neither
directly uses MythTV, though, so you'll have to interlock with it
in some way to avoid using a tuner it's already got designs on.
(If you've got different sorts of inputs [e.g., cable boxes,
direct antenna/cable, etc] attached to different tuners, you
might have to get clever if you want to see 'em all, but that's
not insurmountable.)

Idea the first:

First, use ivtvtune or the v4l API or whatever to successively tune
different channels (one per second? whatever) and dump the results
into a single file (e.g., just keep switching channels while not
closing the stream).  Close the file when you've made a pass.

Hand the file to mplayer and use the "-ss" and "tile" options to
select a frame every n seconds (where n is the number of seconds
of video you're collecting between each tune) and tile them into
one larger image.  (Your argument to mplayer might have to account
for the time it takes for the new channel to tune, depending on
whether your particular capture device generates video while it's
retuning, or stops its stream during the retune instead.)

Finally, toss up the image using any image viewer.  Repeat.

I specified a file above and not a pipe simply because there might be
some timing skew if everything isn't perfect, and a pipe will allow
mplayer to drift out of sync with the tuner.  Using a file forces
everything to resynchronize at the upper left tile every time.

Idea the second:

If you want interactivity (e.g., your clicking behavior), then write
a script that tunes successive channels and dumps each one into a
different file.  Use mplayer (or whatever) to generate a snapshot from
some frame (probably the first) of each snippet.  Use all those images
to build a table in HTML whose elements are the images.  Each image
will have an HREF that points to some link that calls mplayer to play
the snippet so selected.  (You could have some other UI element that
says, "flush the static image from the screen, tune to that channel,
and play it directly from the tuner through mplayer onto the screen"
or the equivalent.)

Discussion:

Both of these are fairly gross hacks, but each one of them is probably
a dozen lines of Python or something at most, assuming you already
have tuner(s) you know you're not yanking out from under Myth.

(And if the hack works well enough, maybe somebody can write it as
some sort of plugin that Myth can use.  But such a plugin will
probably have to interact with LiveTV or schedule a dummy recording
or something to busy out the tuner(s) it's using.)

Note that neither one of them -quite- does the incremental-update
thing (instead, you get a new batch every few minutes instead of a
continuous round-robin refresh), but it might not be hard to simulate
that in some gross fashion (e.g., call mplayer with "tile" on every
channel change instead of after the batch is done, or reload the web
page on every channel change, etc), assuming you keep your bookkeeping
straight, which probably means just being careful about filenames, etc.

One interesting bit of fallout from this is that you can easily put
the still images on, e.g., any computer display and -not- the TV
itself---this means (a) the TV can be off while you "surf", and (b)
unless you've got an HDTV, you'll have way more resolution available
on most computer monitors, so the snapshots, while tiny, will still
look decent, whereas putting 50 tiny snapshots up on an SDTV will
probably look pretty fuzzy.


More information about the mythtv-users mailing list