38 2
Contact Author Sign in to rate

Create subs2srs cards with mpv video player

0.05MB. Updated 2021-07-19.
The author has shared 35 other item(s).

Description

This add-on adds a new option in the Tools menu to open a video file with mpv and create subs2srs-like cards by pressing 'b' key. A few minor bugs is yet to be fixed. Updating the add-on is a low priority at the moment, but if something doesn't work or could be added, just let me know. WHAT IS SUBS2SRS •  subs2srs | Learn Any Language | Wiki •  substudy: A tool for learning languages using TV shows and subtitles •  DJT Quizmaster Anime/Audio Cards Guide KNOWN ALTERNATIVES - animecards - https://www.youtube.com/watch?v=M4t7HYS73ZQ - mpvacious - https://github.com/Ajatt-Tools/mpvacious mpv: The Best Video Player for Language Learning by Matt vs. Japan - https://www.youtube.com/watch?v=bbg6ztWecbU WHAT'S NEW 2020-10-20 Support .ass and .vtt subtitles, in addition to .srt 2020-10-20 The mpv.conf was moved to user_files/mpv.conf 2020-10-20 Basic support for http(s) URLs (YouTube or any other site supported by youtube-dl) Requires youtube-dl to be installed the same way as mpv or ffmpeg. In the add-on's configuration window make sure that "Use mpv?" is checked. To use it, just copy-paste the url instead of selecting a video file. If nothing happens in 5 seconds, it likely means that mpv can't play the url. Try to play it from the terminal with: mpv https://www.youtube.com/watch?v=Z1PCtIaM_GQ 2020-10-21 Add support for mpv 0.30.0 to automatically get the start time and the end time for the current line in the embedded subtitles 2020-10-22 Support opening multiple video files. The video files will be added to the playlist. HOW TO INSTALL MPV The add-on depends on mpv video player - https://mpv.io/ • Windows - The Windows build can be downloaded from https://sourceforge.net/projects/mpv-player-windows/files/64bit/ - Unpack it with WinRar or 7-Zip - https://www.7-zip.org/ - Move it somewhere, e.g. C:\\Program Files\\mpv - Update the PATH environment variable - https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/ or https://streamable.com/2b1l6 - Restart Anki. • Linux Install the latest mpv version from https://mpv.io/installation/, but it might be already installed alongside with Anki. • macOS • - Download mpv from https://laboratory.stolendata.net/~djinn/mpv_osx/ - Unpack it somewhere and drag-and-drop 'mpv.app' folder to 'Applications' folder. - Maybe it'll work. or - Open the Terminal app - Install https://brew.sh/ - Paste brew cask install mpv and press Return to install mpv. HOW TO USE A simple sample deck - https://ankiweb.net/shared/info/1893414250 There's also MIA Jpn DX card template from How to Learn Japanese with Netflix + Anki by Matt vs. Japan. 1. Open the add-on via "Open Video..." option (Ctrl+O) in the Tools menu. 2. Select a note type. 3. Click on the gears icon to select which fields will be populated by the add-on. 4. Select a deck or create a new one. 5. Maybe change other settings. 6. Click on "Go!", open a video file and press 'b' key to create a new Anki card (or press 'w' and 'e' and then 'b'). If you're on Mac and audio encoding isn't working (no audio file appears in the collection.media folder or it'll be 0KB), try to replace mp3 with m4a for File ext: in the add-on settings. ADD-ON SETTINGS DEFAULT FIELDS   "Id"                        | Tangled_(2010)_00.26.43.226-00.26.47.019   "Source"                    | Tangled (2010)   "Time"                      | 00:26:45.395   "Line"                      | I was in a situation, gallivanting through the forest.   "Meaning: line"             | Я попал в переплёт и, пробираясь сквозь чащу...   "Image"                     | <img src="Tangled_(2010)_00.26.45.395.jpg" />   "Audio"                     | [sound:Tangled_(2010)_00.26.43.226-00.26.47.019.m4a] ADDITIONAL FIELDS   "Path"                        | D:\Movies\Tangled (2010).mkv   "Image (with subtitles)"      | <img src="Tangled_(2010)_00.26.45.395_S.jpg" />   "Line: before"                | Gesundheit, here's the deal.   "Line: after"                 | I came across your tower and...   "Meaning: line before"        | Будь здорова. Послушай.   "Meaning: line after"         | Увидел твою башню, а потом...   "Audio (with context)"        | ...   "Video"                       | [sound:Tangled_(2010)_00.26.43.226-00.26.47.019.mp4]   "Video (with context)"        | ...   "Video (HTML5)"               | Tangled_(2010)_00.26.43.226-00.26.47.019.mp4   "Video (HTML5 with context)"  | ...   "Video Subtitles"             | [sound:Tangled_(2010)_00.26.43.226-00.26.47.019.srt] If the field "... (with context)" is selected then audio/video will start at the beginning of the previous line ("Line: before") and ends at the end of the next line ("Line: after"). Video can be saved either in mp4 or webm format. Default fields saves video in mp4 format. To save video in webm format select the same field name but with "[webm]" prefix in it. Probably choose webm if you're on Windows and want to embed video in the card, otherwise choose mp4 format. DEFAULT HOTKEYS  b - create new card  w - set the start time  e - set the end time ctrl + w - replay from the start time  ctrl + e - replay the last ~2 seconds and pause  ctrl + r - reset the start time and the end time If the end time is set, 'ctrl + w' will pause playback after playing from the start time to the end time. Default hotkeys can be changed by editing mpv2anki.lua in the add-on's folder (Anki - Tools - Open Add-ons Folder - ...). Maybe some useful mpv hotkeys:  left and right - seek backward/forward 5 seconds shift + left/right - seek backward/forward 1 second . - step one frame forward , - step one frame backward For more information about default mpv hotkeys please see Interactive Control. USAGE NOTES It might be useful to create mpv.conf with similar default settings - https://gist.github.com/kelciour/c6d4fe4042431052ab35e8137379f91a For more information please see https://mpv.io/manual/master/#configuration-files Alternatively, the same settings can be added to mpv.conf in the add-on's folder, i.e. Anki - Tools - Add-ons - Create subs2srs ... - View Files - mpv.conf The add-on is supposed to be used with external srt subtitles that have the same name as the video file and followed by <language> code from the add-on settings screen. For example, if the video file is "Tangled (2010).mkv" and language code is "en", any of these filenames will work for subtitles: "Tangled (2010).en.srt", "Tangled (2010).eng.srt", "Tangled (2010)_track_5_eng.srt". The add-on can be used with embedded subtitles too, but in this case it can only save current video frame as a screenshot, current subtitle as a text and audio/video clip by specifying the start time and the end time using 'w' and 'e' keys. With mpv 0.30.0 it's possible to get the start time and the end time for embedded subtitles automatically (only the current line). The current synchronization of the foreign and native subtitles is a bit sloppy and sometimes might produce unexpected results. The add-on immediately creates an Anki card after pressing the hotkey button ('b'), but it may take a few seconds to actually generate images, audio or video. Usually, it takes less than a second to export a screenshot and audio clip, but it may take a bit more time for the video clip. If there's an error "object has no attribute '_callbacks'" after opening the video, try closing mpv video player and reopening the video file. If it doesn't generate any cards, try to check the fields' mapping in the add-on's settings. This is the first Anki add-on. The second one is movies2anki - watch foreign language movies with Anki. CREDITS mpv - a free, open source, and cross-platform media player mpv.py - control mpv from Python using JSON IPC, (c) Lars Gustäbel & Damien Elmes. pysubs2 - a Python library for reading .srt and .ass subtitle files CHANGELOG 2018-08-21 The initial release. 2019-01-25 Added a pop-up dialog to select definitions from LDOCE in a non-public version. 2020-01-02 Initial update to Anki 2.1. The add-on for Anki 2.0 has been downloaded ~200 times. 2020-01-20 Fix syntax warning. 2020-03-06 Add macOS support. 2020-03-15 Use FFmpeg for encoding if it can be found 2020-03-15 Possible fix for mpv crash on Mac OS X 10.15 without updating mpv 2020-03-28 Revert to mpv for encoding image with subtitles 2020-04-02 Fix a bug with "Video Subtitles" if there's no "Video" field 2020-04-17 Fix a bug & save the add-on's config between updates 2020-04-27 Fix to find bundled mpv executable on macOS 2020-04-27 Support standalone mpv builds on macOS 2020-04-27 Load mpv user config 2020-07-23 Fix to correctly load subtitles with an empty space at the end of the timestamp 2020-10-10 Two suggestions for mpv2anki (big thanks to Nicholas) 2020-10-10 Fix no subtitles on Anki 2.1.35 2020-10-20 Switch to pysubs2 for reading .srt, .ass and .vtt subtitles 2020-10-20 Support http(s) urls 2020-10-20 If the start time is set, set the end time with the B key 2020-10-20 Use config-dir for mpv.conf and input.conf in the add-on's folder 2020-10-20 Limit youtube-dl to 720 by default 2020-10-21 Revert back using separate config-dir location for mpv as it breaks user scripts - https://www.reddit.com/r/LearnJapanese/comments/ec2ect/mpv_player_config_for_subtitle_navigation/ 2020-10-22 Fix to remember last input directory 2020-10-22 Show warning if no fields were mapped 2020-10-22 Support opening multiple files 2020-10-23 Fix to remove mpv version checking if mpv version is too old to support sub-start and sub-end properties 2020-11-10 Apply sub-delay 2020-11-10 Fix pad-start and pad-end timings not working 2020-11-11 Fix pad-start timing not working as expected 2020-11-11 Replace Go! button with OpenURL and OpenFile buttons (to open URLs on Ubuntu) 2020-11-11 If the start time is set, use the middle point to get the current line with the external subtitles 2020-12-04 Add ADDON_DEBUG env variable to help debug audio encoding on MacOS 2020-12-05 Apply sub-delay to screenshots 2021-04-03 Fix no audio & video for new added cards after adding a card with no visible subs 2021-05-18 Fix no picture with the latest mpv version 2021-07-18 Fix ‘directory’ has unexpected type ‘QUrl’ with Anki 2.1.35 (x86) Nickolay Nonard <kelciour@gmail.com>

Download

As add-ons are programs downloaded from the internet, they are potentially malicious. You should only download add-ons you trust.

Supported Anki versions:

To download this add-on, please copy and paste the following code into Anki 2.1:

1213145732

If you were linked to this page from the internet, please open Anki on your computer, go to the Tools menu and then Add-ons>Browse & Install to paste in the code.

All Anki 2.1.x Add-Ons Contact Author

Reviews

on 1635285141
Thank you so much. Such a great add-on.
If you are on a Mac don't forget to replace mp3 with m4a in "File ext:" and the audio will work!
on 1633690799
THIS IS AMAZING
easy to set up, easy to understand, easy to use, very productive
on 1632360896
awesome!
on 1626214345
Debug info:
Anki 2.1.35 (84dcaa86) Python 3.8.1 Qt 5.12.6 PyQt 5.12.3
Platform: Windows 10
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2021-07-13 13:15:18

Caught exception:
Traceback (most recent call last):
File "C:\Users\Mohammad\AppData\Roaming\Anki2\addons21\1213145732\mpv2anki.py", line 1235, in openVideoWithMPV
fileUrls = getVideoFile()
File "C:\Users\Mohammad\AppData\Roaming\Anki2\addons21\1213145732\mpv2anki.py", line 96, in getVideoFile
urls = QFileDialog.getOpenFileUrls(None, _("Open Video File or URL"), directory=QUrl.fromLocalFile(dirname), filter=key)[0]
TypeError: getOpenFileUrls(parent: QWidget = None, caption: str = '', directory: str = '', filter: str = '', initialFilter: str = '', options: Union[QFileDialog.Options, QFileDialog.Option] = 0, supportedSchemes: Iterable[str] = []): argument 'directory' has unexpected type 'QUrl'
on 1624438770
Can the image quality be adjusted? The video card I added is blurry on macOS.
Comment from author before post was edited
Try updating Anki to 2.1.35 or 2.1.44 to fix the error: no module named 'typing'
on 1619532849
Thanks!!! 🙂
This add-on is very useful for languages one knows quite well and needs to learn new words and expressions only once in a while during watching the episode or movie. For languages which one doesn’t know as well, mass import of automatically generated subtitles→SRS is a better approach, IMHO.

BTW, I opened two issues, requesting new features: https://github.com/kelciour/create-subs2srs-cards-with-mpv-video-player/issues?q=is%3Aissue+author%3Arwmpelstilzchen+
on 1619477880
Why is it taking an entire paragraph per subtitle? Any way to just get a single sentence instead? Or could it be a problem with the subtitles
on 1617750733
Great add on, helps me only add cards to parts of videos I want to save.

edit: The add-on works seamlessly with local files in almost every occasion ... just sometimes I don't know if its parsing the audio/video with the target language subtitle file or the native language subtitle file ... I hope it is target language ... other than this, the add-on is amazing.

I encountered a small problem when accessing online videos ... the card is generated immediately, but some audio/video files are not generated for some reason ... the card is there ... but the audio or the video file is not added to ANKI's media folder.

edit: thank you very much for the quick and informative reply. As for the first part: I was watching a German series with subtitles in German and choosing my target language as German and my native as English. In some scenes [happened once or twice per episode] it would over flow [generate a video that is a minute and a half instead of just 5 seconds] or cramp together 10 German lines in the "Line" field and one line in the "Line:Meaning" field. I tired to use the "w" and "e" in this case [wasn't able to generate cards using start and end [maybe I don't know the shortcuts by heart yet]] and tried reversing the target and native languages ... but I wasn't able to get it exactly ... at the end I thought to myself it wasn't so much occurring that I ignored it

as for the second part, I guess it might be heck up in the to-do list as well ... as some card generated half the sentence in audio and video [cuts all of a sudden in the middle] and some cards have only audio, and some cards don't have at all ... if it helps [I reviewed the cards by the order I added them, it was going ok with generated audio and sound files and at some point the new cards [from a later point from the video] didn't have audio and video files anymore] ... I checked, the card have successfully generated lines for the audio and video ... but the ANKI media file doesn't have the files themselves ... they are not generated ...

** I hope you find the time to take a look at this online part of the add-on soon ... it is a super wonderful add-on ... and I am so looking forward to having it work seamlessly with online videos, same as local files ... IT IS AWESOME ... I really can't thank you enough for the great work ... KEEP IT UP
Comment from author before post was edited
Thank you very much for the feedback!

About the native language subtitle file, I'd need a little bit more info what happens.

About audio/video files, they're generated in the background and might take a few seconds, especially for online videos, but nothing was done to check for errors. It's on to-do list. Maybe, at first, edit a card to see if the field contains [sound:...] or not.
If the field is empty, it should be fixed now as the add-on was updated a few days ago to make sure it won't happen again, but maybe there's another bug somewhere.
If the field is not empty but no audio/video file could be found in the collection.media folder (Tools > Check Media reports it as missing), something might have happened during encoding and at the moment I don't have any ideas why it would work one time but won't work another time.
For now, it'd be probably better to use youtube-dl to download it locally and use the add-on with local videos. I'll try to add some kind of check for encoding errors, but I'm not sure when I'll have time for it, maybe over the weekend, but not 100% sure.
on 1617634036
Best and simple sentence mining extension !
on 1617583493
I'm on a Mac and the cards can be added without problems but the audio file does not appear in the media folder. Is there a way to diagnose it? I installed mpv and ffmpeg through brew.
----------
Thank you very much for the reply. It's now working well if I change the extension to m4a or untick "use MPV".
I also managed to grab the command that's been sent to mpv and I can reproduce the issue without Anki.
When outputting mp3, mpv puts this line in the log: "[cplayer] Disabling audio (not supported by target format).". But if it's m4a, it works well.
Comment from author before post was edited
Changing "File ext:" in the add-on settings from "mp3" to "m4a" should help.

Alternatively, unchecking "Use MPV?" in the add-on settings (to use ffmpeg for encoding) should help too (for local video files).

Otherwise, something like this could be done to try to reproduce the issue without Anki, but it probably won't be enough and I don't know what else could be done or maybe it's not something that can be easily fixed.

https://gist.github.com/kelciour/44c441949eecaabd13b59adf31c3a847
on 1616201813
Thanks
on 1614160740
Great Add on! Can I change the create card hotkey from "b" to mouse middle button?
on 1611104341
Thank you for the great add-on! Everything works like a charm, but unfortunately I keep having trouble with the audio clips.
I'm a Mac user, have the latest Anki (2.1.35), latest add-on version and latest MPV (downloaded with brew). I've also downloaded the sample deck. When I try to add a card the "Audio" field has an entry but no new clip shows up in the collection.media folder so no sound comes out of the card. I was having the same problem with Mpvacious. Please let me know if there's a way I can fix this. Thank you for all your work!!

---
EDIT
Thank you to the author for swiftly troubleshooting this, and just sharing this here for anyone who might be having the same problem: simply change "File ext:" in the add-on settings from "mp3" to "m4a".
on 1607169815
5 Dec 2020: I appreciate your response. But, unfortunately, ONLY HALF PART HAS BEEN FIXED. Here is the screenshot: https://tinyurl.com/y2uqmefb .On the right side, you are seeing the mpv player. On the left side, the Subs2srs Card is being shown. As you can see, the subtitle IMPOSED on the image ["Image (with subtitles)" field] is NOT MATCHING with the mpv's subtitle shown on the right side. While the subtitle text ["Line" field] is CORRECTLY MATCHING. I can live with the fixed part. So THANKS and THUMBS UP in the end.
----

The 10 Nov release says "apply sub delay". But still, it does not work.


Edit: Thank you for great add-on. Unfortunately, it DOES NOT HONOUR SUBTITLE DELAY i.e. it still saves original subtitles instead of shifted subtitles.


Thanks again. THE ERROR HAS BEEN FIXED.

EDIT: recently found another problem IN LINUX: IT DOES NOT LOAD THE FILE ~/.config/mpv/input.conf. When I play videos directly from the MPV (without Anki), the file is loaded. Now I cannot use my own shortcuts.

EDIT: THE ADD ON IS WORKING FINE ON LINUX AS WELL. The author was super-responsive. (S)He updated the add-on the very next day. Thanks Again.

First of all, I want to give THUMBS UP for Windows-Version. This add-on just automated most of my work.

THUMBS DOWN is only to get your attention for LINUX. I updated my mpv player. But It is NOT SHOWING SUBTITLES ON IMAGES DESPITE CHOSING the"Image (with subtitles)" option. The SCREENSHOT RESOLUTION IS ALSO NOT WORKING. It has not any effect on the screenshot resolution.

Thanks again for your kind and great work and please improve this for linux.
Comment from author
Update 2020-12-05. Thank you. It's been fixed.
-------
Update 2020-12-04. The sub delay should be fixed now.
-------
I'm not sure, but it's working fine for me. I used Aegisub to add -5 seconds to external srt subtitles to make them out of sync, then open the video file with the add-on and used z, Z or x keys to add 5 seconds delay and sync subtitles with the video file, and pressed b to create a new card.

Ah, I think, I get it. Yes, saving subtitles using "Video Subtitles" will not work. I forgot about it. I'll try to fix it in a few days.
on 1606830691
Hello. Thank you all the time.
I recently tried to create a card with a new example video.
The video is good
The audio doesn't seem to be extracted normally.
Please check.
* about audio problem mpvplayer addons doesn't work either
Comment from author
If there's no sound, you're on Windows and only installed the add-on, try to download mpv, add it to the PATH environment variable and restart Anki. Apparenly, the add-on doesn't work with mpv 0.27 that is packaged with Anki. I'll try to update the add-on this week to fix it.

If it's something else, could you elaborate a little bit or maybe upload your video file, e.g. at https://gofile.io or https://send.vis.ee/, and send me a link either here or by email kelciour@gmail and I'll try to reproduce the issue.
on 1604518744
Still figuring this all out but is it true if I say that you HAVE to manually set a start and end time for your clip? It doesn't copy the start and end of the specific subtitle at that moment?
Comment from author
If the video file contains external or embedded subtitles (with mpv 0.30+), the add-on will be able to automatically get the start and end of the current subtitle, i.e. usually pressing the 'b' key should be enough to create a card with the current subtitle.
on 1603404049
Doesn't work after last update...
Debug info:
Anki 2.1.22 (0ecc189a) Python 3.8.1 Qt 5.14.1 PyQt 5.14.1
Platform: Linux
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2020-10-22 13:32:27
アドオンが関連している可能性があります:⁨Create subs2srs cards with mpv video player⁩

Caught exception:
Traceback (most recent call last):
File "/home/user/.local/share/Anki2/addons21/1213145732/mpv2anki.py", line 1307, in openVideoWithMPV
AnkiHelper(executable, popenEnv, fileUrls, configManager)
File "/home/user/.local/share/Anki2/addons21/1213145732/mpv2anki.py", line 579, in __init__
self.mpvManager = MPVMonitor(executable, popenEnv, fileUrls, self.mpvConf, self.msgHandler, self.subsManager)
File "/home/user/.local/share/Anki2/addons21/1213145732/mpv2anki.py", line 510, in __init__
assert m, self.version
AssertionError: mpv git-2020-04-17-a09c769
Comment from author
Thank you for the upvote and notifying me about the issue. Please update the add-on. It should be fixed now.
on 1603208946
Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.26 (70784154) Python 3.8.0 Qt 5.14.1 PyQt 5.14.1
Platform: Windows 10
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-10-20 22:31:50

Caught exception:
Traceback (most recent call last):
File "C:\Users\MatthewBui\AppData\Roaming\Anki2\addons21\1213145732\mpv2anki.py", line 1272, in openVideoWithMPV
AnkiHelper(executable, popenEnv, filePath, is_local_file, configManager, subsManager)
File "C:\Users\MatthewBui\AppData\Roaming\Anki2\addons21\1213145732\mpv2anki.py", line 567, in __init__
self.mpvManager = MPVMonitor(executable, popenEnv, filePath, self.mpvConf, self.msgHandler, self.subsManager)
File "C:\Users\MatthewBui\AppData\Roaming\Anki2\addons21\1213145732\mpv2anki.py", line 502, in __init__
super().__init__(window_id=None, debug=False)
File "C:\Users\MatthewBui\AppData\Roaming\Anki2\addons21\1213145732\vendor\mpv.py", line 444, in __init__
self._register_callbacks()
File "C:\Users\MatthewBui\AppData\Roaming\Anki2\addons21\1213145732\vendor\mpv.py", line 477, in _register_callbacks
self._handle_event(message)
File "C:\Users\MatthewBui\AppData\Roaming\Anki2\addons21\1213145732\vendor\mpv.py", line 521, in _handle_event
callback(message["data"])
File "C:\Users\MatthewBui\AppData\Roaming\Anki2\addons21\1213145732\mpv2anki.py", line 548, in on_property_idle_active
if value and self.can_be_closed:
AttributeError: 'MPVMonitor' object has no attribute 'can_be_closed'
Comment from author
Try the updated version. Use Tools - Add-ons - Check for Updates and restart Anki.
on 1602593719
It is a excellent addon.
Thanks for this but I get this error:

Anki 2.1.33 (3f403040) Python 3.8.0 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.14.6
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-10-13 19:24:34
可能涉及的附加元件:⁨Watch Foreign Language Movies with Anki⁩

Caught exception:
Traceback (most recent call last):
File "/Users/yvonya/Library/Application Support/Anki2/addons21/939347702/movies2anki.py", line 1524, in preview
self.model.create_subtitles()
File "/Users/yvonya/Library/Application Support/Anki2/addons21/939347702/movies2anki.py", line 946, in create_subtitles
self.en_subs_sentences = convert_into_sentences(en_subs, self.phrases_duration_limit, self.join_lines_that_end_with, self.join_questions_with_answers, self.join_sentences_separator, self.join_lines_separator, self.is_gap_phrases)
File "/Users/yvonya/Library/Application Support/Anki2/addons21/939347702/movies2anki.py", line 327, in convert_into_sentences
if (sub_content[0].isalpha() and sub_content[0].islower()) or re.search(regex + r"$", prev_sub_content):
IndexError: string index out of range
Comment from author
Thank you for the feedback. I updated movies2anki and the error should be fixed now.
on 1602525941
Is there any way to open a network stream link?
Comment from author
Thank you for the question and the upvote.

It should be possible now. It requires youtube-dl to be installed the same way as mpv or ffmpeg. Instead of opening a video file, just copy-paste the url.

There's no error handling at the moment and if nothing happens in 3-5 seconds it likely means that mpv can't play it. Running mpv <url> in the terminal should give the error message.
on 1602216204
Good, add-on but for some reason audio and video don't work even after having installed ffmpeg and putting the directory in the Environment Variables.

If this add-on worked it would save me so much time so I really appreciate it.
Comment from author
I guess, the fields were mapped, i.e. after opening the add-on's window you clicked on the gear icon and selected audio or video, e.g. Front - Image and Back - Video.

FFmpeg installation can be checked with the Debug Console - https://docs.ankiweb.net/#/misc?id=debug-console

from distutils.spawn import find_executable
print(find_executable("ffmpeg"))

The output should be something like C:\Programs\ffmpeg\bin\ffmpeg.exe, but not None.

The add-on should work fine without FFmpeg and I suggest to try without it by temporarily renaming "ffmpeg" folder, e.g. "_ffmpeg". The add-on will use mpv for video and audio encoding. Some recent mpv versions had some issues with encoding, but the latest mpv version seems to work fine.

Maybe temporarily rename "mpv" folder, e.g. "_mpv", and just install the latest Anki version (2.1.35). It can be installed in a different folder. This version ships with mpv and the add-on should work fine out-of-the-box.

If it won't work, I'll think up of something.
on 1601082821
perfect, but is there any way for the window not to always be on top? (shift+t fixes it i think but it would be nice if --ontop wasnt true by default)
Comment from author
It's set by Anki. To change it, Tools - Add-ons - Create subs2srs ... - View Files - open mpv.conf in the text editor and add a new line with "ontop=no". There's no need to restart Anki.

I'll include it by default in the next update, maybe next month.
on 1599401291
hola que tal pude hacer el proceso pero npo entendi como hago que se haga mpv o como se le agrega a sub2rs es al momento de importar o al momento de que estoy en sub2srs por favor ayuda no se que hacer
on 1595347673
The add-on is working fine, but I have troubles with audio. When making a card, I can see the name of the audio file imported, but there there is no sound. I found the audio files in the anki media folder but all of them appear to be corrupted. Latest mpv version installed, srt files are properly renamed and placed in the same folder as the video. Hope it can be fixed! Thanks for a great add-on anyway!
Comment from author
Please install FFmpeg the same way as mpv, restart Anki and give it a try. If it won't work, please try with a different video file or maybe upload it somewhere and send me a link by email.

If you on Mac and didn't install mpv via brew, try to do it first. Maybe it'll make a difference.

- On Windows it can be downloaded from https://ffmpeg.zeranoe.com/builds/ and the Path environment variable is needed to be updated with the path to the folder that contains ffmpeg.exe, i.e. C:\...\ffmpeg\bin
- On macOS it can be installed using brew - https://trac.ffmpeg.org/wiki/CompilationGuide/macOS#ffmpegthroughHomebrew, i.e. install "brew" and then run "brew install ffmpeg".
on 1594908057
Fantastic! I use a Mac (installed mpv player via the Brew instructions) and it works great. Just make sure:
1. Your video file and subtitle file are named exactly the same, and are in the same folder.
2. Your subtitles are .srt (you can convert them if you're not). If you use .ass, the add-on will grab the image and subtitle text but won't grab the sound.

The normal subs2srs program doesn't work on a Mac even with Wine, and the videos I watch aren't on Youtube so I don't use Youtube Subs2srs. This addon is a lifesaver!
on 1594905332
Really great add-on, help me a lot, but how can i play playlist or multiple videos with this?
Comment from author
Thank you for the suggestion. I finally got around to add it and now it should be possible to select a few video files in the open file dialog.
on 1594812874
For some reason there is no audio or video in the cards (I tried both), but the snapshots and lines work fine, so thank you!
Comment from author
It looks like you're using embedded subtitles (maybe in mkv) and the add-on can only extract text or snapshot but no audio or video.

If you have external .srt subtitles with the same filename lying around in the same folder, it should be possible to extract audio or video too.

I'll try to double check it maybe over the weekend and probably update the add-on to make it possible to extract audio or video using timestamps from the embedded subtitles.
on 1589642952
Great add-on! the only thing that doesn't quite work is the image thumbnail,
it seems that no matter what value I enter it sends the full screen 1080p image
to the image field.
I like that this supports linux as well!
on 1587844056
Really cool add-on. I was looking this something like this a long time.
on 1585511161
Fantastic add-on, once set up it's really smooth to use
on 1583162908
Видео создается без звука, как решить проблему? Спасибо отличная идея, очень давно искал подобное)
on 1579612173
Thank you so much.This is one of the best Anki add-on I've ever used.Keep up your good work.
on 1575568315
Great addon, especially convenient for other forms of video like math lectures.

However, is it possible to port this to Anki 2.1 before the whole thing is sunsetted in January?
Comment from author
I've updated the add-on to Anki 2.1. Please let me know if there're any problems. Thank you!
---
Thank you. That's really nice to know.

Maybe. It's at the top of my to-do list, but I don't know. I'm too busy this week and I'm not sure about next week either. It shouldn't take much time, maybe a couple of hours or a bit more or less, but as for now I don't know when I'll be interested and have enough time to do it. But it'll definitely happen sooner than later.
on 1565855472
Does it differ from subs2srs, aside from being an internal add-on?
Comment from author
The add-on doesn't automatically create all cards in a batch like subs2srs. The add-on can only be used to create one card at a time. The add-on can be used without subtitles by manually specifying the start and end timings.

There's another add-on for Anki 2.0 that can create all cards in a batch like subs2srs - https://ankiweb.net/shared/info/939347702
on 1554705445
Thank you so much man, this is super useful!
on 1554110098
Hi, Please update add-in, for support Anki last version.
Comment from author
Thank you for the upvote! It's been finally updated to Anki 2.1. Please let me know if there're any problems.
on 1548334883
Grat addon!
on 1545868808
Спасибо большое )
буду сравнивать с subs2srs для ПК и решать что буду использовать, огромное спасибо !!!!
on 1543635081
How to add PATH environment variable on windows ?
Comment from author
Please, see this video - https://streamable.com/2b1l6
on 1534989304
I'm having issues getting the audio to extract but this is fantastic aside from that.