Create screencasts with menyoki
Recording!
After selecting the appropriate window, start recording by pressing Alt+Enter (Figure 3). The same key combination will stop the recording later. Menyoki records the video in RAM and writes it to your hard disk when you stop recording. This approach causes the main memory to quickly fill (depending on your memory size) and the system to freeze, making menyoki only suitable for short recordings.
![](/var/linux_magazin/storage/images/issues/2021/249/menyoki/figure-3/788698-1-eng-US/Figure-3_large.png)
In the default setting, the software records at 20 frames per second; however, for many tutorials, something as low as 15 could be fine. Although the results are more jerky, the finished animation also takes up less storage space. In addition, a lower frame rate gives you a longer recording time. Use the --fps
parameter to define menyoki's recording frame rate. Unusually, this value follows the file format specification (Listing 3, line 1).
Listing 3
Menyoki Options
01 $ menyoki record gif --fps 15 save "film.gif" 02 $ menyoki record --root --size 320x200 --padding 100:0:0:50 gif save "film.gif" 03 $ menyoki -q record --duration 1 save "-" | convert - "film.miff"
With the --root
parameter, menyoki can capture the entire desktop. If you use multiple monitors, use --monitor <NUM>
instead, where NUM
corresponds to the monitor number to be recorded. Another parameter, --focus
, lets you immediately record the currently focused window. The --select
parameter lets you choose the window to be recorded.
If you only want to capture a section of the desktop, move the green highlight rectangle to the appropriate position using Shift+Alt and the arrow keys. Alternatively, specify the size of the area directly. For example, line 2 of Listing 3 captures a 320x200 pixel area of the desktop (Figure 4). The --padding
switch moves the recording area 100 pixels down and 50 pixels to the right from the upper left corner of the screen.
![](/var/linux_magazin/storage/images/issues/2021/249/menyoki/figure-4/788701-1-eng-US/Figure-4_large.png)
Menyoki also supports the --duration
parameter, which lets you specify the recording time in seconds, avoiding the need to cancel recording manually. This parameter is especially useful if you use menyoki in a shell script. You can then pipe the generated animations to other programs (Listing 3, line 3).
The -q
option tells menyoki to remain mute. The save "-"
parameter sends the animation to standard output, which the |
pipe then passes to convert
. Finally, convert
transforms the animation into the ImageMagick's MIFF format.
Cold Cuts
Some events happen too quickly to capture in a screenshot – for example, an important error message. To remedy this, first film the application at work and then break the animation into individual frames. Menyoki does this with the split
action.
Line 1 of Listing 4 tells menyoki to store all frames from the video film.gif
in JPEG format in ~/Videos/
. The file names of the frames all start with frame_
, to which menyoki appends the frame number. Consequently, in Listing 4, you will see the files frame_1.jpg
, frame_2.jpg
, frame_3.jpg
, and so on. In addition to JPG, menyoki also supports BMP, ICO, PNG, PNM, TGA, TIFF, and FF (farbfeld) file formats.
Listing 4
Editing Movies
01 $ menyoki split --dir ~/Videos/ "film.gif" jpg 02 $ menyoki edit --ratio 1.5 "frame_3.jpg" save "frame_3_big.jpg" 03 ### Scale multiple images at the same time: 04 $ for file in *.jpg; do menyoki edit --ratio 1.5 "$file" save "$file"; done 05 ### Combine individual images to create a movie: 06 $ menyoki make --dir ~/Videos/ --fps 15 --format gif save film2.gif 07 ### Pass in image files instead of directory 08 $ menyoki make --fps 15 --format gif "frame_1.jpg" "frame_2.jpg" "frame_3.jpg" save film3.gif
You can now retrieve the rapidly disappearing error message from the individual images. If the font appears too small, menyoki can enlarge the selected image directly with the edit
action (Listing 4, line 2). The --ratio
parameter scales the image by a factor of 1.5, preserving the aspect ratio. The results are then stored in the frame_3_big.jpg
file.
Menyoki also supports other types of image modifications (see Table 1). Currently, however, menyoki only edits a single image and not the complete image sequence. To quickly scale all frames by a factor of 1.5, use the command from line 4 of Listing 4.
Table 1
Image Processing Functions
Parameters |
Meaning |
--grayscale |
Converts image to grayscale |
--crop <T:R:B:L> |
Crops the image by the specified top, right, bottom, and left pixel dimensions |
--resize <W>x<H> |
Resizes the image by width and height without preserving the aspect ratio |
--ratio <RATIO> |
Resizes the image proportionally preserving the aspect ratio |
--rotate <ROTATE> |
Rotates the image clockwise (possible values: 90, 180, 270) |
--flip <FLIP> |
Flips the image (possible values: horizontal, vertical) |
--blur <SIGMA> |
Blurs the image |
--hue <HUE> |
Changes the hue |
--contrast <CONTRAST> |
Changes the contrast |
--brightness <BRIGHTNESS> |
Changes the brightness |
After editing all the frames, menyoki can reassemble them into an animation if so desired (Listing 4, line 6). The --dir
parameter defines the directory with the frames, and --fps 15
specifies a playback speed of 15 frames per second. --format
is followed by the desired output format. Instead of your default directory, you can alternatively transfer to individual image files (line 8). The analyze
subcommand lets you output technical information for the selected image file (Figure 5).
Menyoki can also create screenshots. This works in the same way as for an animation, but the associated action is capture
(Listing 5).
Listing 5
Making a Screenshot
$ menyoki capture jpg save "screenshot.jpg"
Conclusions
Menyoki is the perfect tool to quickly record a process as a GIF or APNG animation. You can use menyoki to deconstruct your videos into individual frames, edit the individual images if necessary, and reassemble the image sequence into an animation. As a command-line tool, menyoki can also be easily integrated into custom shell scripts. For more examples of how to use menyoki, as well as documentation, visit the project's GitHub page [3].
However, menyoki does not yet come close to the functionality of other screencast programs. In particular, menyoki does not allow you to scale or post-process all extracted images at once. In addition, because of its mode of operation, menyoki is also only practical for short recordings.
Infos
- menyoki: https://menyoki.cli.rs
- Download menyoki: https://github.com/orhun/menyoki/releases
- menyoki project page on GitHub: https://github.com/orhun/menyoki
« Previous 1 2
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
Linux Kernel 6.13 Offers Improvements for AMD/Apple Users
The latest Linux kernel is now available, and it includes plenty of improvements, especially for those who use AMD or Apple-based systems.
-
Gnome 48 Debuts New Audio Player
To date, the audio player found within the Gnome desktop has been meh at best, but with the upcoming release that all changes.
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.