GithubHelp home page GithubHelp logo

ripose-jp / memento Goto Github PK

View Code? Open in Web Editor NEW
421.0 7.0 20.0 137.29 MB

An mpv-based video player for studying Japanese

Home Page: https://ripose-jp.github.io/Memento/

License: GNU General Public License v2.0

CMake 2.88% C++ 86.38% Shell 0.57% C 8.50% Makefile 0.23% Python 0.56% Objective-C++ 0.30% NSIS 0.57%
japanese anki mpv yomichan video language-learning

memento's Issues

Looking up words on this subtitle causes segmentation fault

Attempting to look up any part of the following subtitle immediately causes a segmentation fault on macOS 0.5.1-2.

1
00:00:00,000 --> 00:00:05,000
〝民間南極観測隊
3年ぶりに派遣決まる〞

The payload is attached here (.srt file before changing extension): test.txt. The timing has been changed from the original.

This happens with my custom dictionaries loaded, no dictionaries loaded, and just jmdict_english loaded.

Add the ability to have the audio of multiple subtitle lines.

Sometimes just the current subtitle line is not enough to give context to the word you want to mine, so it would be good to have a way of selecting multiple adjacent subtitle lines, maybe in the subtitle browser and then when you click the button to mine it records the audio of the selected subtitle lines and add them to the sentence field.

allow creating cards through automated subs

It's not always 100% correct, but Japanese videos usually has harded subs and those subs usually come at the right timing. All you gotta do is finish the card yourself by editing the card with a screenshot of the hard sub or something.

Unnecessary quotation marks in Memento's version

If you install Memento through the installer when you go to the Programs and Features on Windows 10 to uninstall the program the version number has quotation marks unlike the other programs.

Screenshot, Git included for comparison:
image

25-30% CPU usage when idle with subs on the screen

When video is stopped and no subtitles on the screen CPU usage is 0-0.2%, and when subtitles are on the screen CPU usage jumps to constant 25-30%. Other UI elements(menu bar and video controls) don't affect CPU usage much(1.5-2% maximum and only for a moment). I don't know what happens, maybe subtitles are being redrawn constantly(but why if nothing changes?).

100% reproducibility.
OS: Windows 10
Memento version: 0.5.1

OS X Port Bugs

This is an issue intended to list all the problems with Memento on OS X so that they can easily be fixed at a later date or by someone who wants to fix them.

I was able to get Memento to compile in VM, but because the VM doesn't support video acceleration or audio, so there is really no feasible way for me to develop or test Memento on OS X.

Bugs

  • Fullscreen is broken

    • The way Memento handles fullscreen is that it waits for the playerFullscreenChanged signal to be omitted and adjusts the window size of Memento accordingly. The window resizing is all handled in MainWindow.
  • The name of Memento in the OS X menu bar is lowercase

    • This can probably be fixed by changing the name of Memento in main.cpp. If this is changed, it should be in a preprocessor directive specific to OS X or it will break configurations on other OSes. Didn't work. The name in the menu bar is likely tied to the name of the executable file.
  • The startup message box points OS X users to the wrong location for adding dictionaries

    • OS X manages to move things in the menu bar around automatically to make their OS consistent. This message can be changed in MainWindow's showEvent method.
  • OS X will sleep on inactivity (Implemented not tested)

    • If the player is unpaused, it will not prevent the screen from dimming or going to sleep. This behavior is implemented on other OSes in MpvWidget. The import on line 37 was intended to be used to implement this, but I'm not entirely certain how to do this on OS X, so I didn't implement it.

If anyone has any more bugs to contribute, post them below and I'll see if I can give any insight on how to fix them.

Transparent subtitle bug introduced in 4bb801f

In versions since 4bb801f, the search (subtitle) widget is transparent (but still searchable on hover). I tested the three previous versions which all display correctly. I don't understand why it is caused in that commit though.

Shift select behavior bug

Selecting continuous blocks of subtitles from the subtitle list with shift click has unexpected behavior in some scenarios.

2021-12-27 18 58 25

Subtitles in question:

892
00:59:21,015 --> 00:59:24,477 
あとは どうやって忘れるかだけだ

893
00:59:24,561 --> 00:59:24,727 
(せきばらい)

894
00:59:24,727 --> 00:59:26,104 
(せきばらい)

895
00:59:24,727 --> 00:59:26,104 
役に立たなかったでは
終えられんしな

896
00:59:26,104 --> 00:59:27,146 
役に立たなかったでは
終えられんしな

897
00:59:27,272 --> 00:59:31,818 
し… しかし 今回の計画は
各国の注目を集めており―

898
00:59:31,943 --> 00:59:35,154 
共和国側も
我々の情報を欲しています

899
00:59:35,280 --> 00:59:38,825 
それを 敵の属国リマダとの
国境で打ち上げる…

900
00:59:38,950 --> 00:59:42,370 
だから そうするんだ
打ち上げなぞは どうでもいい

901
00:59:42,495 --> 00:59:45,540 
目当ては 共和国のリマダ駐屯軍だ

Other instances I have observed also have consecutive subtitle entries that start and end at the same time while having the same text content. Perhaps this is causing problems with the hash map from subtitle text to timing information?

Add Yomichan-style search for creating cards

I hate to be the one asking for feature creep, but here is something to consider. Currently, when looking up a word such as追いはぎ, 持ちこたえる, 叩きだす, etc, where the first part is in the conjunctive form and the second part is in kana, Memento is not able to look up the whole word but separates it into two (at least with my set of dictionaries). After editing the subtitle to rewrite the second part of the word in kanji also (追い剥ぎ、持ち堪える、叩き出す), Memento is able to look up the whole word.

I think this is a difficult problem and Yomichan does not handle this case well either. But there have been other cases where the word form is too weird for Memento to recognize (one I can think of is 混とん vs 混沌). I wonder if any of the following are possible:

  • allow the user to select part of the subtitle to look up as the headword as a whole (I doubt this is what causes the issue in the example; I ran these words through Mecab and each is recognized as an individual token)

  • have an interface that the user could open & manually input a word (in the dictionary form that Memento should be able to recognize) to look up with Memento’s dictionary, and be able to add the result to Anki with the relevant screenshot and context. This seems like a catch-all solution for these scenarios that don’t happen very often.

Possible selection of more characters?

Currently there is a problem that I can't select say all string as sentence. And sometimes even Kanji+Kana won't work, for example 楽しい, I can select only Kanji, or only Kana which is pointless.

error while building the soruce code of Memento on Arch linux.

terminal log:
mkdir -p build
cd build; cmake -DCMAKE_BUILD_TYPE=Release ..
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
LIBZIP
linked by target "dictionary_db" in directory /home/me/Downloads/Memento-0.5.0-1-beta/src/dict
MECAB
linked by target "dictionary_db" in directory /home/me/Downloads/Memento-0.5.0-1-beta/src/dict

-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
make: *** [Makefile:4: release] Error 1

Duplicate cards even though duplicate policy is marked as "none"

The program lets you create a new card of a word you already have a card for (tho you havent reviewed it yet) and theres no warning shown on your yomichan, unlike the browser version. On options > anki integration > duplicate policy I marked "none" btw.
Other than that everything looks pretty good.

OBS: idk if I missed anything, if I did something dumb I'll delete this issue

Using arrow keys for skipping forward and backwards is slightly broken

Upon pressing either of the left/right arrow keys the video goes forwards or backwards twice, aka 10 seconds rather than 5.

Rather than fixing it so it goes forward once I think it would be better to skip to the previous or next subtitle, to add to this, also have the enter key replay the current subtitle.

Unexpected mpv config directory on MacOS

On macOS, the input.conf at ~/.config/mpv/input.conf apparently is not read. This can be solved by copying it to Memento's own config directory at ~/Library/Preferences/memento. I have not yet tested the case with mpv.conf.

The behavior is certainly unexpected, though perhaps it can be beneficial in allowing bespoke mpv configurations for Memento. In any case, we probably should note it somewhere?

Thanks for this really cool work!

Discovered while checking the following issue:

Nice catch with the double seek, I'll fix it in the next release.

As for changing the default keybinds, I'd rather not so Memento remains functionally as close to mpv as possible.

You can implement the behavior you want pretty easily by adding these lines to your input.conf.

ENTER   sub-seek        0
RIGHT   sub-seek        1
LEFT    sub-seek        -1

Check the README to find the location of the config directory for your operating system.

These links will be helpful for finding out what the default binds are and how to configure you own custom binds:
https://mpv.io/manual/stable/
https://github.com/mpv-player/mpv/blob/master/etc/input.conf

Originally posted by @ripose-jp in #3 (comment)

Error adding dictionaries

Tried several dictionaries zip files I already used for Anki
But still receiving same error

Error adding dictionaries
Could not open database

Thanks

Clicking on subs lags a lot the application

First of all, very nice initiative of coming up with this. It will help a lot of people.

I didn't quite get if it's a hover thing or a click thing, but either way it lags the program A LOT.
It doesn't show up properly and when it does it's a blink of a second.
I had to keep my cursor on top of it for it to show and took a few seconds which is bothersome.

Suggestion:
Hold some key and hover on the word for it to appear.
Or simple click on it.

Typo in uninstaller

When you are going to uninstall Memento in windows and it asks for confirmation the message says "permanantly uninstall Memento?" and it should be "Permanently uninstall Memento?".

Although I think another question would be better, like "Are you sure you want to permanently remove Memento?" or something like that.

Screenshot:
image

Double subtitles now displaying

image
When selecting second row of subtitles they don't display. Tried different files but issue persists.
Win10 21H1, latest memento.

Unable to open media from URL's

When trying to open media from a URL (I tried with both Youtube and TVer.jp which works with MPV player) I was unable to open any media in the player. The screen is just black. Opening from local files is fine and has no problems.
It says It's unable to find MSVCR100.dll

Exact error message:
MSVCR100.dllが見つからないため、コードの実行を続行できません。プログラムを再インストールすると、この間題が解決する可能性があります。

I downloaded using the stable version on the release page, I did not build from source.

Audio padding

Sometimes the audio gets slightly cut off when exporting a card to anki would be nice if the plugin had some padding on either side to minimize this issue

Add option to resize screenshots before adding to anki

The user should be able to resize mpv screenshots, because otherwise images might be too big on anki cards especially when watching something in fullscreen.

Locally this was pretty easy to implement, starting on line 717 in mpvadapter.cpp, I added

    QImage img(filename);
    img = img.scaled(1000,300,Qt::KeepAspectRatio)
    img.save(filename)

Unforunately I'm not very good at qt or c++, so I don't know what the best way to add options to the settings ui is, but I think it would be a useful feature to be able to customize the screenshot size; and maybe an option to choose to preserve aspect ratio to height or width.

Maintain subtitle style with .ass subtitles

I wish there was an option of maintaining the style of .ass subtitles instead of the player overriding it, there are color-coded subtitles that look so beautiful but that is lost when using the player's subtitles instead of mpv's ones.

Memento's subtitles:
image

MPV's subtitles:
image

Sometimes fails to populate {context}, {audio-media}, or {screenshot-video} for Anki card

Apologies that I have been unable to reproduce any error on a consistent basis. When playing back local media, deleting the card and adding it again in Memento usually works.

Empty {context}

The Anki card field populated with {context} is entirely blank when this happens. I think I noticed once when this happened that no subtitle seemed to be visually selected in the subtitle list when the card was being added. But as I have not been able to reproduce exactly this behavior I cannot say this certainly happened.

Error with {audio-media}

The Anki card field populated with {audio-media} can have values like this:

[Errno 2] No such file or directory: '/private/var/folders/31/xkn6lwrs7_382lqhy5f9wzbc0000gn/T/memento.apAyPt.aac'
[Errno 2] No such file or directory: '/private/var/folders/31/xkn6lwrs7_382lqhy5f9wzbc0000gn/T/memento.lmvQIY.aac'

or be entirely blank.

Such error values can be consistently reproduced by viewing this YouTube video and adding vocab in the Japanese subtitle to Anki. However I feel it may not be entirely the same problem experienced when playing local media, where it only fails intermittently.

Edit: include {screenshot-video} error

Error with {screenshot-video}

The Anki card field populated with {audio-media} can have a value like this:

[Errno 2] No such file or directory: '/private/var/folders/31/xkn6lwrs7_382lqhy5f9wzbc0000gn/T/memento.ddcjlh.jpg'

I have not encountered a case where the field is empty. This happens rarely but seemingly randomly when playing local media.

Platform: macOS 0.5.1-beta

Character isn't highlighted if the cursor is on the right side of a character

Currently, if your cursor is in the right ~60% of a certain glyph, that glyph isn't highlighted and looked up. Here's a short video to explain what I mean.

I think this is an important thing to change because of how central the text selection is to the program. Currently the most reliable way to select a word is to move the cursor to the very left of the character, or the gap between the character and the next one to the left. You should be able to move your cursor directly to the character, this is how yomichan works on the browser: when the cursor is even slightly on the next glyph, it's selected.

I think this is different to latin-script highlighting, where the current behavior makes sense; characters are much more discrete in CJK.

I know this is really nitpicky, so if this is a can't-fix or is just too much work then please close the issue.

Cannot build on Windows 10

Anon@Navi MSYS ~/Memento
$ ./windows-build.sh x86_64
mkdir: cannot create directory ‘build’: File exists
CMake Error: Could not create named generator MSYS Makefiles

Generators
* Unix Makefiles               = Generates standard UNIX makefiles.
  Ninja                        = Generates build.ninja files.
  Ninja Multi-Config           = Generates build-<Config>.ninja files.
  CodeBlocks - Ninja           = Generates CodeBlocks project files.
  CodeBlocks - Unix Makefiles  = Generates CodeBlocks project files.
  CodeLite - Ninja             = Generates CodeLite project files.
  CodeLite - Unix Makefiles    = Generates CodeLite project files.
  Eclipse CDT4 - Ninja         = Generates Eclipse CDT 4.0 project files.
  Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files.
  Kate - Ninja                 = Generates Kate project files.
  Kate - Unix Makefiles        = Generates Kate project files.
  Sublime Text 2 - Ninja       = Generates Sublime Text 2 project files.
  Sublime Text 2 - Unix Makefiles
                               = Generates Sublime Text 2 project files.

Error: could not load cache
mkdir: cannot create directory ‘Memento_x86_64’: File exists
cp: cannot stat 'src/memento.exe': No such file or directory
./windows-build.sh: line 147: windeployqt: command not found

Followed the tutorial and it's not working... any suggestion?

Manual selection in subtitle

Sometimes MeCab will not split up the words correctly, but there is no easy way to lookup the correct word (unless you open the Term search window and manually type it).
It would be handy if one could select any part of the sentence and look it up.

Where can I find the settings?

No dictionaries are installed. For subtitle searching to work, please install a dictionary.
Dictionaries can be found here.
To install a dictionary, go to Settings -> Options -> Dictionaries.

But where can I find settings? I assume it is the hamburger menu in the bottom-right corner, but nothing happens when I click it.
I'm on Linux, Manjaro with KDE.

More info: I installed the latest release 0.4.4 with

make
sudo make install

[Linux] Can't install dictionaries: "Could not open database"

I can't seem to open any dictionaries, even jmdict_english.zip. I get "Could not open database."
I am on arch linux, and i built the source from 0.4.7-alpha from the makefile.

Running the program from the command line gives nothing out of the ordinary other than [file] Cannot open file '/home/<name>/.config/memento//input.conf': No such file or directory which makes sense because i never made one, and also "Could not open dictionary database." I'm not sure what could be causing that.

Option to separately (de)select {audio-context}

Currently, selected lines of subtitles can have their text and audio exported to Anki with {context} and {audio-context} respectively. But there are cases where having less audio than text is preferable.

Consider a line at the end of an exchange, whose context is provided by the lines preceding it. If a lot of lines preceding it have to be selected, then {audio-context} exports a long segment of unrelated audio before getting to the vocab itself, which slows down the pacing of reviews. A more ideal option might be to keep the all the text while only exporting the audio of the relevant line (or fewer lines).

I think it could be nice if there is an option to enable a checkbox for each (selected) line in the subtitle list. When the user selects the line, they are checked by default, but the user has the option to uncheck lines to remove them from audio-context.

Search through subtitles

Search for words in the subtitles with a search bar.

For example, if I want to know how many "僕" there are in an episode, I will look it up via the search bar and jump straight to it.

Allow dictionaries whose entries are not added to Anki by default

Seeing that recent commits refactor dictionary related code and add the ability to disable dictionaries, I wonder if it might be an good time to bring this up. Currently, Memento allows individual dictionary lookup results to be optionally toggled off so that they are not added to Anki. It might be nice if in dictionary settings, certain dictionaries can be configured with the checkbox off by default. This applies when:

  • the user has many dictionaries loaded and would like to reference all of them, but only add the top result(s) to Anki
  • the user uses special dictionaries whose results should not be added to Anki. One I know of is [補足] 漢字遣い参考, which only contains different forms of words (押し殺す is listed as おしころす【圧し殺す・押し殺す・押殺す・圧しころす・押しころす】) to address the scenario originally described in #47.

Accept mpv-style subtitle argument from command line

I usually start my video player from the command line. With mpv, i can specify the right subtitle file with --sub-file=<sub-file>. I know i can still add subtitle files in memento, but it takes a few clicks in the gui with every new video file.

It would be nice if memento could also accept --sub-file(https://mpv.io/manual/master/#options-sub-file) where the given subtitle file is appended to the sub list.

This is all i really want, but as a side idea, it could be interesting to use ALL given command line options and pass them along to mpv. This would allow for some pretty powerful usage ideas.

Showing timestamp

add the option to show timestamp on the left subtitles list visibility.
image

Unexpected behaviour while in full screen mode

I've been having an issue since I installed Memento on a new machine a few days ago. Whenever I watch I watch a video and enter full screen mode, the screen will flash black for a second and jump around for a bit and starts behaving erratically. The full screen playback acts as if it is on top of everything else (e.g. the windows popup volume indication when changing system volume is invisible) and if I manually take a screenshot, it will always be from the moment I first entered full screen rather than the frame I took the screenshot of. Similarly, when I start recording my screen when playing a video in windowed mode and switching into full screen, the audio will continue playing normally but the video recording is stuck in the frame when I entered full screen.

I've recorded the following video to demonstrate: First I enter and leave full screen twice to demonstrate the flashes and jumping around, then I watch the same scene in windowed mode and then in full screen mode. For some reason, the full screen playback is a still frame in the recording, even though it displayed fine on my end: https://files.catbox.moe/tzh2xl.mp4

This only occurs in Memento, the latest version of regular mpv work perfectly fine.

Video not showing, just a blank screen.

I initially used the program in another computer since the one I normally use was broken, I had it fixed some days ago and I installed the program in it and installed dictionaries but when I went to play the video it didn't show anything just a blank screen, the audio plays, the subs show but the video doesn't show up:

image

And it happens with every video. When I play the video in mpv it doesn't happen though:

image

I tried reinstalling the program but the same happens.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.