Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I seek wisdom and knowledge from my fellow monks. I need to unleash the magic of Perl to display text messages on three video monitors. Each monitor will need to receive different information in real to almost-real time, but can only contain text, preferrably large font. Your assistance is appreciated.

Replies are listed 'Best First'.
RE: Perl to Video?
by Anonymous Monk on Sep 01, 2000 at 02:01 UTC
    There is a Video4Linux module for perl, which you could presumably use to grab frames from 3 BT848 decoder cards, overlay text and output them to 3 different monitors somehow.. the output is probably harder than the input, and Perl is probably not the right language to use for this kind of stuff.. Also, please provide more detail on exactly what you want to do - if its displaying *just* text on 3 computer monitors, then i would simply hook up a budget PC to each monitor running a web server, and set one of the PCs to send messages to the other PCs via HTTP to tell them what to display on their monitor. You could use Perl/TK or even the OpenGL bindings for Perl for this type of thing. Running 3 monitors off 1 PC can be very tricky, although Windows, MAc and UNIX all support this to some extent.
      More detail... ok. I have three log files generated from Perl scripts. Each line contains ASCII text. I need to set up large video monitors/projectors so a large room can see the last entry of each log on each monitor. The screen would then be refreshed if a new entry to the log was made.
        ok, then i would definitely use, say, 3 old 486s - one for each monitor. If these are video monitors, as opposed to computer monitors, you'll need to either have video cards with TV out (PCI ATI All-in-Wonder or similar) or have an external scan converter for each PC (about $US 100 each) on your master station (could be one of the PCs driving the monitor), write a CGI script that performs a one-line tail on the specified logfile, and returns the text. Now you need to render the text into something readable from a distance. Use Perl/Tk to create a window with a label rendered in a large font (you may have to implement word-wrapping and create & destroy several labels at a time). Then simply set an infinite loop running, where each slave computer requests the cgi program from the masters web server using LWP, destroy the old labels and draw new ones. I would consider implementing the GUI clients in Java since its much easier (IMHO) to do graphical stuff like double buffering than it is with Perl/Tk courtesy of the AWT libraries. Its easy and fun to do cool stuff like fade out the previous line/wipe/dissolve etc. in Java. However the approach is identical whether you use java or perl and should work fine. I'm not sure if theres an SVGALIB/VESA SVGA library binding for Perl, but you might also consider doing it using the console framebuffer rather than an X/Windows/MacOS GUI Window.
        Why not just take 3 dumb terminals, log into the main machine and do `tail -f logfile`

        You can connect the projector as the display for each terminal.
Re: Perl to Video?
by merlyn (Sage) on Sep 01, 2000 at 01:11 UTC
      Thanks for your response. Sorry, I should have been more clear. I could probably get away with X, but I was hoping to find a way to drive each video card and write to them with something like a file handle and without X. In a dream world I could use Perl to do something like: tail -f -n 1 /var/log/messages > /dev/video1 tail -f -n 1 /var/log/xferlog > /dev/video2 tail -f -n 1 /var/log/secure > /dev/video3
        It sounds like you can use a regular unix "dumb terminal" to connect to the machine and have the output sent there.

        i'm not an administrator but i'd start searching for tty/pty/getty in the manpages