Quick
index
main
eev
eepitch
maths
angg
blogme
dednat6
littlelangs
PURO
(C2,C3,C4,
 λ,ES,
 GA,MD,
 Caepro,
 textos,
 Chapa 1)

emacs
lua
(la)tex
maxima
 qdraw
git
lean4
agda
forth
squeak
icon
tcl
tikz
fvwm
debian
irc
contact

Eev: videos

If you already know how to use eepitch then the next step is to learn how to use links to videos in eev.

All the videos that I made about eev are available both on Youtube and on my home page. Youtube always converts them to a format is blurry at some points, so it is usually better to download the original version of the video from http://anggtwu.net/eev-videos/; in the case of a video with subtitles this can be done by running the two "wget"s below,

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

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

and then running the "mpv --fs --osd-level=2 ...", that plays the video in fullscreen mode and with the time and the subtitles being shown in OSD. Note that you don't need eev for this - you only need to run three commands in a shell.


Index:



1. How the links to videos work

Some sections of the eev tutorials contain "[Video links:]" blocks. For example, the section on eepitch contains this:

[Video links:]
  (find-eevnavvideo "10:36" "if I type <f8> six times here")
  (find-eevnavvideo "10:50" "a shell running inside Emacs")
  (find-eev2021video "0:14" "and if we type f8 several times here")
  (find-eev2019video "15:11" "Demo: the eepitch block (in red star lines)")
  (find-eev2019video "15:48" "Demo: eepitch on non-red star lines")
  (find-eev2019video "15:56" "Demo: eepitch in action")
  (find-eevtestblsvideo "2:33" "if I run f8 here I start a new Lua interpreter")

These links are trivial to use if you are reading the HTMLized versions of the intros... if you click on a timestamp, like "10:36", this plays that video on youtube starting from 10:36, and if you click on the name of a function, like "find-eevnavvideo", this goes to an intro that explains how the links to videos work.

If you are in Emacs and you execute this sexp with M-e,

(find-eev2021video "0:14" "and if we type f8 several times here")

...then everything is trivial if:

  • you have a local copy of the video, and
  • you have Mpv installed.

In this case eev will call mpv and make it play the local copy of that video starting from 0:14. If we don't have a local copy we get a temporary buffer "that downloads the local copy", like the one at the right in this screenshot:



2. What are local copies?

Eev always downloads "local copies" of files from the internet using a method called "psne-ing", that is explained here: (find-psne-intro). Psne converts URLs to filenames using this convention:

.        http://anggtwu.net/eev-videos/emacsconf2021.mp4
->      $S/http/anggtwu.net/eev-videos/emacsconf2021.mp4
-> ~/snarf/http/anggtwu.net/eev-videos/emacsconf2021.mp4

Psne-ing the URL above means running an eepitch block like this one to download a local copy with wget:

 (eepitch-shell2)
mkdir -p $S/http/anggtwu.net/eev-videos/
cd       $S/http/anggtwu.net/eev-videos/
wget -nc 'http://anggtwu.net/eev-videos/emacsconf2021.mp4'
echo     'http://anggtwu.net/eev-videos/emacsconf2021.mp4' >> ~/.psne.log

The eepitch block above downloads a single file: a video in .mp4. The script in the right half of the previous screenshot "psne"s both a video in .mp4 and its subtitles in .vtt. When we execute it we see this:

Note that now the script is at the left, and the target buffer for eepitch is at the right. Also, remember that the sexp

(find-eev2021video "0:14" "and if we type f8 several times here")
  • plays a local copy of a video,
  • or downloads a local copy if we don't have it yet.

Look the right half of the screenshot above. The outputs of the "wget"s indicate that now, after the "wget"s, we do have a local copy of the video and its subtitles, and now all further attempts to run the sexp above would "play the local copy" instead of "(showing a temporary buffer that) download(s) a local copy".

Now look at the last lines of the "script" at the left above. It has these sexps in comments:

# (find-fline "$S/http/anggtwu.net/eev-videos/" "emacsconf2021.mp4")
# (find-video "$S/http/anggtwu.net/eev-videos/emacsconf2021.mp4")
# (find-video "$S/http/anggtwu.net/eev-videos/emacsconf2021.mp4" "0:14")

# (find-1stclassvideo-video "eev2021" "0:14")
# (find-eev2021video "0:14")

# http://www.youtube.com/watch?v=qM0Luz78qGw#t=0m14s

The `find-fline' can be used to display the local copy using dired. The `find-video's will play the local copy - the first plays it from the beginning, and the second plays it from the timestamp given in the sexp that generated that buffer, that was this one:

(find-eev2021video "0:14" "and if we type f8 several times here")

The other lines mention the "short code" and the "youtube hash" of the video, and they will make more sense after we understand "first-class videos".



3. First-class videos

"First-class" and "second-class" videos are explained here:

(find-video-links-intro "9. First-class videos")
(find-video-links-intro "10. Second-class videos")

I have this in my ~/.emacs:

;; From: (find-eev "eev-tlinks.el" "1c")
(defalias '1c 'find-1stclassvideos)

It gives me a quick way to list all the first-class videos that eev knows about. Running `M-x 1c' displays the list in the left half of the screenshot below,

and following one of the links gives me the buffer at the right.

Remember that the sexp

(find-eev2021video "0:14" "and if we type f8 several times here")

plays a video. The "eev2021" in the `find-eev2021video' is the "short code", or the `c', of a first-class video, and running

(find-1stclassvideo-links "eev2021")

displays a lot of information about that video. If we put the point on a string like "eev2021" or "eev2021video" and we type `M-x find-1stclassvideo-links', the `find-1stclassvideo-links' will detect the `c' around point and will ask if we want information about the video whose `c' is "eev2021"; after we confirm it will run the sexp above. So `M-x find-1stclassvideo-links' gives us a way to start from a sexp that would play a video, and display information about that video instead of playing it.



4. Mpv: keys (and playing in high speed)

Mpv can be controlled with the keyboard using these keys. The ones that I use & remember are these ones:

  • q: quit.
  • SPACE: pause/unpause.
  • 9 and 0: Decrease/increase volume.
  • LEFT and RIGHT: Seek backward/forward 5 seconds.
  • Shift+LEFT and Shift+RIGHT: Seek backward/forward 1 second.
  • O: Toggle OSD states between normal and playback time/duration.
  • f: Toggle fullscreen.
  • j and J: Cycle through the available subtitles.
  • [ and ]: Decrease/increase current playback speed by 10%.
  • { and }: Halve/double current playback speed.
  • BACKSPACE: Reset playback speed to normal.

When a video has subtitles I often use something like `]]]]]]]]]]]]]]]]]]]]]]' to play it in high speed, and then BACKSPACE to go back to normal speed when I find a part that looks especially interesting.

One of my main reasons for subtitling the first-class videos of eev is to let people "watch" them in super-high speed.



5. A "smaller fullscreen"

Compare the two screenshots below:

The first one shows a video being played in "real fullscreen" and the second shows a video being played in a "smaller fullscreen" (that is a term that I've invented). When the subtitles are more important then the image I prefer to watch videos in "smaller fullscreen". Let me explain.

By default eev calls mpv with the command-line options "--fs" and "--osd-level=2", that mean "use full screen" and "display the subtitles and the current position". In "real" full-screen mode the subtitles and the position cover a part of the video being played; in "smaller fullscreen" mpv still uses the whole screen but it shrinks the size of the video a bit to make the subtitles appear on a black background. One way to switch between "use real fullscreen" and "use smaller fullscreen" is by running `M-x find-mpv-links', that displays the temporary buffer below:

Then we have to run the "(defun mf ...)" and the "(defun ms ...)". After that we can run `M-x mf' to make the next invocations of mpv use "real fullscreen" and `M-x ms' to make the next invocations of mpv use "smaller fullscreen". Note that `ms' adds two options to `ee-mpv-video-options'... I don't know how to switch between "real fullscreen" and "smaller fullscreen" using mpv's keybindings, but that hack looks good enough for me.

I recommend watching the videos about eev in high speed and in "smaller fullscreen".



6. People who hate videos

In 2022dec29 I was very happy because I had, ahem, "finally found a way to make my videos accessible to people who hate videos", and I sent this e-mail to help-gnu-emacs. The reactions were bad, and I realized that people who hate videos come in several types... I am just one of these types, and my solution was only wonderful to me and to people like me. 🙁



7. Subed and subtitles in Lua

The best way to edit subtitles in Emacs is with subed,

https://github.com/sachac/subed
https://github.com/sachac/subed-record
https://git.emacsconf.org/emacsconf-el/tree/

but I never became very proficient with it, and a few weeks before the EmacsConf 2022 I wrote a few Lua classes for generating subtitles in .vtt... I saw that I could edit subtitles very quickly with them, and my Lua files with subtitles were quite readable, so I started using that a lot. You can access my "subtitles in Lua" here:

http://anggtwu.net/SUBTITLES/
(find-angg "SUBTITLES/2020-list-packages-eev-nav.lua")
(find-angg "SUBTITLES/2020-some-template-based.lua")
(find-angg "SUBTITLES/2021-oficina-1.lua")
(find-angg "SUBTITLES/2021-org-for-non-users.lua")
(find-angg "SUBTITLES/2021-workshop-1.lua")
(find-angg "SUBTITLES/2021-workshop-2.lua")
(find-angg "SUBTITLES/2021-workshop-3.lua")
(find-angg "SUBTITLES/2021-workshop-4.lua")
(find-angg "SUBTITLES/2021-workshop-5.lua")
(find-angg "SUBTITLES/2021-workshop-6.lua")
(find-angg "SUBTITLES/2022-eev-make-0.lua")
(find-angg "SUBTITLES/2022-eev-tikz.lua")
(find-angg "SUBTITLES/2022-eev-wconfig.lua")
(find-angg "SUBTITLES/2022-find-eev-angg.lua")
(find-angg "SUBTITLES/2022-find-elisp-intro.lua")
(find-angg "SUBTITLES/2022-pict2e-lua.lua")
(find-angg "SUBTITLES/2022-yttranscript.lua")
(find-angg "SUBTITLES/emacsconf2019.lua")
(find-angg "SUBTITLES/emacsconf2020.lua")
(find-angg "SUBTITLES/emacsconf2021-dednat6.lua")
(find-angg "SUBTITLES/emacsconf2021.lua")
(find-angg "SUBTITLES/emacsconf2022-kla.lua")
(find-angg "SUBTITLES/emacsconf2022-py.lua")
(find-angg "SUBTITLES/oficina2021a.lua")



8. Windows

It is possible to make eev play videos in M$ Windows, but the setup is a bit tricky, and very few people have tested it. I described it in this video:

Title: Eev-config.el: a way without "magic" to configure eev on M$ Windows
MP4:   http://anggtwu.net/eev-videos/2022-eev-wconfig.mp4
YT:    http://www.youtube.com/watch?v=Rm29XSdGCXw
Page:  http://anggtwu.net/eev-wconfig.html
Comment: This is mainly for beginners who use Windows.
Date:    2022may15
Length:  1:15:48

Play:  (find-2022eevwconfigvideo "0:00")
Info:  (find-1stclassvideo-links "2022eevwconfig")
       (find-1stclassvideodef    "2022eevwconfig")
Index: (find-1stclassvideoindex  "2022eevwconfig")
# See:  http://anggtwu.net/eev-videos.html
#       http://anggtwu.net/eev-videos.html#mpv-keys
# Play: (find-2022eevwconfigvideo "0:00")
# Info: (find-1stclassvideo-links "2022eevwconfig")
# Subs: (find-1stclassvideolsubs  "2022eevwconfig")

wget -nc http://anggtwu.net/eev-videos/2022-eev-wconfig.mp4
wget -N  http://anggtwu.net/eev-videos/2022-eev-wconfig.vtt
mpv --fs --osd-level=2 2022-eev-wconfig.mp4

Basically, people have to run `(find-wconfig-intro)' and follow at least the instructions that:

  • install mpv,
  • configure `ee-mpv-program',
  • download wget for Windows and put it ~/eev-wconfig/wget.exe,
  • configure `ee-wget-program',
  • make eepitch-shell use eshell by default,
  • make eshell treat `wget' as an alias for ~/eev-wconfig/wget.exe,
  • make psne use "echo -N" instead of "echo".

If you try that or would like to try that, please get in touch with me... any feedback would help me a lot!