• tkvideo error

    From Alexandru@21:1/5 to All on Mon Jan 24 11:23:05 2022
    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
    ---------------------------

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Mon Jan 24 21:47:14 2022
    Am 24.01.2022 um 20:23 schrieb Alexandru:
    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
    ---------------------------

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Werner@21:1/5 to All on Mon Jan 24 12:30:35 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alexandru@21:1/5 to Christian Werner on Mon Jan 24 13:58:23 2022
    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?


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

    BR,
    Christian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Werner@21:1/5 to Alexandru on Mon Jan 24 23:08:51 2022
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Werner@21:1/5 to All on Mon Jan 24 23:19:31 2022
    BTW, I've demo'ed tkvlc on EuroTcl 2019, see https://youtu.be/kBn_oGdA4jE?t=779

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alexandru@21:1/5 to Christian Werner on Fri Jan 28 05:14:47 2022
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alexandru@21:1/5 to Christian Werner on Fri Jan 28 05:19:55 2022
    Christian Werner schrieb am Dienstag, 25. Januar 2022 um 08:08:53 UTC+1:
    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.

    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?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Gollwitzer@21:1/5 to All on Fri Jan 28 15:37:49 2022
    Am 28.01.22 um 14:19 schrieb Alexandru:
    Christian Werner schrieb am Dienstag, 25. Januar 2022 um 08:08:53 UTC+1:
    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.

    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?

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Gollwitzer@21:1/5 to All on Fri Jan 28 16:10:18 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alexandru@21:1/5 to Christian Gollwitzer on Fri Jan 28 06:45:39 2022
    Christian Gollwitzer schrieb am Freitag, 28. Januar 2022 um 15:38:41 UTC+1:
    Am 28.01.22 um 14:19 schrieb Alexandru:
    Christian Werner schrieb am Dienstag, 25. Januar 2022 um 08:08:53 UTC+1:
    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.

    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?
    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

    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?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Gollwitzer@21:1/5 to All on Fri Jan 28 16:13:21 2022
    Am 28.01.22 um 16:10 schrieb Christian Gollwitzer:
    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.


    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alexandru@21:1/5 to Christian Gollwitzer on Fri Jan 28 07:18:42 2022
    Christian Gollwitzer schrieb am Freitag, 28. Januar 2022 um 16:11:35 UTC+1:
    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

    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..

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Rickster@21:1/5 to Alexandru on Fri Jan 28 11:05:41 2022
    On Monday, January 24, 2022 at 12:23:08 PM UTC-7, Alexandru wrote:
    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
    ---------------------------

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Gollwitzer@21:1/5 to All on Fri Jan 28 21:04:14 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Rickster@21:1/5 to All on Fri Jan 28 11:16:31 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alexandru@21:1/5 to All on Fri Jan 28 18:18:19 2022
    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!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alexandru@21:1/5 to [email protected] on Fri Jan 28 18:20:40 2022
    [email protected] schrieb am Freitag, 28. Januar 2022 um 20:16:34 UTC+1:
    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

    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?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alexandru@21:1/5 to Alexandru on Tue Feb 1 01:30:12 2022
    Alexandru schrieb am Samstag, 29. Januar 2022 um 03:18:22 UTC+1:
    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!

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)