all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* A way to watch (some) videos about Emacs with wget and mpv
@ 2022-12-27 11:55 Eduardo Ochs
  2022-12-27 12:00 ` Philip Kaludercic
  0 siblings, 1 reply; 13+ messages in thread
From: Eduardo Ochs @ 2022-12-27 11:55 UTC (permalink / raw)
  To: help-gnu-emacs

Hi list,

there are many videos about Emacs on Youtube, and this

  rm -Rfv /tmp/emacs-news/
  cd      /tmp/
  git clone https://github.com/sachac/emacs-news
  cd      /tmp/emacs-news/

  # (find-file "/tmp/emacs-news/index.org")

lists most of them... or let's suppose that it does. Also, let me
suppose that many of the authors of these videos read help-gnu-emacs,
and that posting here is a good way to reach them.

I'm the author on a package that is official enough to be in ELPA -
"eev" - but that makes sense to very few people. I've tried to record
some videos to make it more understandable, but it turned out that the
people who may be interested in eev also usually the people who hate
videos - like me =(... - so I've been experimenting with ways to make
my videos more friendly to people who hate videos...

To be more precise: for me watching 30 seconds of a video is fine, but
having to watch a video that is one hour long is not. And I hate
having to wait for almost one minute while Youtube loads the
recommendations, and plays an ad, before playing the video that I
requested. Downloading a video with youtube-dl or yt-dlp also takes a
long time, so what I usually end doing is that I use one of the many
packages that show the transcript of a video, and I speed-read the
transcript instead of watching the video.

Anyway, I think that I reached something that is worth sharing.

Some of the pages in my website are about videos that I've recorded
and subtitled. In each of them I've put something like this:

  You can watch this video on youtube [here], but youtube always
  converts my videos to a format that is blurry at some points. The
  best way to watch this video is to run the two [wget]s and the [mpv]
  in the beige block below to download the video and its subtitles and
  then play it with mpv; to make mpv play it in high speed, use the
  keys listed [here].

    # See:  http://angg.twu.net/eev-videos.html
    #       http://angg.twu.net/eev-videos.html#mpv-keys
    # Play: (find-eev2019video "0:00")
    # Info: (find-1stclassvideo-links "eev2019")

    wget -nc http://angg.twu.net/eev-videos/emacsconf2019.mp4
    wget -N  http://angg.twu.net/eev-videos/emacsconf2019.vtt
    mpv --fs --osd-level=2 emacsconf2019.mp4

So: most people will skip the comments, will paste the "wget"s and the
"mpv" into a shell, and ta-da, the video plays. Some people will
recognize that the .vtt is a subtitle file and will click on it to
read the subtitles without the video. A few people - very few - will
follow the other links.

Long story short: 1) use two "wget"s and an "mpv"; 2) this is my
20th-ish attempt to find a way to point to wget-able videos, and the
first one that I really like - and that would be easy to adapt to
other people and to videos totally unrelated to eev; 3) I don't know
if this would work well for the EmacsConf,

  https://emacsconf.org/2022/

because the URLs for its videos are too long...

Here is an example in which the instructions and the beige rectangle
appears very close to the top of the page:

  http://angg.twu.net/2020-some-template-based.html

I hope that other people will find this idea inspiring.
Apologies for mentioning eev so many times, and cheers, =)

  Eduardo Ochs
  http://angg.twu.net/eepitch.html
  http://angg.twu.net/eev-videos.html



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: A way to watch (some) videos about Emacs with wget and mpv
  2022-12-27 11:55 A way to watch (some) videos about Emacs with wget and mpv Eduardo Ochs
@ 2022-12-27 12:00 ` Philip Kaludercic
  2022-12-27 12:08   ` Eduardo Ochs
  0 siblings, 1 reply; 13+ messages in thread
From: Philip Kaludercic @ 2022-12-27 12:00 UTC (permalink / raw)
  To: Eduardo Ochs; +Cc: help-gnu-emacs

Eduardo Ochs <eduardoochs@gmail.com> writes:

> Long story short: 1) use two "wget"s and an "mpv"; 2) this is my
> 20th-ish attempt to find a way to point to wget-able videos, and the
> first one that I really like - and that would be easy to adapt to
> other people and to videos totally unrelated to eev; 3) I don't know
> if this would work well for the EmacsConf,

Maybe I am missing something, but why not use youtube-dl/ytp-dl and just
pass the URL directly to mpv?



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: A way to watch (some) videos about Emacs with wget and mpv
  2022-12-27 12:00 ` Philip Kaludercic
@ 2022-12-27 12:08   ` Eduardo Ochs
  2022-12-27 12:13     ` Emanuel Berg
  2022-12-27 12:44     ` Philip Kaludercic
  0 siblings, 2 replies; 13+ messages in thread
From: Eduardo Ochs @ 2022-12-27 12:08 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: help-gnu-emacs

On Tue, 27 Dec 2022 at 09:00, Philip Kaludercic <philipk@posteo.net> wrote:
>
> Eduardo Ochs <eduardoochs@gmail.com> writes:
>
> > Long story short: 1) use two "wget"s and an "mpv"; 2) this is my
> > 20th-ish attempt to find a way to point to wget-able videos, and the
> > first one that I really like - and that would be easy to adapt to
> > other people and to videos totally unrelated to eev; 3) I don't know
> > if this would work well for the EmacsConf,
>
> Maybe I am missing something, but why not use youtube-dl/ytp-dl and just
> pass the URL directly to mpv?

Can you send an example of your idea as a series of commands that can
be executed in a shell? I _think_ that I have good arguments in
favor of the method with wget, but I need to check which command line
arguments you're thinking of...

  Cheers, E.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: A way to watch (some) videos about Emacs with wget and mpv
  2022-12-27 12:08   ` Eduardo Ochs
@ 2022-12-27 12:13     ` Emanuel Berg
  2022-12-28  1:56       ` Eduardo Ochs
  2022-12-27 12:44     ` Philip Kaludercic
  1 sibling, 1 reply; 13+ messages in thread
From: Emanuel Berg @ 2022-12-27 12:13 UTC (permalink / raw)
  To: help-gnu-emacs

Eduardo Ochs wrote:

>>> Long story short: 1) use two "wget"s and an "mpv"; 2) this is my
>>> 20th-ish attempt to find a way to point to wget-able videos, and
>>> the first one that I really like - and that would be easy to
>>> adapt to other people and to videos totally unrelated to eev; 3)
>>> I don't know if this would work well for the EmacsConf,
>>
>> Maybe I am missing something, but why not use youtube-dl/ytp-dl
>> and just pass the URL directly to mpv?
>
> Can you send an example of your idea as a series of commands that
> can be executed in a shell? I _think_ that I have good arguments
> in favor of the method with wget, but I need to check which
> command line arguments you're thinking of...

$ mpv URL

https://dataswamp.org/~incal/#mpv

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: A way to watch (some) videos about Emacs with wget and mpv
  2022-12-27 12:08   ` Eduardo Ochs
  2022-12-27 12:13     ` Emanuel Berg
@ 2022-12-27 12:44     ` Philip Kaludercic
  2022-12-27 14:13       ` Emanuel Berg
  2022-12-28  0:43       ` Eduardo Ochs
  1 sibling, 2 replies; 13+ messages in thread
From: Philip Kaludercic @ 2022-12-27 12:44 UTC (permalink / raw)
  To: Eduardo Ochs; +Cc: help-gnu-emacs

Eduardo Ochs <eduardoochs@gmail.com> writes:

> On Tue, 27 Dec 2022 at 09:00, Philip Kaludercic <philipk@posteo.net> wrote:
>>
>> Eduardo Ochs <eduardoochs@gmail.com> writes:
>>
>> > Long story short: 1) use two "wget"s and an "mpv"; 2) this is my
>> > 20th-ish attempt to find a way to point to wget-able videos, and the
>> > first one that I really like - and that would be easy to adapt to
>> > other people and to videos totally unrelated to eev; 3) I don't know
>> > if this would work well for the EmacsConf,
>>
>> Maybe I am missing something, but why not use youtube-dl/ytp-dl and just
>> pass the URL directly to mpv?
>
> Can you send an example of your idea as a series of commands that can
> be executed in a shell? I _think_ that I have good arguments in
> favor of the method with wget, but I need to check which command line
> arguments you're thinking of...

All you need is "mpv https://some.host/path/to/video.file" or "mpv
https://a.service/that/doesnt/host/video/files.directly", assuming you
have youtube-dl installed.

>   Cheers, E.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: A way to watch (some) videos about Emacs with wget and mpv
  2022-12-27 12:44     ` Philip Kaludercic
@ 2022-12-27 14:13       ` Emanuel Berg
  2022-12-28  0:43       ` Eduardo Ochs
  1 sibling, 0 replies; 13+ messages in thread
From: Emanuel Berg @ 2022-12-27 14:13 UTC (permalink / raw)
  To: help-gnu-emacs

Philip Kaludercic wrote:

> All you need is "mpv https://some.host/path/to/video.file" or "mpv
> https://a.service/that/doesnt/host/video/files.directly", assuming
> you have youtube-dl installed.

Some say yt-dlp is better ...

#! /bin/zsh
#
# this file:
#   https://dataswamp.org/~incal/conf/.zsh/yt-dlp

dl-upgrade-3 () {
    yt-dlp -U
    yt-dlp --version
}

dl-upgrade-2 () {
    local gz=https://github.com/yt-dlp/yt-dlp/archive/master.tar.gz
    python3 -m pip install --force-reinstall $gz
    yt-dlp --version
}

dl-upgrade () {
    local url=https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp
    local bin=/usr/local/bin/yt-dlp
    sudo curl -L $url -o $bin
    sudo chmod a+rx $bin
    yt-dlp --version
}

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: A way to watch (some) videos about Emacs with wget and mpv
  2022-12-27 12:44     ` Philip Kaludercic
  2022-12-27 14:13       ` Emanuel Berg
@ 2022-12-28  0:43       ` Eduardo Ochs
  2022-12-28  1:03         ` Emanuel Berg
  2022-12-28  5:46         ` Yuri Khan
  1 sibling, 2 replies; 13+ messages in thread
From: Eduardo Ochs @ 2022-12-28  0:43 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: help-gnu-emacs

On Tue, 27 Dec 2022 at 09:44, Philip Kaludercic <philipk@posteo.net> wrote:
>
> Eduardo Ochs <eduardoochs@gmail.com> writes:
>
> > On Tue, 27 Dec 2022 at 09:00, Philip Kaludercic <philipk@posteo.net> wrote:
> >>
> >> Eduardo Ochs <eduardoochs@gmail.com> writes:
> >>
> >> > Long story short: 1) use two "wget"s and an "mpv"; 2) this is my
> >> > 20th-ish attempt to find a way to point to wget-able videos, and the
> >> > first one that I really like - and that would be easy to adapt to
> >> > other people and to videos totally unrelated to eev; 3) I don't know
> >> > if this would work well for the EmacsConf,
> >>
> >> Maybe I am missing something, but why not use youtube-dl/ytp-dl and just
> >> pass the URL directly to mpv?
> >
> > Can you send an example of your idea as a series of commands that can
> > be executed in a shell? I _think_ that I have good arguments in
> > favor of the method with wget, but I need to check which command line
> > arguments you're thinking of...
>
> All you need is "mpv https://some.host/path/to/video.file" or "mpv
> https://a.service/that/doesnt/host/video/files.directly", assuming you
> have youtube-dl installed.

Hi Philip/Pkal,
can you confirm that you meant something like these two commands?

  mpv http://angg.twu.net/eev-videos/emacsconf2021.mp4
  mpv 'http://www.youtube.com/watch?v=qM0Luz78qGw'

Is there a way to make the first one use the .vtt?
What command-line arguments do you suggest?
  Cheers,
    E.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: A way to watch (some) videos about Emacs with wget and mpv
  2022-12-28  0:43       ` Eduardo Ochs
@ 2022-12-28  1:03         ` Emanuel Berg
  2022-12-28  5:46         ` Yuri Khan
  1 sibling, 0 replies; 13+ messages in thread
From: Emanuel Berg @ 2022-12-28  1:03 UTC (permalink / raw)
  To: help-gnu-emacs

Eduardo Ochs wrote:

> mpv http://angg.twu.net/eev-videos/emacsconf2021.mp4
> mpv 'http://www.youtube.com/watch?v=qM0Luz78qGw'
>
> Is there a way to make the first one use the .vtt?

See line 458, "Video Format Options", in youtube-dl(1).

Here is some experimentation on downloading from YouTube, including
CLI bulk download using 3rd party software ...

  https://dataswamp.org/~incal/conf/.zsh/dl

And, again, the mpv stuff:

  https://dataswamp.org/~incal/#mpv

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: A way to watch (some) videos about Emacs with wget and mpv
  2022-12-27 12:13     ` Emanuel Berg
@ 2022-12-28  1:56       ` Eduardo Ochs
  2022-12-28  2:03         ` Emanuel Berg
  0 siblings, 1 reply; 13+ messages in thread
From: Eduardo Ochs @ 2022-12-28  1:56 UTC (permalink / raw)
  To: help-gnu-emacs

On Tue, 27 Dec 2022 at 22:24, Emanuel Berg <incal@dataswamp.org> wrote:
> (...)

Hi Emanuel and Philip,

Thanks for the suggestions, but do you really like mpv $URL? I
don't - seeking is slow and unreliable, and it takes too long to
restart if I quit mpv...

It seems that the "people who hate videos" come in several different
types, and I'm just one of the types. I will need to clarify why I
prefer using wgets...

  Cheers =/,
    Eduardo Ochs



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: A way to watch (some) videos about Emacs with wget and mpv
  2022-12-28  1:56       ` Eduardo Ochs
@ 2022-12-28  2:03         ` Emanuel Berg
  2022-12-29 22:47           ` Eduardo Ochs
  0 siblings, 1 reply; 13+ messages in thread
From: Emanuel Berg @ 2022-12-28  2:03 UTC (permalink / raw)
  To: help-gnu-emacs

Eduardo Ochs wrote:

> Thanks for the suggestions, but do you really like mpv $URL?
> I don't - seeking is slow and unreliable, and it takes too long to
> restart if I quit mpv...

Sometimes, but absolutely not always ...

But I agree files on the disk are better (except for live events,
maybe). So again, see this file:

  https://dataswamp.org/~incal/conf/.zsh/dl

dl-video () {
    local urls=${1:-$(<$DL_FILE)}
    yt-dlp $dlp_opts -f 'bestvideo' ${=urls}
}

dl-720 () {
    local urls=${1:-$(<$DL_FILE)}
    yt-dlp $dlp_opts -f 'bestvideo[height=720]+bestaudio' ${=urls}
}

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: A way to watch (some) videos about Emacs with wget and mpv
  2022-12-28  0:43       ` Eduardo Ochs
  2022-12-28  1:03         ` Emanuel Berg
@ 2022-12-28  5:46         ` Yuri Khan
  1 sibling, 0 replies; 13+ messages in thread
From: Yuri Khan @ 2022-12-28  5:46 UTC (permalink / raw)
  To: Eduardo Ochs; +Cc: Philip Kaludercic, help-gnu-emacs

On Wed, 28 Dec 2022 at 07:44, Eduardo Ochs <eduardoochs@gmail.com> wrote:

> Hi Philip/Pkal,
> can you confirm that you meant something like these two commands?
>
>   mpv http://angg.twu.net/eev-videos/emacsconf2021.mp4
>   mpv 'http://www.youtube.com/watch?v=qM0Luz78qGw'
>
> Is there a way to make the first one use the .vtt?

The switch is called --sub-file, and it accepts both local file names
and http(s) URLs. I did not test whether remote handling is dependent
on youtube-dl.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: A way to watch (some) videos about Emacs with wget and mpv
  2022-12-28  2:03         ` Emanuel Berg
@ 2022-12-29 22:47           ` Eduardo Ochs
  2022-12-31 20:49             ` Emanuel Berg
  0 siblings, 1 reply; 13+ messages in thread
From: Eduardo Ochs @ 2022-12-29 22:47 UTC (permalink / raw)
  To: help-gnu-emacs, Yuri Khan, Emanuel Berg

Hi Yuri, Emanuel, and all,

These tests work:

• (eepitch-shell)
• (eepitch-kill)
• (eepitch-shell)

  mpv --sub-file=http://angg.twu.net/eev-videos/emacsconf2021.vtt \
      http://angg.twu.net/eev-videos/emacsconf2021.mp4

  dl-video () {
      local urls=${1:-$(<$DL_FILE)}
      yt-dlp $dlp_opts -f 'bestvideo' ${=urls}
  }
  dl-720 () {
      local urls=${1:-$(<$DL_FILE)}
      yt-dlp $dlp_opts -f 'bestvideo[height=720]+bestaudio' ${=urls}
  }

  rm -Rv /tmp/dl-test/
  mkdir  /tmp/dl-test/
  cd     /tmp/dl-test/
  dl-video 'http://www.youtube.com/watch?v=vs3-HGB6iEw'
  # dl-720 'http://www.youtube.com/watch?v=vs3-HGB6iEw'

I commented out the one with "dl-720" because it produces a file with
the same name as the one with "dl-video" - this one:

  How to Read a Greek Play [vs3-HGB6iEw].webm

Emanuel, do you have tricks to convert a youtube URL to the filename
of the saved file, or to make yt-dlp save the name in a place that is
easy to retrieve?

  Cheers,
    Eduardo Ochs
    http://angg.twu.net/eepitch.html
    http://angg.twu.net/eev-videos.html



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: A way to watch (some) videos about Emacs with wget and mpv
  2022-12-29 22:47           ` Eduardo Ochs
@ 2022-12-31 20:49             ` Emanuel Berg
  0 siblings, 0 replies; 13+ messages in thread
From: Emanuel Berg @ 2022-12-31 20:49 UTC (permalink / raw)
  To: help-gnu-emacs

Eduardo Ochs wrote:

>   dl-video () {
>       local urls=${1:-$(<$DL_FILE)}
>       yt-dlp $dlp_opts -f 'bestvideo' ${=urls}
>   }
>   dl-720 () {
>       local urls=${1:-$(<$DL_FILE)}
>       yt-dlp $dlp_opts -f 'bestvideo[height=720]+bestaudio' ${=urls}
>   }
>
>   rm -Rv /tmp/dl-test/
>   mkdir  /tmp/dl-test/
>   cd     /tmp/dl-test/
>   dl-video 'http://www.youtube.com/watch?v=vs3-HGB6iEw'
>   # dl-720 'http://www.youtube.com/watch?v=vs3-HGB6iEw'
>
> I commented out the one with "dl-720" because it produces
> a file with the same name as the one with "dl-video" - this
> one:
>
>   How to Read a Greek Play [vs3-HGB6iEw].webm

Yes, because it's the same file. dl-video, with the
'bestvideo' setting without the additional qualifier, could in
theory have retrieved say a 1080p file, which I take it is
considered better, but apparently the best it could find was
the 720p one (and in practice, the 720p files are often just
as good), and that's also the one you get with dl-720 since
then it is even specified explicitely.

> Emanuel, do you have tricks to convert a youtube URL to the
> filename of the saved file

The URL?

The filename is, by default, the title of the YouTube page as
well as a video ID, this is probably used, among other things,
to separate the same material - but in different formats, i.e.
files - from each other.

> or to make yt-dlp save the name in a place that is easy
> to retrieve?

I'm not following? Name, place - what do you mean?

But you can configure the filename of a downloaded file, see
youtube-dl(1) line 679, "OUTPUT TEMPLATE".

  The current default template is %(title)s-%(id)s.%(ext)s.

So you use that with -o. The 's' is for string, probably.

https://dataswamp.org/~incal/data/MM

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-12-31 20:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-27 11:55 A way to watch (some) videos about Emacs with wget and mpv Eduardo Ochs
2022-12-27 12:00 ` Philip Kaludercic
2022-12-27 12:08   ` Eduardo Ochs
2022-12-27 12:13     ` Emanuel Berg
2022-12-28  1:56       ` Eduardo Ochs
2022-12-28  2:03         ` Emanuel Berg
2022-12-29 22:47           ` Eduardo Ochs
2022-12-31 20:49             ` Emanuel Berg
2022-12-27 12:44     ` Philip Kaludercic
2022-12-27 14:13       ` Emanuel Berg
2022-12-28  0:43       ` Eduardo Ochs
2022-12-28  1:03         ` Emanuel Berg
2022-12-28  5:46         ` Yuri Khan

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.