I think Tk is an ideal candidate for this project, since I could use a
StarPack, but I’ve used Tcl primarily for web-related and I don’t know
if I’m missing important details:
- can I use Tk to playback videos directly from a StarPack?
- do I have a complete control of the playback process from within tcl?
The user should not be able to stop/pause/skip/whatever the movie;
he/she must follow the course material and answer to a small number of
questions?
Thank you in advance
--
Giorgio Valoti
>Hi all,
>I got a request for a cross platform (Win/Mac OS X), completely
>self-contained, interactive video player. Details are still sketchy
>but this application should:
>- be directly executable from USB pen drive, no installation process
>should be involved;
>- play the movie, gather related answers from the user and send them
>back to a server.
>
>I think Tk is an ideal candidate for this project, since I could use a
>StarPack, but IοΏ½ve used Tcl primarily for web-related and I donοΏ½t know
>if IοΏ½m missing important details:
>- can I use Tk to playback videos directly from a StarPack?
>- do I have a complete control of the playback process from within
>tcl? The user should not be able to stop/pause/skip/whatever the
>movie; he/she must follow the course material and answer to a small
>number of questions?
>
For Windows there is tkvideo which provides a Tk widget that hooks up
to DirectX and can play some video formats. It's really been used for
webcams but can play .avi and .wmv and maybe others. The demo
application in the sources provides control (play,pause, stop and a
slider to move to a time point).
Another option is quicktimetcl which can do quicktime and maybe some
other formats and will work on Mac and Win.
No idea what you use on linux/unix.
--
Pat Thoyts http://www.patthoyts.tk/
To reply, rot13 the return address or read the X-Address header.
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD
uwe
Yes, I thought about quicktimetcl but it seems no longer maintained.
Depends on what type of video you like to play...
Aplpe is currently reimplementing QuickTime (Snow Leopard QuickTime X
and 7).
Investing any work in a QuickTime 7.x package is very likely
lost.
On video formats:
QuickTime has its own mpeg2 decoders, which you have to purchase from
Apple (20$).
Although perian is capable to display almost every codec including mpeg
2 it can't
be used for mpeg 2 video playback in QickTime...
...and perian is not availabe for Windows.
BTW: perian is based on ffmpeg as is mplayer
Included in ffmpeg is a stripped down video player : ffplay,
which has a command line interface.
There is already a cross-platform video player: videolan
X11 and Windows versions are implemented in Qt and OSX in Cocoa.
-roger
>
>
> There is already a cross-platform video player: videolan
> X11 and Windows versions are implemented in Qt and OSX in Cocoa.
>
Seems really interesting but it’s not clear to me how to embed the
player inside a Tk application? (as I said, I never developed with Tk,
only “pure” Tcl, so my questions could appear silly/naive).
--
Giorgio Valoti
Depends how seemless the integration has to be
--I don't think you can strip videolan off its gui...
If you do want to provide all the controls in Tk, but only let the
video player display the video --without its own decorum: ffplay
Tk contains the -container and -use properties for toplevel and
frame windows; these two properties together with winfo id are
being used to integrate any kind of window into a tk window hierarchy.
I suggest you should read the man pages on toplevel and frame.
-roger
>On 2009-11-16 14:10:02 +0100, Arndt Roger Schneider <arndt...@web.de> said:
>
>> There is already a cross-platform video player: videolan
>> X11 and Windows versions are implemented in Qt and OSX in Cocoa.
>>
>
>Seems really interesting but itÔøΩs not clear to me how to embed the
>player inside a Tk application? (as I said, I never developed with Tk,
>only ÔøΩpureÔøΩ Tcl, so my questions could appear silly/naive).
With tkvideo (windows only):
package require tkvideo
tkvideo .v -source Wildlife.wmv
pack .v -fill both -expand 1
.v start
You can...I started down that path maybe 1-2 years ago, and got it
semi working (on linux, didn't try other platforms). I got busy with
other things, so never finished it. It wasn't very straight forward
(at least to me)...maybe things have gotten better since then. I think
they were working on a new api lib.
There's also this Tcl module here http://www.crystalballinc.com/vlad/software/
, but I have never used it, so I'm not sure it capabilities.
> Giorgio Valoti <gior...@mac.com> writes:
>
>> On 2009-11-16 14:10:02 +0100, Arndt Roger Schneider <arndt...@web.de> said:
>>
>>> There is already a cross-platform video player: videolan
>>> X11 and Windows versions are implemented in Qt and OSX in Cocoa.
>>>
>>
>> Seems really interesting but it’s not clear to me how to embed the
>> player inside a Tk application? (as I said, I never developed with Tk,
>> only “pure” Tcl, so my questions could appear silly/naive).
>
> With tkvideo (windows only):
>
> package require tkvideo
> tkvideo .v -source Wildlife.wmv
> pack .v -fill both -expand 1
> .v start
(I replied privately to Pat but I think it could be useful to repost
the message here)
[…] I’m trying out TkVideo. I have downloaded the starkit version and the
tclkit interpreter (version 8.4). The demo launches but when I try to
play a .avi file I get this error:
error: no video source initialized
error: no video source initialized
while executing
"$app(video) pause"
(procedure "Pause" line 5)
invoked from within
"Pause $Application"
(procedure "SetFileSource" line 5)
invoked from within
"SetFileSource $Application $file"
(procedure "onFileOpen" line 10)
invoked from within
"onFileOpen ::::demo1"
(menu invoke)
I’ve also tried the same thing from the tk console:
tkvideo .v
.v configure -source "movie.avi"
--> failed to initialize video source: code 0x80040217
[…]
I’m using Win XP SP 2, Windows Media player 9 under Parallels on Mac OS X.
The .avi file is played as expected using Windows Media Player 9.
--
Giorgio Valoti
Just tried with .wmv and .mpeg clips with the same results.
>On Nov 17, 1:20 am, Arndt Roger Schneider <arndt.ro...@web.de> wrote:
>
>
>>Giorgio Valoti schrieb:
>>
>>
>>
>>>On 2009-11-16 14:10:02 +0100, Arndt Roger Schneider
>>><arndt.ro...@web.de> said:
>>>
>>>
>>>>There is already a cross-platform video player: videolan
>>>>X11 and Windows versions are implemented in Qt and OSX in Cocoa.
>>>>
>>>>
>>>Seems really interesting but it�s not clear to me how to embed the
>>>player inside a Tk application? (as I said, I never developed with Tk,
>>>only �pure� Tcl, so my questions could appear silly/naive).
>>>
>>>
>>Depends how seemless the integration has to be
>>--I don't think you can strip videolan off its gui...
>>
>>
>>
>
>You can...I started down that path maybe 1-2 years ago, and got it
>semi working (on linux, didn't try other platforms). I got busy with
>other things, so never finished it. It wasn't very straight forward
>(at least to me)...maybe things have gotten better since then. I think
>they were working on a new api lib.
>
>There's also this Tcl module here http://www.crystalballinc.com/vlad/software/
>, but I have never used it, so I'm not sure it capabilities.
>
>
>
So the question is whether it works cross-platform --the Aqua-gui is cocoa.
Videolan is partly implemented in lua and it
should be possible to slip a tk gui into it
using it as a bridge to integrate videolan into a tcl/tk application...
... would make it possible to bypass the
offical COM/dbus/applescript interface, too.
-roger
I’m thinking about sidestepping the tk solution altogether and use
Wub. Does this server block until a request is completed (like
tclhttpd, if I remember correctly)?