Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Bus error -- please leave by the rear door.


devel / comp.lang.tcl / Re: MPV Video Player and Tk

SubjectAuthor
* MPV Video Player and TkWestermeyer
+* Re: MPV Video Player and Tkapn
|`- Re: MPV Video Player and Tkapn
+* Re: MPV Video Player and TkThe Rickster
|`* Re: MPV Video Player and TkWestermeyer
| `* Re: MPV Video Player and Tket4
|  `* Re: MPV Video Player and TkWestermeyer
|   +* Re: MPV Video Player and TkAlexandru
|   |`* Re: MPV Video Player and TkAlexandru
|   | `- Re: MPV Video Player and TkChristian Gollwitzer
|   `* Re: MPV Video Player and Tket4
|    `* Re: MPV Video Player and TkWestermeyer
|     +- Re: MPV Video Player and TkWestermeyer
|     `- Re: MPV Video Player and Tket4
`- Re: MPV Video Player and TkThe Rickster

1
MPV Video Player and Tk

<b9eaab43-647f-4e34-83f6-0921611d9a3dn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19586&group=comp.lang.tcl#19586

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:600c:4f10:b0:39c:7e7d:b9de with SMTP id l16-20020a05600c4f1000b0039c7e7db9demr18905983wmq.94.1656393915365;
Mon, 27 Jun 2022 22:25:15 -0700 (PDT)
X-Received: by 2002:a05:6870:15c9:b0:101:e18b:d12d with SMTP id
k9-20020a05687015c900b00101e18bd12dmr12239072oad.51.1656393914800; Mon, 27
Jun 2022 22:25:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.128.87.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Mon, 27 Jun 2022 22:25:14 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2600:8801:c918:aa00:c0ff:745:a7e8:ff8f;
posting-account=WI8jHwoAAAD5efFArnqHarz-JcS9Naxl
NNTP-Posting-Host: 2600:8801:c918:aa00:c0ff:745:a7e8:ff8f
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b9eaab43-647f-4e34-83f6-0921611d9a3dn@googlegroups.com>
Subject: MPV Video Player and Tk
From: stephen.scherer.21337@gmail.com (Westermeyer)
Injection-Date: Tue, 28 Jun 2022 05:25:15 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Westermeyer - Tue, 28 Jun 2022 05:25 UTC

Hello All,

I've got a question about the MPV video player and possible Tk bindings...

From their page, there is a link to the language bindings:
https://github.com/mpv-player/mpv/wiki/Language-bindings

Would it be possible to implement a player in Tcl/Tk?

Thanks

Re: MPV Video Player and Tk

<t9htv3$1fqe4$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19604&group=comp.lang.tcl#19604

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: palmtcl@yahoo.com (apn)
Newsgroups: comp.lang.tcl
Subject: Re: MPV Video Player and Tk
Date: Wed, 29 Jun 2022 21:47:39 +0530
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <t9htv3$1fqe4$1@dont-email.me>
References: <b9eaab43-647f-4e34-83f6-0921611d9a3dn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 29 Jun 2022 16:17:39 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="5419ec43b2066645bfbacd87b9daa653";
logging-data="1567172"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19zttLBSsHDDFTmVTABFTIM"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.10.0
Cancel-Lock: sha1:LoExKqkpLawKZrwPA2JtuDWH1VI=
Content-Language: en-US
In-Reply-To: <b9eaab43-647f-4e34-83f6-0921611d9a3dn@googlegroups.com>
 by: apn - Wed, 29 Jun 2022 16:17 UTC

On 6/28/2022 10:55 AM, Westermeyer wrote:
> Hello All,
>
> I've got a question about the MPV video player and possible Tk bindings...
>
> From their page, there is a link to the language bindings:
> https://github.com/mpv-player/mpv/wiki/Language-bindings
>
> Would it be possible to implement a player in Tcl/Tk?
>
> Thanks

There is an implementation somewhere on the wiki. Not sure how old or
how complete.

Also seems like something you could bind with either cffi or ffidl
without too much effort.

/Ashok

Re: MPV Video Player and Tk

<t9i0un$1g632$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19606&group=comp.lang.tcl#19606

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!news.freedyn.de!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: palmtcl@yahoo.com (apn)
Newsgroups: comp.lang.tcl
Subject: Re: MPV Video Player and Tk
Date: Wed, 29 Jun 2022 22:38:35 +0530
Organization: A noiseless patient Spider
Lines: 51
Message-ID: <t9i0un$1g632$1@dont-email.me>
References: <b9eaab43-647f-4e34-83f6-0921611d9a3dn@googlegroups.com>
<t9htv3$1fqe4$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 29 Jun 2022 17:08:39 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="5419ec43b2066645bfbacd87b9daa653";
logging-data="1579106"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+F9UT0wKGcMZttNvWKuHCK"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.10.0
Cancel-Lock: sha1:F2OVuXsgh1GhnFnF2ZhpNXG6dQU=
Content-Language: en-US
In-Reply-To: <t9htv3$1fqe4$1@dont-email.me>
 by: apn - Wed, 29 Jun 2022 17:08 UTC

On 6/29/2022 9:47 PM, apn wrote:
> Also seems like something you could bind with either cffi or ffidl
> without too much effort.
>
> /Ashok

To follow up on the above, here is an interactive session to play mp4
using cffi. This is of course very rudimentary, frail and probably not
optimal cffi definitions. A real package for mpv will need considerable
work to understand the api and map it to cffi. Still, just for grins...

(in wish)

% package req cffi
1.0.7
% cd d:/src/libmpv
% dir
D:/src/libmpv:
include libmpv.dll.a mpv-2.dll mpv.def
% cffi::Wrapper create libmpv mpv-2.dll
::libmpv
% libmpv function mpv_create pointer.mpv_handle {}
::mpv_create
% libmpv function mpv_initialize int {ctx pointer.mpv_handle}
::mpv_initialize
% libmpv function mpv_destroy void {ctx {pointer.mpb_handle dispose}}
::mpv_destroy
% set ctx [mpv_create]
0x000001841cb77a00^::mpv_handle
% mpv_initialize $ctx
0 % libmpv function mpv_command int {ctx pointer.mpv_handle args
{pointer[3] nullok}}
::mpv_command
% cd {C:\Users\ashok\Videos\Captures}
% dir
C:/Users/ashok/Videos/Captures:
mpv-test.mp4
% set cmd [cffi::memory fromstring "loadfile"]
0x000001841a32c570^
% set file [cffi::memory fromstring mpv-test.mp4]
0x000001841a32dd10^
% set args [list $cmd $file NULL]
0x000001841a32c570^ 0x000001841a32dd10^ NULL
% mpv_command $ctx $args
0

The video is playing at this point.

The above was translated from the C sample at
https://github.com/mpv-player/mpv-examples/blob/master/libmpv/simple/simple.c

Re: MPV Video Player and Tk

<7708e9bd-81f3-4b13-aada-4f1c0f7ffb53n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19611&group=comp.lang.tcl#19611

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:adf:fbc6:0:b0:21d:3fc3:99e with SMTP id d6-20020adffbc6000000b0021d3fc3099emr3397748wrs.550.1656610982153;
Thu, 30 Jun 2022 10:43:02 -0700 (PDT)
X-Received: by 2002:a9d:3783:0:b0:60e:319a:25c2 with SMTP id
x3-20020a9d3783000000b0060e319a25c2mr4674612otb.7.1656610981410; Thu, 30 Jun
2022 10:43:01 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!2.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.128.88.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Thu, 30 Jun 2022 10:43:01 -0700 (PDT)
In-Reply-To: <b9eaab43-647f-4e34-83f6-0921611d9a3dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=172.117.189.106; posting-account=a7bcHgoAAADQ0akqIyRQmxfQdEEZtAt5
NNTP-Posting-Host: 172.117.189.106
References: <b9eaab43-647f-4e34-83f6-0921611d9a3dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7708e9bd-81f3-4b13-aada-4f1c0f7ffb53n@googlegroups.com>
Subject: Re: MPV Video Player and Tk
From: sled99dog@gmail.com (The Rickster)
Injection-Date: Thu, 30 Jun 2022 17:43:02 +0000
Content-Type: text/plain; charset="UTF-8"
 by: The Rickster - Thu, 30 Jun 2022 17:43 UTC

On Monday, June 27, 2022 at 10:25:19 PM UTC-7, Westermeyer wrote:
> Hello All,
>
> I've got a question about the MPV video player and possible Tk bindings...
>
> From their page, there is a link to the language bindings:
> https://github.com/mpv-player/mpv/wiki/Language-bindings
>
> Would it be possible to implement a player in Tcl/Tk?
>
> Thanks
A snit player is documented in the WIKI. It uses mplayer. sample code follows employing version from www.mplayerhq.hu

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]
}
}]

Re: MPV Video Player and Tk

<f688b4ae-fef0-4106-ad4f-99fe8dfda163n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19614&group=comp.lang.tcl#19614

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:6000:1546:b0:21b:b8f4:6dad with SMTP id 6-20020a056000154600b0021bb8f46dadmr13347332wry.267.1656681467500;
Fri, 01 Jul 2022 06:17:47 -0700 (PDT)
X-Received: by 2002:a05:6830:18a:b0:616:905f:98d2 with SMTP id
q10-20020a056830018a00b00616905f98d2mr6642873ota.358.1656681467111; Fri, 01
Jul 2022 06:17:47 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.128.88.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Fri, 1 Jul 2022 06:17:46 -0700 (PDT)
In-Reply-To: <7708e9bd-81f3-4b13-aada-4f1c0f7ffb53n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:8801:c918:aa00:18b6:f490:b956:997a;
posting-account=WI8jHwoAAAD5efFArnqHarz-JcS9Naxl
NNTP-Posting-Host: 2600:8801:c918:aa00:18b6:f490:b956:997a
References: <b9eaab43-647f-4e34-83f6-0921611d9a3dn@googlegroups.com> <7708e9bd-81f3-4b13-aada-4f1c0f7ffb53n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f688b4ae-fef0-4106-ad4f-99fe8dfda163n@googlegroups.com>
Subject: Re: MPV Video Player and Tk
From: stephen.scherer.21337@gmail.com (Westermeyer)
Injection-Date: Fri, 01 Jul 2022 13:17:47 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Westermeyer - Fri, 1 Jul 2022 13:17 UTC

On Thursday, June 30, 2022 at 10:43:05 AM UTC-7, sled...@gmail.com wrote:
> On Monday, June 27, 2022 at 10:25:19 PM UTC-7, Westermeyer wrote:
> > Hello All,
> >
> > I've got a question about the MPV video player and possible Tk bindings...
> >
> > From their page, there is a link to the language bindings:
> > https://github.com/mpv-player/mpv/wiki/Language-bindings
> >
> > Would it be possible to implement a player in Tcl/Tk?
> >
> > Thanks
> A snit player is documented in the WIKI. It uses mplayer. sample code follows employing version from www.mplayerhq.hu
>
> 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]
> }
> }]

This is great - thanks for the leads!

Re: MPV Video Player and Tk

<t9nr4g$oi4$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19615&group=comp.lang.tcl#19615

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!YN2ulY6LKp1eoOUw2OJ8ig.user.46.165.242.91.POSTED!not-for-mail
From: tclnews@rocketship1.me (et4)
Newsgroups: comp.lang.tcl
Subject: Re: MPV Video Player and Tk
Date: Fri, 1 Jul 2022 15:06:08 -0700
Organization: Aioe.org NNTP Server
Message-ID: <t9nr4g$oi4$1@gioia.aioe.org>
References: <b9eaab43-647f-4e34-83f6-0921611d9a3dn@googlegroups.com>
<7708e9bd-81f3-4b13-aada-4f1c0f7ffb53n@googlegroups.com>
<f688b4ae-fef0-4106-ad4f-99fe8dfda163n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="25156"; posting-host="YN2ulY6LKp1eoOUw2OJ8ig.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: et4 - Fri, 1 Jul 2022 22:06 UTC

If you don't mind running an external program to handle the video, I
would recommend the VLC media player. I've written a remote controller
in tcl/tk for it that runs on windows but I'm sure you could also use
linux. Many of the functions you might want to use are available through
their http interface.

Being an http interface, one could even direct it from another machine.

I use a portable version, and the documentation for how to control it is
found in the readme here:

C:\PortableApps\VLCPortable\App\vlc\lua\http\requests\readme.txt

I wrote mine long ago, and I forget some details. You would have to
enable the http interface and I think you need to set a password too.

If you're interested, I can post a bit of the code I use to send http
requests to VLC.

Re: MPV Video Player and Tk

<d3ffe26f-47de-4fda-9270-d4f2a4d5e543n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19616&group=comp.lang.tcl#19616

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:ad4:45b0:0:b0:470:463c:beb4 with SMTP id y16-20020ad445b0000000b00470463cbeb4mr19051327qvu.57.1656738312928;
Fri, 01 Jul 2022 22:05:12 -0700 (PDT)
X-Received: by 2002:aca:a9cc:0:b0:337:9b08:9bae with SMTP id
s195-20020acaa9cc000000b003379b089baemr2951922oie.287.1656738312644; Fri, 01
Jul 2022 22:05:12 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Fri, 1 Jul 2022 22:05:12 -0700 (PDT)
In-Reply-To: <t9nr4g$oi4$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:8801:c918:aa00:681d:f554:5e76:1a16;
posting-account=WI8jHwoAAAD5efFArnqHarz-JcS9Naxl
NNTP-Posting-Host: 2600:8801:c918:aa00:681d:f554:5e76:1a16
References: <b9eaab43-647f-4e34-83f6-0921611d9a3dn@googlegroups.com>
<7708e9bd-81f3-4b13-aada-4f1c0f7ffb53n@googlegroups.com> <f688b4ae-fef0-4106-ad4f-99fe8dfda163n@googlegroups.com>
<t9nr4g$oi4$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d3ffe26f-47de-4fda-9270-d4f2a4d5e543n@googlegroups.com>
Subject: Re: MPV Video Player and Tk
From: stephen.scherer.21337@gmail.com (Westermeyer)
Injection-Date: Sat, 02 Jul 2022 05:05:12 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 20
 by: Westermeyer - Sat, 2 Jul 2022 05:05 UTC

On Friday, July 1, 2022 at 3:06:13 PM UTC-7, et4 wrote:
> If you don't mind running an external program to handle the video, I
> would recommend the VLC media player. I've written a remote controller
> in tcl/tk for it that runs on windows but I'm sure you could also use
> linux. Many of the functions you might want to use are available through
> their http interface.
>
> Being an http interface, one could even direct it from another machine.
>
> I use a portable version, and the documentation for how to control it is
> found in the readme here:
>
> C:\PortableApps\VLCPortable\App\vlc\lua\http\requests\readme.txt
>
> I wrote mine long ago, and I forget some details. You would have to
> enable the http interface and I think you need to set a password too.
>
> If you're interested, I can post a bit of the code I use to send http
> requests to VLC.

That''s a pretty interesting approach, using the portable version might mean a cross-platform solution - I'd be interested to see your code...

Re: MPV Video Player and Tk

<c03475f2-80c3-4f19-b38b-0ffc7bc8ae8fn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19617&group=comp.lang.tcl#19617

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:ac8:5fc8:0:b0:31b:f4c3:c45e with SMTP id k8-20020ac85fc8000000b0031bf4c3c45emr15985136qta.684.1656747828740;
Sat, 02 Jul 2022 00:43:48 -0700 (PDT)
X-Received: by 2002:a05:6830:240b:b0:616:bdc1:2701 with SMTP id
j11-20020a056830240b00b00616bdc12701mr8890289ots.46.1656747828208; Sat, 02
Jul 2022 00:43:48 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Sat, 2 Jul 2022 00:43:48 -0700 (PDT)
In-Reply-To: <d3ffe26f-47de-4fda-9270-d4f2a4d5e543n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=87.123.205.75; posting-account=glPZ8goAAADztwA3kVEZPMKXCGydx5DU
NNTP-Posting-Host: 87.123.205.75
References: <b9eaab43-647f-4e34-83f6-0921611d9a3dn@googlegroups.com>
<7708e9bd-81f3-4b13-aada-4f1c0f7ffb53n@googlegroups.com> <f688b4ae-fef0-4106-ad4f-99fe8dfda163n@googlegroups.com>
<t9nr4g$oi4$1@gioia.aioe.org> <d3ffe26f-47de-4fda-9270-d4f2a4d5e543n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c03475f2-80c3-4f19-b38b-0ffc7bc8ae8fn@googlegroups.com>
Subject: Re: MPV Video Player and Tk
From: alexandru.dadalau@meshparts.de (Alexandru)
Injection-Date: Sat, 02 Jul 2022 07:43:48 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 23
 by: Alexandru - Sat, 2 Jul 2022 07:43 UTC

Westermeyer schrieb am Samstag, 2. Juli 2022 um 07:05:15 UTC+2:
> On Friday, July 1, 2022 at 3:06:13 PM UTC-7, et4 wrote:
> > If you don't mind running an external program to handle the video, I
> > would recommend the VLC media player. I've written a remote controller
> > in tcl/tk for it that runs on windows but I'm sure you could also use
> > linux. Many of the functions you might want to use are available through
> > their http interface.
> >
> > Being an http interface, one could even direct it from another machine.
> >
> > I use a portable version, and the documentation for how to control it is
> > found in the readme here:
> >
> > C:\PortableApps\VLCPortable\App\vlc\lua\http\requests\readme.txt
> >
> > I wrote mine long ago, and I forget some details. You would have to
> > enable the http interface and I think you need to set a password too.
> >
> > If you're interested, I can post a bit of the code I use to send http
> > requests to VLC.
> That''s a pretty interesting approach, using the portable version might mean a cross-platform solution - I'd be interested to see your code...

Setting up VLC to accept http requests is rather complicated: Activate http, restart VLC, setup a password...
As a personal solution no problem. As part of a public software, no go.

Re: MPV Video Player and Tk

<a8595086-ebac-42ea-a158-63ca469d7708n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19618&group=comp.lang.tcl#19618

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:620a:25c9:b0:6b2:7409:892e with SMTP id y9-20020a05620a25c900b006b27409892emr463594qko.367.1656748147260;
Sat, 02 Jul 2022 00:49:07 -0700 (PDT)
X-Received: by 2002:a05:6808:199b:b0:335:65c9:6d60 with SMTP id
bj27-20020a056808199b00b0033565c96d60mr10544830oib.194.1656748146973; Sat, 02
Jul 2022 00:49:06 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Sat, 2 Jul 2022 00:49:06 -0700 (PDT)
In-Reply-To: <c03475f2-80c3-4f19-b38b-0ffc7bc8ae8fn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=87.123.205.75; posting-account=glPZ8goAAADztwA3kVEZPMKXCGydx5DU
NNTP-Posting-Host: 87.123.205.75
References: <b9eaab43-647f-4e34-83f6-0921611d9a3dn@googlegroups.com>
<7708e9bd-81f3-4b13-aada-4f1c0f7ffb53n@googlegroups.com> <f688b4ae-fef0-4106-ad4f-99fe8dfda163n@googlegroups.com>
<t9nr4g$oi4$1@gioia.aioe.org> <d3ffe26f-47de-4fda-9270-d4f2a4d5e543n@googlegroups.com>
<c03475f2-80c3-4f19-b38b-0ffc7bc8ae8fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a8595086-ebac-42ea-a158-63ca469d7708n@googlegroups.com>
Subject: Re: MPV Video Player and Tk
From: alexandru.dadalau@meshparts.de (Alexandru)
Injection-Date: Sat, 02 Jul 2022 07:49:07 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 24
X-Received-Bytes: 2985
 by: Alexandru - Sat, 2 Jul 2022 07:49 UTC

Alexandru schrieb am Samstag, 2. Juli 2022 um 09:43:50 UTC+2:
> Westermeyer schrieb am Samstag, 2. Juli 2022 um 07:05:15 UTC+2:
> > On Friday, July 1, 2022 at 3:06:13 PM UTC-7, et4 wrote:
> > > If you don't mind running an external program to handle the video, I
> > > would recommend the VLC media player. I've written a remote controller
> > > in tcl/tk for it that runs on windows but I'm sure you could also use
> > > linux. Many of the functions you might want to use are available through
> > > their http interface.
> > >
> > > Being an http interface, one could even direct it from another machine.
> > >
> > > I use a portable version, and the documentation for how to control it is
> > > found in the readme here:
> > >
> > > C:\PortableApps\VLCPortable\App\vlc\lua\http\requests\readme.txt
> > >
> > > I wrote mine long ago, and I forget some details. You would have to
> > > enable the http interface and I think you need to set a password too.
> > >
> > > If you're interested, I can post a bit of the code I use to send http
> > > requests to VLC.
> > That''s a pretty interesting approach, using the portable version might mean a cross-platform solution - I'd be interested to see your code...
> Setting up VLC to accept http requests is rather complicated: Activate http, restart VLC, setup a password...
> As a personal solution no problem. As part of a public software, no go.
Tcl really lacks a ready to use solution for playing movies in an embeded way.

Re: MPV Video Player and Tk

<t9p01s$2inrk$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19619&group=comp.lang.tcl#19619

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: auriocus@gmx.de (Christian Gollwitzer)
Newsgroups: comp.lang.tcl
Subject: Re: MPV Video Player and Tk
Date: Sat, 2 Jul 2022 10:36:11 +0200
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <t9p01s$2inrk$1@dont-email.me>
References: <b9eaab43-647f-4e34-83f6-0921611d9a3dn@googlegroups.com>
<7708e9bd-81f3-4b13-aada-4f1c0f7ffb53n@googlegroups.com>
<f688b4ae-fef0-4106-ad4f-99fe8dfda163n@googlegroups.com>
<t9nr4g$oi4$1@gioia.aioe.org>
<d3ffe26f-47de-4fda-9270-d4f2a4d5e543n@googlegroups.com>
<c03475f2-80c3-4f19-b38b-0ffc7bc8ae8fn@googlegroups.com>
<a8595086-ebac-42ea-a158-63ca469d7708n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 2 Jul 2022 08:36:12 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="92077abdf76ceb1589101e2c895b5508";
logging-data="2711412"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18k8vx/wfzoyJ314ymHFgSlQKSHkNoTkt8="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:91.0)
Gecko/20100101 Thunderbird/91.11.0
Cancel-Lock: sha1:Rn9d7AkAYMUQRbeTUoHHuBaI4CQ=
In-Reply-To: <a8595086-ebac-42ea-a158-63ca469d7708n@googlegroups.com>
 by: Christian Gollwitzer - Sat, 2 Jul 2022 08:36 UTC

Am 02.07.22 um 09:49 schrieb Alexandru:
> Alexandru schrieb am Samstag, 2. Juli 2022 um 09:43:50 UTC+2:
>> Setting up VLC to accept http requests is rather complicated: Activate http, restart VLC, setup a password...
>> As a personal solution no problem. As part of a public software, no go.
> Tcl really lacks a ready to use solution for playing movies in an embeded way.

The reason is that "playing videos" is a huge and complicated topic. The
easiest way to implement this in a cross-platform way would probably be
ffmpeg. In addition to the technical issues, however, there is an
enormous legal trap involved. Most video codecs are protected by
patents, and integrating ffmpeg into some software to play a video
strictly violates patents and licenses.

The other solution would be to interface the OSes native video solution,
which would be possible for Windows and macOS (there is no such thing
for Linux), and Android. This again means you need to design an
interface that works for all platforms etc. and lots of work to test this.

Christian

Re: MPV Video Player and Tk

<t9p390$1l0m$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19620&group=comp.lang.tcl#19620

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!.POSTED.75.83.228.217!not-for-mail
From: tclnews@rocketship1.me (et4)
Newsgroups: comp.lang.tcl
Subject: Re: MPV Video Player and Tk
Date: Sat, 2 Jul 2022 02:31:11 -0700
Organization: Aioe.org NNTP Server
Message-ID: <t9p390$1l0m$1@gioia.aioe.org>
References: <b9eaab43-647f-4e34-83f6-0921611d9a3dn@googlegroups.com>
<7708e9bd-81f3-4b13-aada-4f1c0f7ffb53n@googlegroups.com>
<f688b4ae-fef0-4106-ad4f-99fe8dfda163n@googlegroups.com>
<t9nr4g$oi4$1@gioia.aioe.org>
<d3ffe26f-47de-4fda-9270-d4f2a4d5e543n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 2 Jul 2022 09:31:12 -0000 (UTC)
Injection-Info: gioia.aioe.org; posting-host="75.83.228.217";
logging-data="54294"; mail-complaints-to="abuse@aioe.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
Content-Language: en-US
In-Reply-To: <d3ffe26f-47de-4fda-9270-d4f2a4d5e543n@googlegroups.com>
Cache: 46.165.242.91 1656754272 999 75.83.228.217 75.83.228.217 3520 999 zsBHjbhM6dXoeyYnbixunQ 75.83.228 1 0
 by: et4 - Sat, 2 Jul 2022 09:31 UTC

On 7/1/2022 10:05 PM, Westermeyer wrote:
> On Friday, July 1, 2022 at 3:06:13 PM UTC-7, et4 wrote:
>> If you don't mind running an external program to handle the video, I
>> would recommend the VLC media player. I've written a remote controller
>> in tcl/tk for it that runs on windows but I'm sure you could also use
>> linux. Many of the functions you might want to use are available through
>> their http interface.
>>
>> Being an http interface, one could even direct it from another machine.
>>
>> I use a portable version, and the documentation for how to control it is
>> found in the readme here:
>>
>> C:\PortableApps\VLCPortable\App\vlc\lua\http\requests\readme.txt
>>
>> I wrote mine long ago, and I forget some details. You would have to
>> enable the http interface and I think you need to set a password too.
>>
>> If you're interested, I can post a bit of the code I use to send http
>> requests to VLC.
>
> That''s a pretty interesting approach, using the portable version might mean a cross-platform solution - I'd be interested to see your code...

Christian and Alexandru have excellent points.

Being retired, I write boss-free dangerous code for my own personal pleasure. With that caveat clearly understood:

Here's a tk example. The comments show how to get the VLC settings right. If you startup a single VLC with some video, the script has 3 buttons to skip and pause. It uses localhost ip and default port built in is 8080.

VLC portable (on windows, I don't use on linux) is self contained in it's own directory tree. The config is there, not in some windows directory. That's how it's portable. (I get the win vlc portable from portableapps.com)

I only run vlc on a fire-walled lan, and so I don't worry about hard-coding in the password, since it's not very secure anyway. Change it below in the argument {password xyz}. Leave username blank.

# vlc example http
# console show
# see this to set config https://wiki.videolan.org/Documentation:Modules/http_intf/
# for pref's all prefs -> main interfaces -> turn on Web, and enter http as shown

# Also, under main interfaces -> Lua, under lua http enter a password, example: xyz
# The username needs to be sent in, but must be blank
# package require http
package require base64 ;#There's a built-in command now to do this, this code is old

set playerhost 127.0.0.1
set port 8080 ;# vlc default

button .b1 -text "\u2190 3s" -command {skip -1 3} -font {TkDefaultFont 24}
button .b2 -text "\u23f8/\u25b6" -command {pause} -font {TkDefaultFont 24}
button .b3 -text "3s \u2192" -command {skip 1 3} -font {TkDefaultFont 24}

pack .b1 .b2 .b3 -fill both -expand true -side left

proc http_geturl_auth {url {username {}} {password xyz}} { ;# blank user, and password xyz
set auth "Basic [base64::encode $username:$password]"
set headerl [list Authorization $auth]
set tok [http::geturl $url -headers $headerl -timeout 200]
set result [http::data $tok]
http::cleanup $tok
# puts "result= |$result| " ;# lots of player status returned here
return $result
} proc pause {} {
http_geturl_auth "http://$::playerhost:$::port/requests/status.xml?command=pl_pause" ;# toggle pause/play
}

proc skip {direction secs} {
if { $direction < 0 } {
http_geturl_auth "http://$::playerhost:$::port/requests/status.xml?command=seek&val=-${secs}s"
} else {
http_geturl_auth "http://$::playerhost:$::port/requests/status.xml?command=seek&val=%2B${secs}s"
}
}

Re: MPV Video Player and Tk

<7cfdc630-972a-4b25-988a-4bbc89e2970cn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19621&group=comp.lang.tcl#19621

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:622a:113:b0:31b:700c:6af1 with SMTP id u19-20020a05622a011300b0031b700c6af1mr17256721qtw.382.1656767876358;
Sat, 02 Jul 2022 06:17:56 -0700 (PDT)
X-Received: by 2002:a4a:dfac:0:b0:425:a379:43f4 with SMTP id
k12-20020a4adfac000000b00425a37943f4mr8210476ook.32.1656767876009; Sat, 02
Jul 2022 06:17:56 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Sat, 2 Jul 2022 06:17:55 -0700 (PDT)
In-Reply-To: <t9p390$1l0m$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:8801:c918:aa00:8877:aa16:de4b:262d;
posting-account=WI8jHwoAAAD5efFArnqHarz-JcS9Naxl
NNTP-Posting-Host: 2600:8801:c918:aa00:8877:aa16:de4b:262d
References: <b9eaab43-647f-4e34-83f6-0921611d9a3dn@googlegroups.com>
<7708e9bd-81f3-4b13-aada-4f1c0f7ffb53n@googlegroups.com> <f688b4ae-fef0-4106-ad4f-99fe8dfda163n@googlegroups.com>
<t9nr4g$oi4$1@gioia.aioe.org> <d3ffe26f-47de-4fda-9270-d4f2a4d5e543n@googlegroups.com>
<t9p390$1l0m$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7cfdc630-972a-4b25-988a-4bbc89e2970cn@googlegroups.com>
Subject: Re: MPV Video Player and Tk
From: stephen.scherer.21337@gmail.com (Westermeyer)
Injection-Date: Sat, 02 Jul 2022 13:17:56 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 6124
 by: Westermeyer - Sat, 2 Jul 2022 13:17 UTC

On Saturday, July 2, 2022 at 2:31:16 AM UTC-7, et4 wrote:
> On 7/1/2022 10:05 PM, Westermeyer wrote:
> > On Friday, July 1, 2022 at 3:06:13 PM UTC-7, et4 wrote:
> >> If you don't mind running an external program to handle the video, I
> >> would recommend the VLC media player. I've written a remote controller
> >> in tcl/tk for it that runs on windows but I'm sure you could also use
> >> linux. Many of the functions you might want to use are available through
> >> their http interface.
> >>
> >> Being an http interface, one could even direct it from another machine..
> >>
> >> I use a portable version, and the documentation for how to control it is
> >> found in the readme here:
> >>
> >> C:\PortableApps\VLCPortable\App\vlc\lua\http\requests\readme.txt
> >>
> >> I wrote mine long ago, and I forget some details. You would have to
> >> enable the http interface and I think you need to set a password too.
> >>
> >> If you're interested, I can post a bit of the code I use to send http
> >> requests to VLC.
> >
> > That''s a pretty interesting approach, using the portable version might mean a cross-platform solution - I'd be interested to see your code...
> Christian and Alexandru have excellent points.
>
> Being retired, I write boss-free dangerous code for my own personal pleasure. With that caveat clearly understood:
>
> Here's a tk example. The comments show how to get the VLC settings right. If you startup a single VLC with some video, the script has 3 buttons to skip and pause. It uses localhost ip and default port built in is 8080.
>
> VLC portable (on windows, I don't use on linux) is self contained in it's own directory tree. The config is there, not in some windows directory. That's how it's portable. (I get the win vlc portable from portableapps.com)
>
> I only run vlc on a fire-walled lan, and so I don't worry about hard-coding in the password, since it's not very secure anyway. Change it below in the argument {password xyz}. Leave username blank.
>
>
> # vlc example http
> # console show
> # see this to set config https://wiki.videolan.org/Documentation:Modules/http_intf/
> # for pref's all prefs -> main interfaces -> turn on Web, and enter http as shown
>
> # Also, under main interfaces -> Lua, under lua http enter a password, example: xyz
> # The username needs to be sent in, but must be blank
> #
> package require http
> package require base64 ;#There's a built-in command now to do this, this code is old
>
> set playerhost 127.0.0.1
> set port 8080 ;# vlc default
>
> button .b1 -text "\u2190 3s" -command {skip -1 3} -font {TkDefaultFont 24}
> button .b2 -text "\u23f8/\u25b6" -command {pause} -font {TkDefaultFont 24}
> button .b3 -text "3s \u2192" -command {skip 1 3} -font {TkDefaultFont 24}
>
> pack .b1 .b2 .b3 -fill both -expand true -side left
>
> proc http_geturl_auth {url {username {}} {password xyz}} { ;# blank user, and password xyz
> set auth "Basic [base64::encode $username:$password]"
> set headerl [list Authorization $auth]
> set tok [http::geturl $url -headers $headerl -timeout 200]
> set result [http::data $tok]
> http::cleanup $tok
> # puts "result= |$result| " ;# lots of player status returned here
> return $result
> }
> proc pause {} {
> http_geturl_auth "http://$::playerhost:$::port/requests/status.xml?command=pl_pause" ;# toggle pause/play
> }
>
> proc skip {direction secs} {
> if { $direction < 0 } {
> http_geturl_auth "http://$::playerhost:$::port/requests/status.xml?command=seek&val=-${secs}s"
> } else {
> http_geturl_auth "http://$::playerhost:$::port/requests/status.xml?command=seek&val=%2B${secs}s"
> }
> }

Thanks very much for the suggestions, they're more than I was anticipating. I'm looking for a solution that is cross-platform and part of an educational package, so widely available. I'm not trained as a computer scientist, so I find that Tcl/Tk a bit overwhelming, but it becomes a bit much when the solution looks to involve sophisticated C programming (the cffi package looks promising, and might be a solution, thanks Ashok!).
The closest that I've come to a solution is simply using the default movie player on the user's machine, and this is launched with either auto_execok (win), open (mac), or xdg-open (linux). While not elegant, it is strangely robust...

Re: MPV Video Player and Tk

<93d87d72-79e1-4c18-86ec-5be266f78404n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19622&group=comp.lang.tcl#19622

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:620a:1a12:b0:6af:228c:ef65 with SMTP id bk18-20020a05620a1a1200b006af228cef65mr14319931qkb.680.1656783611917;
Sat, 02 Jul 2022 10:40:11 -0700 (PDT)
X-Received: by 2002:a05:6808:1142:b0:335:ba14:ded4 with SMTP id
u2-20020a056808114200b00335ba14ded4mr10199869oiu.6.1656783611663; Sat, 02 Jul
2022 10:40:11 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Sat, 2 Jul 2022 10:40:11 -0700 (PDT)
In-Reply-To: <7cfdc630-972a-4b25-988a-4bbc89e2970cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:8801:c918:aa00:9c50:99e2:3fba:9283;
posting-account=WI8jHwoAAAD5efFArnqHarz-JcS9Naxl
NNTP-Posting-Host: 2600:8801:c918:aa00:9c50:99e2:3fba:9283
References: <b9eaab43-647f-4e34-83f6-0921611d9a3dn@googlegroups.com>
<7708e9bd-81f3-4b13-aada-4f1c0f7ffb53n@googlegroups.com> <f688b4ae-fef0-4106-ad4f-99fe8dfda163n@googlegroups.com>
<t9nr4g$oi4$1@gioia.aioe.org> <d3ffe26f-47de-4fda-9270-d4f2a4d5e543n@googlegroups.com>
<t9p390$1l0m$1@gioia.aioe.org> <7cfdc630-972a-4b25-988a-4bbc89e2970cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <93d87d72-79e1-4c18-86ec-5be266f78404n@googlegroups.com>
Subject: Re: MPV Video Player and Tk
From: stephen.scherer.21337@gmail.com (Westermeyer)
Injection-Date: Sat, 02 Jul 2022 17:40:11 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 7327
 by: Westermeyer - Sat, 2 Jul 2022 17:40 UTC

On Saturday, July 2, 2022 at 6:17:58 AM UTC-7, Westermeyer wrote:
> On Saturday, July 2, 2022 at 2:31:16 AM UTC-7, et4 wrote:
> > On 7/1/2022 10:05 PM, Westermeyer wrote:
> > > On Friday, July 1, 2022 at 3:06:13 PM UTC-7, et4 wrote:
> > >> If you don't mind running an external program to handle the video, I
> > >> would recommend the VLC media player. I've written a remote controller
> > >> in tcl/tk for it that runs on windows but I'm sure you could also use
> > >> linux. Many of the functions you might want to use are available through
> > >> their http interface.
> > >>
> > >> Being an http interface, one could even direct it from another machine.
> > >>
> > >> I use a portable version, and the documentation for how to control it is
> > >> found in the readme here:
> > >>
> > >> C:\PortableApps\VLCPortable\App\vlc\lua\http\requests\readme.txt
> > >>
> > >> I wrote mine long ago, and I forget some details. You would have to
> > >> enable the http interface and I think you need to set a password too..
> > >>
> > >> If you're interested, I can post a bit of the code I use to send http
> > >> requests to VLC.
> > >
> > > That''s a pretty interesting approach, using the portable version might mean a cross-platform solution - I'd be interested to see your code...
> > Christian and Alexandru have excellent points.
> >
> > Being retired, I write boss-free dangerous code for my own personal pleasure. With that caveat clearly understood:
> >
> > Here's a tk example. The comments show how to get the VLC settings right. If you startup a single VLC with some video, the script has 3 buttons to skip and pause. It uses localhost ip and default port built in is 8080.
> >
> > VLC portable (on windows, I don't use on linux) is self contained in it's own directory tree. The config is there, not in some windows directory. That's how it's portable. (I get the win vlc portable from portableapps.com)
> >
> > I only run vlc on a fire-walled lan, and so I don't worry about hard-coding in the password, since it's not very secure anyway. Change it below in the argument {password xyz}. Leave username blank.
> >
> >
> > # vlc example http
> > # console show
> > # see this to set config https://wiki.videolan.org/Documentation:Modules/http_intf/
> > # for pref's all prefs -> main interfaces -> turn on Web, and enter http as shown
> >
> > # Also, under main interfaces -> Lua, under lua http enter a password, example: xyz
> > # The username needs to be sent in, but must be blank
> > #
> > package require http
> > package require base64 ;#There's a built-in command now to do this, this code is old
> >
> > set playerhost 127.0.0.1
> > set port 8080 ;# vlc default
> >
> > button .b1 -text "\u2190 3s" -command {skip -1 3} -font {TkDefaultFont 24}
> > button .b2 -text "\u23f8/\u25b6" -command {pause} -font {TkDefaultFont 24}
> > button .b3 -text "3s \u2192" -command {skip 1 3} -font {TkDefaultFont 24}
> >
> > pack .b1 .b2 .b3 -fill both -expand true -side left
> >
> > proc http_geturl_auth {url {username {}} {password xyz}} { ;# blank user, and password xyz
> > set auth "Basic [base64::encode $username:$password]"
> > set headerl [list Authorization $auth]
> > set tok [http::geturl $url -headers $headerl -timeout 200]
> > set result [http::data $tok]
> > http::cleanup $tok
> > # puts "result= |$result| " ;# lots of player status returned here
> > return $result
> > }
> > proc pause {} {
> > http_geturl_auth "http://$::playerhost:$::port/requests/status.xml?command=pl_pause" ;# toggle pause/play
> > }
> >
> > proc skip {direction secs} {
> > if { $direction < 0 } {
> > http_geturl_auth "http://$::playerhost:$::port/requests/status.xml?command=seek&val=-${secs}s"
> > } else {
> > http_geturl_auth "http://$::playerhost:$::port/requests/status.xml?command=seek&val=%2B${secs}s"
> > }
> > }
> Thanks very much for the suggestions, they're more than I was anticipating. I'm looking for a solution that is cross-platform and part of an educational package, so widely available. I'm not trained as a computer scientist, so I find that Tcl/Tk a bit overwhelming, but it becomes a bit much when the solution looks to involve sophisticated C programming (the cffi package looks promising, and might be a solution, thanks Ashok!).
> The closest that I've come to a solution is simply using the default movie player on the user's machine, and this is launched with either auto_execok (win), open (mac), or xdg-open (linux). While not elegant, it is strangely robust...

#!/bin/sh
# -*- tcl -*-
# The next line is executed by /bin/sh, but not tcl \
exec tclsh "$0" ${1+"$@"}

package require Tk

button .b -text "Launch Video" -command playMovie
button .c -text "Exit" -command exit

proc playMovie {} {

global tcl_platform

if {$tcl_platform(platform) eq "windows"} {

set filename "C:\\Users\\ssche\\Dropbox\\Videos\\Mp4\\test.mp4"
set command [list {*}[auto_execok start] {}]

} elseif {$tcl_platform(os) eq "Darwin"} {

set filename "/Users/stephenscherer/Dropbox/Videos/Mp4/test.mp4"
set command [list open]

} else {

set filename "/home/stephen/Dropbox/Videos/Ogg/test.ogg"
set command [list xdg-open]

}

exec {*}$command $filename &

}

pack .b
pack .c

Re: MPV Video Player and Tk

<t9q09c$1bue$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19623&group=comp.lang.tcl#19623

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!YN2ulY6LKp1eoOUw2OJ8ig.user.46.165.242.91.POSTED!not-for-mail
From: tclnews@rocketship1.me (et4)
Newsgroups: comp.lang.tcl
Subject: Re: MPV Video Player and Tk
Date: Sat, 2 Jul 2022 10:46:19 -0700
Organization: Aioe.org NNTP Server
Message-ID: <t9q09c$1bue$1@gioia.aioe.org>
References: <b9eaab43-647f-4e34-83f6-0921611d9a3dn@googlegroups.com>
<7708e9bd-81f3-4b13-aada-4f1c0f7ffb53n@googlegroups.com>
<f688b4ae-fef0-4106-ad4f-99fe8dfda163n@googlegroups.com>
<t9nr4g$oi4$1@gioia.aioe.org>
<d3ffe26f-47de-4fda-9270-d4f2a4d5e543n@googlegroups.com>
<t9p390$1l0m$1@gioia.aioe.org>
<7cfdc630-972a-4b25-988a-4bbc89e2970cn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="45006"; posting-host="YN2ulY6LKp1eoOUw2OJ8ig.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: et4 - Sat, 2 Jul 2022 17:46 UTC

On 7/2/2022 6:17 AM, Westermeyer wrote:

> The closest that I've come to a solution is simply using the default movie player on the user's machine, and this is launched with either auto_execok (win), open (mac), or xdg-open (linux). While not elegant, it is strangely robust...

Seems like an acceptable solution to me :)

I mentioned VLC because it seems to be the most capable free-ware video player. And with the http interface, I've tinkered together a use for my old android phones, a vlc remote using androwish.

Since you're already launching a player by commandline, you could probably avoid all the config stuff using command line options for the interface and port number. And who knows, maybe some of your users are like me and have VLC as their default video player anyway.

Re: MPV Video Player and Tk

<680d1451-54ac-4b04-a3f8-eb23cda22057n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19625&group=comp.lang.tcl#19625

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:ac8:7d52:0:b0:31d:2828:f with SMTP id h18-20020ac87d52000000b0031d2828000fmr28351352qtb.391.1657040337538;
Tue, 05 Jul 2022 09:58:57 -0700 (PDT)
X-Received: by 2002:a05:6870:2dc9:b0:108:a476:f2a0 with SMTP id
op9-20020a0568702dc900b00108a476f2a0mr22005493oab.255.1657040335639; Tue, 05
Jul 2022 09:58:55 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Tue, 5 Jul 2022 09:58:55 -0700 (PDT)
In-Reply-To: <b9eaab43-647f-4e34-83f6-0921611d9a3dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=172.117.189.106; posting-account=a7bcHgoAAADQ0akqIyRQmxfQdEEZtAt5
NNTP-Posting-Host: 172.117.189.106
References: <b9eaab43-647f-4e34-83f6-0921611d9a3dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <680d1451-54ac-4b04-a3f8-eb23cda22057n@googlegroups.com>
Subject: Re: MPV Video Player and Tk
From: sled99dog@gmail.com (The Rickster)
Injection-Date: Tue, 05 Jul 2022 16:58:57 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 17
 by: The Rickster - Tue, 5 Jul 2022 16:58 UTC

On Monday, June 27, 2022 at 10:25:19 PM UTC-7, Westermeyer wrote:
> Hello All,
>
> I've got a question about the MPV video player and possible Tk bindings....
>
> From their page, there is a link to the language bindings:
> https://github.com/mpv-player/mpv/wiki/Language-bindings
>
> Would it be possible to implement a player in Tcl/Tk?
>
> Thanks
the educational solution you seem to be seeking is an all tcl\tk training solution which can be seen at www.verbaltransacrions.com. It leverages the simulation training package developed by Advertech, Ltd. It provides for the needs you have described including a video widget, embeddable StroyLine, and browser. Additionally, an of particular relevance, it has been in trial at Microsoft, globally.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor