Skip to content

ripose-jp/Memento

Repository files navigation

Memento

AUR Flathub

Memento is a FOSS, mpv-based video player for studying Japanese.

Memento has been drastically overhauled since v1.7.2. If you're looking for the README relevant to that version, click here.

Example

Features

  • Grammar aware subtitle search
  • Yomichan-style Kanji cards
  • Support for Yomichan dictionaries
  • Anki card creation through AnkiConnect
  • Support for mpv upscalers, plugins, and configuration files

Dictionaries

Troubleshooting

Can't Add Cards: Only the "Show in Anki" Button is Available

This means there is a mistake in your card template. When this happens, AnkiConnect will report that all potential cards are not addable. Double check your card template to see if the front of the card is missing something.

Windows: Updating yt-dlp

If you're version of yt-dlp is out of date, you may experience degraded streaming performance or websites not working entirely.

Memento's version of yt-dlp can be updated by doing the following:

  1. Download yt-dlp
  2. Put yt-dlp.exe in Memento's install directory. For the portable version of Memento, this is located in the same folder as the executable. For the installed version, this is located at C:\Program Files\Memento by default.

macOS: Streaming video doesn't work

This means that mpv cannot find your yt-dlp installation.

To install yt-dlp, paste these commands into Terminal:

curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o ~/Library/Preferences/memento/yt-dlp
chmod a+rx ~/Library/Preferences/memento/yt-dlp

macOS: Could not initialize MeCab

Move the Memento application to a directory that doesn't have spaces in the path like /Applications. Unfortunately, this is an limitation of MeCab and there is no workaround that can be implemented.

KDE Plasma: No native file picker

For Memento to be able to use the native file picker on KDE Plasma, you must compile with with -DMEMENTO_QAPPLICATION=ON. This pulls in a dependency on Qt Widgets, so make sure to have that installed on your system.

Dependencies

  • Qt
    • Base
    • SVG
  • mpv
  • sqlite3
  • Json-C
  • libzip
  • QCoro (optional)
    • Use -DMEMENTO_SYSTEM_QCORO=ON
  • yt-dlp (optional)
  • MeCab (optional)
    • Use -DMEMENTO_MECAB_SUPPORT=ON
    • With either ipadic or NAIST-jdic installed as a system dictionary on Linux and macOS. This only applies to self-compiled versions, not appimages or app bundles.
  • libmocr (Optional)
    • Use -DMEMENTO_OCR_SUPPORT=ON and -DMEMENTO_SYSTEM_MOCR=ON

For the best experience, install Noto Sans CJK JP and the Kanji Stroke Order fonts.

Building

I do not guarantee that any branch will successfully build or be bug-free. If you want to build a stable version of Memento, compile a release from source.

Linux

To install Memento on Linux, type the following commands:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . -j $(nproc)
sudo cmake --build . --target install

Windows

  1. Install MSYS2
  2. Open MSYS2 UCRT64
  3. Make sure MSYS2 is up to date by running this command multiple times until it stops doing anything:
    pacman -Syu
    
  4. Install the necessary tools and dependencies:
    pacman -S mingw-w64-ucrt-x86_64-git mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-ninja mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-python mingw-w64-ucrt-x86_64-sqlite3 mingw-w64-ucrt-x86_64-qt6 mingw-w64-ucrt-x86_64-mpv mingw-w64-ucrt-x86_64-mecab mingw-w64-ucrt-x86_64-json-c mingw-w64-ucrt-x86_64-libzip
    
  5. Clone the repository:
    git clone https://github.com/ripose-jp/Memento.git
    
  6. Build Memento:
    cd Memento
    ./windows/build.sh -DCMAKE_BUILD_TYPE=Release
    
  7. The resulting file will be in
    build/Memento_x86_64
    

macOS

Important: Clang is the only officially supported compiler for building Memento on macOS.

  1. Install Homebrew with this command:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  2. Install the necessary tools and dependencies:
    brew install git cmake sqlite3 qt6 qcoro6 mpv mecab mecab-ipadic json-c libzip
    
  3. Clone the repository:
    git clone https://github.com/ripose-jp/Memento.git
    
  4. Build Memento:
    cd Memento
    mkdir build
    cd build
    cmake -DCMAKE_BUILD_TYPE=Release ..
    cmake --build . -j $(nproc)
    
  5. The resulting executable will be:
    Memento/build/src/memento
    

macOS Bundle

  1. Follow steps 1 - 3 of the macOS build instructions.
  2. Open the Keychain Access app.
  3. Go to Keychain Access > Certificate Assistant > Create a Certificate... in the menubar.
  4. Put the name of your certificate in the 'Name' field, set the 'Certificate Type' to 'Code Signing', and click 'Create'.
  5. Return to your terminal and input:
    cd Memento
    mkdir build
    cd build
    cmake -DMEMENTO_CODESIGN_IDENTITY="<certificate name>" -DMEMENTO_BUNDLE=ON -DCMAKE_BUILD_TYPE=Release -DMEMENTO_MECAB_SUPPORT=ON -DMEMENTO_SYSTEM_QCORO=ON ..
    cmake --build . --target memento_bundle -j$(sysctl -n hw.ncpu)
    
  6. The resulting app bundle will located at:
    Memento/build/src/Memento.app
    

Adding OCR Support

To build with OCR support, make sure that Python is installed and run:

pip install manga-ocr

Any problems you may have getting manga-ocr installed using pip is beyond the scope of this project. I wish you the best of luck.

Configure the build with:

cmake .. -DMEMENTO_OCR_SUPPORT=ON

If you want to use a venv, make sure to configure the build with these additional options:

-DPython_EXECUTABLE=/path/to/.venv/bin/python
-DPython_FIND_VIRTUALENV=ONLY

Note: If using -DMEMENTO_SYSTEM_MOCR=ON, make sure that the installed libmocr binary links to your preferred venv by building libmocr using the same -DPython_ options.

Follow the normal build instructions from here.

Configuration

Most mpv shaders, plugins, and configuration files will work without modification.

It is important to note that mpv and Memento's configuration directories are separate. This means mpv configuration files, scripts, etc. intended to modify Memento's behavior should be placed in Memento's configuration directory.

The Memento configuration directory is located at:

Linux

~/.config/memento

Windows

%APPDATA%\Local\memento

macOS

~/Library/Preferences/memento

If any mpv binds or plugins do not work, please create an issue in the issue tracker.

asbplayer

If you hate Memento, try asbplayer.

Acknowledgements