Package: pomalevi
pomaleviPowerPoint-based maintainable lecture videos command-line toolSimple and effective.If you are afraid of using the command-line, this is not for you.WhatpomaleviisPowerPoint allows recording slide shows
with narration and even a webcam insert
with its SlideShow⟶RecordSlideShow function.
The media files are stored within the PPT file on a per-slide basis.
This can be turned into a video via "File⟶SaveAs⟶*.wmv"pomalevi converts such a video file (or any other) as follows:it turns the huge video produced by PowerPoint into amuchsmaller one
by applying more reasonable compression settingsit can split the video into parts (separate, shorter videos) based on
when a user-definedsplitlogoappears in the videoit produces an HTML page with table of content hyperlinks for these
parts based on a very simple text file containing parts descriptionsit provides a simple HTML player that will stop the video
when a user-definedstoplogoappears in the video,
so that the audience can ponder a question.WhypomaleviexistsI have previously used Camtasia to record lecture videos with Camtasia's
PowerPoint plugin.
I have inserted the stops I wanted (after I'd asked the viewers a question)
manually in the Camtasia Editor and then cut the video
into the five-or-so pieces (of 10-20 minutes each) I want
and exported ("produced") each piece individually using the Batch Production
feature.This gives nice results, but is a lot of manual work.
It is acceptable for a one-time process, but what if I want to modify
two of the slides next year? Or modify my narration? Aw!PowerPoint's "Record" function is a good answer to this:
Each slide can be re-recorded individually.
Then just re-export the whole video.But I did not want to give up my chopping-into-five-parts
and even less so the automated stops that Camtasia's SmartPlayer allows.
That's when the idea of pomalevi was born:
Let's combine the strengths of PowerPoint's slidewise recording
with fully automated postprocessing.
A couple of couples of hours later here we go.Pros and consPro:Pomalevi-plus-Powerpoint produces very useful output with little effortSubsequent changes are easy to make, your lecture videos become maintainableCon:Depending on how fast your computer is, re-creating a pomalevi video
takes a substantial amount of time during which your machine is very busy.In my case, it is typically about 1.5x the video play time,
the bigger part of which is needed by the Powerpoint video export.How to installpomalevipomalevi is tested on Windows, but should also work on WSL or Linux proper.
It is a command-line application, so you need to work in cmd.exe or
Powershell.Install a recent version of Python (3.8 or higher) fromhttps://python.org.Commandspythonandpipmust end up on yourPATH.Start cmd.exe or powershell and performpip install pomaleviThat's all!You should now be able to callpomalevi.Caveats:The above should work on personal computers.If you have a pre-installed version of Python but are not allowed to usepipas shown (you should be!),usepip install --user pomaleviinstead to install to your
personal directory insteadusepip show pomalevito see (in the "Location:" entry)
where it ended up, e.g.c:\Users\<name>\AppData\Roaming\Python\Python310\site-packagesput the neighboringScriptsdirectory in yourPath, e.g.c:\Users\<name>\AppData\Roaming\Python\Scripts.(To modifyPath, use the Windows key, search for "environment"`,
and call "Edit environment variables for your account" (not "for system").
If your Windows is not running in English, the name will be different,
but the English search term should still work.)
Pomalevi should now work like after the original procedure.Alternatively, you could perform an additional install of Python
in "for me only" fashion and use the pip of that.The above installation procedure is a shortcut: If used, pomalevi
couldin principleinterfere with other Python packages installed on your
machine (although that is unlikely to be a problem).A cleaner way would usepipxinstead ofpip, which installs a
package in an isolated environment.
To do that,first installpipxbypip install pipxthen install pomalevi bypipx install pomaleviand then put the path displayed bypipxinto yourPATHHow to usepomaleviView demo.pptx (1 minute)Find the pomalevi install directory tree in the
directory ending insite-packageswhich is shown when you executepython -c "import sys; print(sys.path)".From the pomalevi install directory tree,
copyppt/demo.pptxto any of your own directories.Open the copy with Powerpoint,choose "Powerpoint⟶Slide Show",check the boxes for "Play Narrations" and "Use Timings",start the slide show.View it, end it. Imagine this was your own presentation which you want
to publish as several videos in pomalevi style.To do that, "File⟶Save as" this file,
select file format "Windows Media Video (*.wmv)",
and save it asmyslides.wmv.
This file you can use as themyslides.wmvin the subsequent examples.Very basic use: Compression onlypomalevi mydir/myslides.wmvThe output is a directorymydir/myslides/with several files.
You can either usemydir/myslides/index.htmlto get the pomalevi player or
just the video itself:mydir/myslides/v1.mp4.Inserting stops:-stop-atIn Powerpoint, choose aunique graphicor text string that will appear in your
video to indicate to pomalevi where to insert a stop.For instance, I use "Insert⟶Icons⟶Business"
pick the two people with the question mark (I have PowerPoint 2019),
keep the default size, fill the icon with my highlight color (dark red),
and put it in the lower left corner of my slide.
(Any corner can be made to work easily, other places are possible if needed.)You could in principle also use the string "STOP!" or whatever other
fixed-and-unique visual element you like.Insert anEntrance animationfor the logo at the appropriate moment,
perhaps insert an Exit animation shortly thereafter.
Only the entrance moment is relevant; it is the stop moment.Note that the player is not capable of stopping atexactlythis moment;
expect a tolerance of +0.25 seconds (0.5 seconds for Firefox).Export the video from PowerPoint.Play it at original scale (that is, size 100%).Stop it when the logo is visible.Make a rectangular-areascreenshotof only the logo.Store it as PNG, e.g.stoplogo.png.Here is what the result looks like in my case:pomalevi makes a pixel-by-pixel search for this image and expects
a match of at least 80%, so beware of non-rectangular or transparent logos
if the slide background behind it will not always be the same.
See also section "Caveats" below.Now produce the video with pomalevi:pomalevi --stop-at ll:stoplogo.png mydir/myslides.wmv(llstands for"lower left")Searching for a stoplogo is a slooow process if done over the whole image.
Therefore, pomalevi expects the logo to be in one of the four corners
of the slide: one oful,ur,ll,lrin the--stop-atspecification, meaning
upper left, upper right, lower left, lower right, respectively.It will find it there with a tolerance of up to half a logo width
and half a logo height towards the middle of the video.
If the logo hangs over the edge of the video even a bit,
it cannot be found reliably.The part after the position specifier can be a pathname.In principle, you can also specify the search area by hand thusly:--stop-at x=900..1000,y=500..600:stoplogo.pngwould look for the logo (specifically: the upper-left corner of the logo)
in that region of the video (near the middle).x=0,y=0 is the upper left corner.Unlike for basic use, this time thev1.mp4file is not helpful,
because it knows nothing about the stops.Instead, you need to usemydir/myslides/index.html, which calls
thepomalevi playerand feeds it the proper list of stop times.Like most pomalevi options,--stop-athasfriendly defaults:--stop-at ll:stoplogo.pngwill be assumed by default,
but ifstoplogo.pngis not found, no stoplogo search will be performed.The stoplogo will be searched for in several places:./stoplogo.png, in the local directorymydir/stoplogo.png, in the input file directorymydir/../stoplogo.png, in the parent of the input file directorymydir/toc/stoplogo.png, in thetocsubdirectory of the input file
directory (see the description of--tocbelow).Splitting into parts:--split-atThe output of pomalevi appears a bit silly unless you let pomalevi
split your video into several parts.Splitting worksmuch the same as stopping(described above):Decide on a logo (of course not the same one as for stopping),insert it in your presentation (preferably again in the lower right),make a screenshot of it in the original size,store it as (preferably)splitlogo.png, andcall pomalevi with it:pomalevi --split-at ll:splitlogo.png input.wmvSplitting creates a separate video file for each part, calledv1.mp4,v2.mp4, etc.mydir/myslides/index.htmlprovides navigation between those videos.The samefriendly defaultsapply as for--stop-at.Navigation with content description:--tocAll you get so far for navigation in the HTML file are generic section
titles "part 1", "part 2", etc. that are hyperlinks which load the respective
part of the video.
You can get a text to the right of each number that describes the
content of that video part and also get a meaningful title
for the HTML page by using the--toc filenameoption (table of contents):The file given must be a UTF-8-encoded plain-text file
with a paragraph structure.
Use any text editor (for instance MS Windows'notepad)
to produce them.
Paragraphs are separated simply by an empty line.The first paragraph (paragraph 0) provides the title of theindex.htmlpage.Subsequent paragraphs 1..N provide the content description for
video parts 1..N.Example:This is the title

This is the description of video part 1. It is a longer one that
takes multiple lines. Those lines will be rendered as a flowing
paragraph of text on the HTML page.

This is the description of the second video part, number 2.Like most pomalevi options,--tochasfriendly defaults:--toc myslides-toc.txtwill be assumed by default,
but ifmyslides-toc.txtis not found, the generic toc will be produced instead.The toc file will be searched for in several places:./myslides-toc.txt, in the local directorymydir/myslides-toc.txt, in the input file directorymydir/toc/stoplogo.png, in thetocsubdirectory of the input file
directory.Output directory:--outSo far, we have always used thefriendly defaultto tell
pomalevi where we want the output to end up:
If the input file ismydir/myslides.wmv, the output will go tomydir/myslides/*.If you don't want this, specifiy a target directory with--out:pomalevi --out outputdir mydir/myslides.wmv.Friendly defaults rough summaryTaking all of the above together, the explicit pomalevi call could be:pomalevi --split-at ll:splitlogo.png --stop-at ll:stoplogo.png --toc mydir/myslides-toc.txt --out mydir/myslides mydir/myslides.wmvbut the following is equivalent, courtesy of the defaults:pomalevi mydir/myslides.wmvOverlapping Powerpoint export and pomalevi: waitingPowerpoint export takes a long time,
pomalevi encoding also takes a long time.
It would be nice if we could start pomalevi before Powerpoint has
finished exporting.Consider it done!pomalevi will automatically wait until the given input file appears to
have been exported completely
and only then start the actual pomalevi work.Encoding type and quality:--formatpomalevi can produce either*.mp4video files
(encoded with H.264 video and AAC audio) or*.webmvideo files
(encoded with VP8 video and Opus audio).webmencoding currently uses rather naive settings and is not recommended.mp4encoding is available with four different sets of settings, called
q1 to q4, that produce different quality levels and file sizes.q1 creates the smallest files with the lowest audio and video quality,q4 creates the largest files with the highest quality.These are selected using--format mp4q1--format mp4q2--format mp4q3--format mp4q4--format webmmp4q3is the default.How pomalevi works internallypomalevi usesffmpeg'sfind_rectfilter
to find all frames that contain the respective logo PNG content.
It uses the time information of these frames to drive the splitting
into parts and to feed the pomalevi player with the stop times
for each part.find_rectcannot cope with scaling or rotation of the target image,
works only with a rectangular image,
and it considers only a grayscale version of it with no alpha channel.If you use a logo filemylogo.png,
its grayscale derivativemylogo.pgmwill appear
in the output directory during encoding (and then disappear again).CaveatsOn my machine, the MP4 files produced by PowerPoint's "Export" function
are always broken: After a slide transition, when the new slide is already
visible, the old one shortly reappears for varying lengths of time from
a single frame to several tenths of a second.So I use "Save as" with target format WMV instead.
That's sort of silly (because WMV is the inferior format) but at least it works.Because of how pomalevi works (see above), the search for stop logo or split logo
may fail if the background of the logo is colored.
There must be enough contrast between the logo color(s) and the
background color when converted to grayscale.Because of how it works (see above), the search for stop logo or split logo
may fail if the logo has transparent parts and is placed onto othermaterial. The logo match is fuzzy, but expects at least an 80% match.Unless you place your logopreciselyin the corner, fine details in
the logo will make the match worse. Prefer simple logos.TODOImprovements waiting to be made:make demo.pptcommand keywordsencode,compress,patch,get-logos,get-demo.--ffmpeg-a,--ffmpeg-vto submit encoding optionshighlight current video in tocmakepomalevi.cssmobile-ready--favicon file: Name of a 32x32 pixel PNG file to be used as the favicon.Versions0.7, 2022-03-18initial version, with most of the functionality:
encode with splits and stops, basic CSS, TOC0.8, 2022-04-28:lots of small additions to functionalityobtain actual video resolutionmodularized internal structurefriendly defaults for--split-at,--stop-at,--toc,--out.0.9, 2022-04-29:usestatic-ffmpegPython package, no longer the system's ffmpeguse Poetry build system and producepomalevi.exe1.0, 2022-05-06add--formataddppt/demo.pptx