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

Noble monks:

I am learning to use Perl/Tk, and I've had great sucess due to a number of past nodes at the Monestary. However, after a search of Google, the Monestary, and the CPAN, I am unable to find a Tk Widget that allows me to embed a video into a Tk frame.

I have found Tk::Animation, but that does not deal with video as far as I can tell.

So, my questions are two:

Any pointers or ideas are welcome.

radiantmatrix
require General::Disclaimer;

Replies are listed 'Best First'.
Re: Video components for Tk?
by elwarren (Priest) on Oct 12, 2004 at 16:50 UTC
    I have looked into this several times and found nothing that works for my needs, last I looked. It will be very platform dependent. Are you running on windows or unix?

    I cheated and make system calls to two tools for video playback in my car. I use mplayer with a geometry switch on the command line to put the window exactly where I want it, as well as a couple more flags to handle zooming and scaling the video to fit, run with no borders, and to reuse the same window when playing files in succession.

    The second program is feh, which I use to playback images captured from the cam in a very fast flipbook style animation. Same deal, no borders, geometry tags, etc... I can post the command line params this evening if anyone is interested.

    On the windows machine I've used the gplayer utility from the UnxUtils package, which basically plays back a video in a frameless window via mediaplayer api calls.

      Yup, there really isn't anything that is pure Perl based. We typically end up calling another app (mplayer, wmplayer, etc) and controlling it from Perl. Granted, we can tell the players, usually, to display without a frame in a specified 'window' - meaning embedded video.

      Since displaying video and syncing the sound are time critical, your best bet is to control the player from perl.

      Jason L. Froebe

      No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

Re: Video components for Tk?
by Courage (Parson) on Oct 12, 2004 at 17:05 UTC
    You can use Tcl/Tk via Tcl::Tk Perl module so to get access to video wiget from Perl.

    But first you must install Tcl/Tk with said widget (these widgets are refered for example from http://mini.net/tcl/864, see QuickTimeTcl and http://developer.berlios.de/projects/tkvideo on that page) and then you will have access to it.

    Also, in case your $^O equals to 'MSWin32' you can use Win32 ActiveX control from within Perl+Tcl::Tk and gain same effect, but OS-dependant.
    Example of using ActiveX is at the bottom of page http://vkonovalov.ru/perl-tcltk.htm

    Courage