Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization of the video window size when viewing a video card. #39

Open
pyropractic opened this issue Oct 13, 2024 · 2 comments
Open

Comments

@pyropractic
Copy link

Hello, thank you very much for your anki add-on, it helps me a lot when learning languages.
I use your add-on on windows.
I encountered a small problem when using a screenshot (subs2srs - video) of a smaller height than 320 (I tried to make the height 240). The problem is that the size of the mpv video window opens by default with a height of 320. Thus, part of the map is covered by this window and this is a little inconvenient.
If I generate cards without generating mobile cards - then the mvp player window opens by default huge and accordingly covers the entire anki window. After generating mobile cards - the window becomes a stable size with a height of 320 and this is convenient for screenshots of the standard size 320, because I can also see the text of the card face.
How can I change the size of the video window that opens (after generating mobile video cards)?
I would like the size of the video window to be based on the entered screenshot dimensions in the settings when generating cards and I could change this parameter individually depending on the deck. For example, now this is relevant to me because I want to view first the cards with short sentences (with a video height of 320) and then I want to repeat everything at once using longer cards with a smaller video window size (height of 240). Perhaps you can add this in the next update or can help fix this in my case.
This is how it appears at a height of 320.
image
This is what happens if I reduce the height of the screenshot to 240. The screenshot becomes small, but the video window is still the same size.
image
image
Thank you.

@kelciour
Copy link
Owner

kelciour commented Oct 15, 2024

Thank you for the upvote and kind words!

Updating the add-on is of low priority for the time being and I'll return to the issue some time later.

Meanwhile, the default video player size can be set by creating %APPDATA%/mpv/mpv.conf

https://mpv.io/manual/master/#configuration-files

image

Here's how to do it on Windows.

  • Use file explorer to open %APPDATA% i.e. C:\Users<username>\AppData\Roaming
  • Create a new folder with the name mpv
  • Use Sublime Text, Visual Studio Code to open (create) %APPDATA%\mpv\mpv.conf or configure Windows to show file extensions to prevent accidentally creating mpv.conf.txt that won't work.
  • Add the following line(s) to mpv.conf and save it, then click on the replay button in Anki using any card created by the add-on to open the video player and see the result.
autofit=100%x240
geometry=50%:30%
border=no

https://mpv.io/manual/master/#options-autofit
https://mpv.io/manual/master/#options-geometry
https://mpv.io/manual/master/#options-border


The height of the video clips can be changed to 240 in the add-on's config file (Tools > Add-ons > Watch ... > Config) before using Tools > Generate Mobile Cards.

image

@pyropractic
Copy link
Author

Thank you. I fixed it only through configuration and that's what I needed.
Thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants