Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

tkvideo error

164 views
Skip to first unread message

Alexandru

unread,
Jan 24, 2022, 2:23:08 PM1/24/22
to
Looks like tkvideo is not running on Win 10 64bit (error below)
Does this mean, I must compile myself?
Is there another source for the compiled version other than http://patthoyts.tk/tkvideo/?
Is there another package that can play video inside a Tcl/Tk widget?

Thanks
Alexandru

---------------------------
Error in startup script
---------------------------
couldn't load library "C:/Tcl/lib/tkvideo140/tkvideo140.dll": Bad exe format. Possibly a 32/64-bit mismatch.
while executing
"load C:/Tcl/lib/tkvideo140/tkvideo140.dll"
("package ifneeded tkvideo 1.4.0" script)
invoked from within
"package require tkvideo 1.4.0"
(file "C:/Tcl/lib/tkvideo140/demos/demo.tcl" line 12)
invoked from within
"source [file join $::starkit::topdir demos demo.tcl]"
invoked from within
"if {[starkit::startup] ne "sourced"} {
source [file join $::starkit::topdir demos demo.tcl]
}"
(file "C:\Tcl\lib\tkvideo140\main.tcl" line 2)
---------------------------
OK
---------------------------

Christian Werner

unread,
Jan 24, 2022, 3:30:37 PM1/24/22
to
Howdy Alexandru,

guess you're searching for video playback only.

This might do the job: https://github.com/ray2501/tkvlc

And this would be interesting, too: https://github.com/ray2501/tcl-opencv
it you manage to build it on Windows.

BR,
Christian

Harald Oehlmann

unread,
Jan 24, 2022, 3:47:18 PM1/24/22
to
Alexandru,

I have never heared that a DLL does not run on Win10, while running on
Win8. I suppose, the error is really what is shown: 32/64 bit mismatch
of the tcl interpreter and the DLL.
There might also an issue, that it is compiled with unix-like tools, but
the extension ".dll" does not suggest this.

Harald

Alexandru

unread,
Jan 24, 2022, 4:58:25 PM1/24/22
to
Christian Werner schrieb am Montag, 24. Januar 2022 um 21:30:37 UTC+1:
> Howdy Alexandru,
>
> guess you're searching for video playback only.
>
> This might do the job: https://github.com/ray2501/tkvlc

Thanks for the tip.
I couldn't find any precompiled package of tkvlc.
Compiling seems to require the libVLC SDk, which I also couldn't find.
At least not in 10 min of internet search.
Any hidden links?

Christian Werner

unread,
Jan 25, 2022, 2:08:53 AM1/25/22
to
Alexandru schrieb am Montag, 24. Januar 2022 um 22:58:25 UTC+1:

> I couldn't find any precompiled package of tkvlc.
> Compiling seems to require the libVLC SDk, which I also couldn't find.
> At least not in 10 min of internet search.
> Any hidden links?

A fossil clone of www.androwish.org has the tkvlc source in the .../undroid/tkvlc directory.
It contains a compat directory with required VLC headers and builds tkvlc to runtime link VLC libraries which you need to install separately.

Good luck,
Christian

PS: alternatively, extract the matching tkvlc.dll from a vanillawish binary of 2019 using 7z. In any case, you need a separate VLC install for this extension.

Christian Werner

unread,
Jan 25, 2022, 2:19:33 AM1/25/22
to
BTW, I've demo'ed tkvlc on EuroTcl 2019, see https://youtu.be/kBn_oGdA4jE?t=779

Alexandru

unread,
Jan 28, 2022, 8:14:50 AM1/28/22
to
Christian Werner schrieb am Dienstag, 25. Januar 2022 um 08:19:33 UTC+1:
> BTW, I've demo'ed tkvlc on EuroTcl 2019, see https://youtu.be/kBn_oGdA4jE?t=779
Incredible demo! Nice work.

Alexandru

unread,
Jan 28, 2022, 8:19:57 AM1/28/22
to
I guess, the need for a VLC install is the party braker for me.
So currently there is no precompiled, stand alone package that can play videos for TCL, right?

Christian Gollwitzer

unread,
Jan 28, 2022, 9:38:41 AM1/28/22
to
Am 28.01.22 um 14:19 schrieb Alexandru:
Maybe you could ship an mplayer or ffmpeg binary? They are comparatively
small / standalone. Under Linux, there is an option to make mplayer
render into a Tk container frame (option -wid), however I fear that this
does not work on Windows.

https://wiki.tcl-lang.org/page/How+to+embed+a+non-Tk+GUI+into+a+Tk+frame

Christian

Alexandru

unread,
Jan 28, 2022, 9:45:43 AM1/28/22
to
I guess, ffmpeg is an option after all.
So the idea with ffmpeg would be to extract the single frames from the video and than display them in a cycle inside a tk widget?

Christian Gollwitzer

unread,
Jan 28, 2022, 10:11:35 AM1/28/22
to
Am 28.01.22 um 15:45 schrieb Alexandru:
> I guess, ffmpeg is an option after all.
> So the idea with ffmpeg would be to extract the single frames from the video and than display them in a cycle inside a tk widget?

That could work, but only for rather small videos, due to the overhead
of transferring the data to disk, then Tk, then to the screen...

The idea was rather to tell ffmpeg to play the video (ffplay) to the
screen. Then you just need a way to reposition or reparent the playback
window. Maybe TWAPI can do that or ffmpeg hsa some kind of slave mode.

Christian

Christian Gollwitzer

unread,
Jan 28, 2022, 10:14:36 AM1/28/22
to
Am 28.01.22 um 16:10 schrieb Christian Gollwitzer:
https://stackoverflow.com/questions/60032301/embedding-ffplay-window-into-tkinter-frame-by-using-setparent-win32gui-function

Here is someone who managed to do that from Python using the equivalent
of TWAPI (win32gui)

Christian

Alexandru

unread,
Jan 28, 2022, 10:18:45 AM1/28/22
to
Speaking of performance:
The process in my case is:
1. Download the video using http::get
2. Play the video in a separate ttk::frame or toplevel together with other widgets such as pictures and text.

Other way to see it: I need tooltips that can show web content.
The idea of using an html parser/renderer also came to my mind (http://tkhtml.tcl.tk/index.html). But since I only need simple tooltips consisting of few images, text and videos, a direct implementation would be more light than a full blown html rederer..

The Rickster

unread,
Jan 28, 2022, 2:05:45 PM1/28/22
to

The Rickster

unread,
Jan 28, 2022, 2:16:34 PM1/28/22
to
I have been down this road. MCI doesn't work either

The most straight forward solution begins with: http://www.mplayerhq.hu/design7/dload.html
MPlayer files in the the directory referenced in the command line. You can save them whereever. Also, download the 'slave' documentation.

Please don't laugh at my code.

Rick


proc mplayer {f args} {
set options {-width 940 -height 788}
while {[string match -* $args]} {
if {[lindex $args 0] eq "--"} then {
set args [lrange $args 1 end]
break
} else {
set args [lassign $args key val]
dict set options $key $val
}
}
frame .tMPlayer.$f -class Mplayer -background yellow -container yes {*}$options
set bOK [button .tMPlayer.bOK -text OK]
pack $bOK .tMPlayer.$f -side left
pack propagate .tMPlayer 0
set wid [winfo id .tMPlayer.$f]

# have -colorkey match window background
set channel \
[open [concat | ../shared/snitMP/mplayer.exe -quiet -idle -slave -vo directx -colorkey 0xff0000 -wid $wid $args] r+]
flush $channel
bind .tMPlayer.$f <Destroy> [subst {
catch {
rename .tMPlayer.$f ""
puts $channel quit
flush $channel
close $channel
}
}]
#rename $f "_$f"

proc $f {cmd args} [subst -nocommand {
puts \$cmd
puts \$args
if {\$cmd eq "cmd"} then {
puts $channel \$args
flush $channel
} else {
_$f \$cmd [list \$args]
}
}]


bind .tMPlayer.$f <1> [list focus .tMPlayer.$f]
bind .tMPlayer.$f <Map> [list focus .tMPlayer.$f]
bind .tMPlayer.$f <space> "$f cmd pause"
bind $f <Return> "$f cmd pt_step 1"
bind $f <less> "$f cmd pt_step -1"
bind $f <Right> "$f cmd seek 10"
bind $f <Left> "$f cmd seek -10"
bind $f <Down> "$f cmd seek -100"
bind $f <Up> "$f cmd seek 100"
bind .tMPlayer.$f <question> "$f cmd osd_show_progression"
bind $f 9 "$f cmd volume -1"
bind $f 0 "$f cmd volume 1"
puts "[set f]"
}

toplevel .tMPlayer -background #0000ff -width 1000 -height 900
mplayer movieplayer
movieplayer cmd loadfile http or your file name.mp4
update

Christian Gollwitzer

unread,
Jan 28, 2022, 3:04:22 PM1/28/22
to
Am 28.01.22 um 16:18 schrieb Alexandru:
> Speaking of performance:
> The process in my case is:
> 1. Download the video using http::get
> 2. Play the video in a separate ttk::frame or toplevel together with other widgets such as pictures and text.
>
> Other way to see it: I need tooltips that can show web content.
> The idea of using an html parser/renderer also came to my mind (http://tkhtml.tcl.tk/index.html). But since I only need simple tooltips consisting of few images, text and videos, a direct implementation would be more light than a full blown html rederer..


While I don't really understand what the tooltip is for, there is a
version on the wiki with a widget for playing a video from the web:

https://wiki.tcl-lang.org/page/SnitMPlayer

According to the message by Rickster downthread, that should work on
Windows, too.

You will need to replace the youtube-dl thing with http::get according
to your needs.

Or even not: MPlayer can also play a video directly from an HTTP server,
so if you tell it to open something like
http://myserver.de/path/tovideo.mp4 on your own server then it will play
the video instantly, i.e. stream it from the URL.

Christian

Alexandru

unread,
Jan 28, 2022, 9:18:22 PM1/28/22
to
> Or even not: MPlayer can also play a video directly from an HTTP server,
> so if you tell it to open something like
> http://myserver.de/path/tovideo.mp4 on your own server then it will play
> the video instantly, i.e. stream it from the URL.
>
> Christian

Oh, that's key information. I'm starting to like mplayer.
Thanks!

Alexandru

unread,
Jan 28, 2022, 9:20:42 PM1/28/22
to
Hm, I tried your code, but not much is happening. I see a yellow frame but not the video. mplayer is downloaded, I even changed relative paths in your code to full paths. Is there some key I should press to start the playback?

Alexandru

unread,
Feb 1, 2022, 4:30:14 AM2/1/22
to
So I can start mplayer with an URL. I can even specify window size and position on the screen.
Theoretically that should be enough to play videos from Tcl/Tk.

There is only on thing that bothers me: the video is played in a new window that shows the typical Windows Close/Full/Minimize buttons on the top left corner.

Is there a way to integrate mplayer directly into a Tcl/Tk frame? The -wid option does not seems to work with Tcl/Tk.
0 new messages