89 7
Contact Author Sign in to rate

Watch Foreign Language Movies with Anki

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

Description

This add-on is a very rough and basic adaptation of movies2anki with some new options and experimental shortcuts and something may not work as expected. It was inspired by subs2srs. It's been tested on Windows and Ubuntu. It should work on macOS too after installing mpv and FFmpeg via brew, but maybe there're some issues that I'm not aware of. SUBS2SRS - http://subs2srs.sourceforge.net/ — subs2srs allows you to create import files for Anki or other Spaced Repetition Systems (SRS) based on your favorite foreign language movies and TV shows to aid in the language learning process. - http://www.randomhacks.net/substudy/ — substudy: A tool for learning languages using TV shows and subtitles HOW TO INSTALL 1. Install the add-on. 2. Install FFmpeg from http://ffmpeg.org. - On Windows it can be downloaded from https://www.gyan.dev/ffmpeg/builds/ - 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". 3. Download mpv videoplayer from https://mpv.io - For Windows, use https://sourceforge.net/projects/mpv-player-windows/files then click on "stable" or "64bit/32bit" subfolder and download mpv from there. - For Linux, mpv might be already installed alongside with Anki sometime ago. - For macOS, mpv can be installed via brew either by using "brew cask install mpv" to quickly install the latest binary version or "brew install mpv" to compile and install mpv from source. 4. For Windows, update the PATH environment variable in the User or System variables by adding folders that contain mpv.exe and ffmpeg.exe. Here's a short guide how to update the PATH environment variable on Windows 10 - https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/ - or a quick screencast - https://streamable.com/2b1l6 5. Restart Anki. Another possible and maybe more simple method to install mpv and FFmpeg on Windows without manually updating the PATH environment variable is to use https://chocolatey.org HOW TO USE 1. Tools - Generate Video Cards... (Ctrl+M) 2. Select Video and Subs 1. 3. Change some options. 4. Click on Preview to see how many cards will be created. 5. Select Deck and Model. 6. Click Go! HOW TO REVIEW ON MOBILE 1. Tools - Generate Mobile Cards... 2. Export an apkg file or sync with AnkiWeb. YOUTUBE This is how it may look in action using movies2anki card template. This is how it may look in action using movies2anki (subs2srs - video) card template. DEMO DECK https://mega.nz/#F!31dGQCyL!IpdQ5u15S_kdsWR6mbti7w CONFIGURATION If the video file contains multiple audio streams, it might be useful to create mpv.conf with alang=eng to select the English audio track by default. For example, mpv.conf can look like this: sub-visibility=no sub-auto=fuzzy slang=eng alang=eng audio-file-auto=fuzzy save-position-on-quit=yes autofit-larger=100%x100% geometry=50%:50% It can be downloaded from this link - https://gist.github.com/kelciour/dbb573812e9a45eaa7d5b123f1ccf822 - For Windows, mpv.conf can be added to the same folder as mpv.exe or %APPDATA%/mpv/mpv.conf, i.e. C:\Users\USERNAME\AppData\Roaming\mpv\mpv.conf - For macOS & Linux, it'd be ~/.config/mpv/mpv.conf All the options can be found in the mpv manual - https://mpv.io/manual/master/#configuration-files | https://mpv.io/manual/master/#options ADDITIONAL INFORMATION The add-on doesn't generate any audio/video files by default. Instead it can play a part of the original video/audio file with mpv video player using --start and --end options. If the original video/audio file has been deleted or moved to a different folder, the add-on will try to find and play video/audio from the collection.media folder that were generated using Tools - Generate Mobile Cards option. By default, new cards will be added to the deck with the name of the video file. It can be changed by selecting a deck from the list of existing decks or by typing a different name for the deck. Set "Gap between Phrases" option to 0.0 to split subtitles by sentences or disable it to prevent joining subtitles into sentences. The add-on contains 4 default note types: • movies2anki (add-on) – Video + Audio • movies2anki (subs2srs) – Picture + Audio • movies2anki (subs2srs - video) – Video + Audio (desktop) / HTML5 Video + Audio (mobile) • movies2anki (subs2srs - audio) – Audio In the "movies2anki (subs2srs - video)" card template there's no replay button for video. It can be replayed by clicking on any part of the screen. BATCH PROCESSING Replace some characters in the video and subtitles filename with * or ?. DEFAULT HOTKEYS R – replay Ctrl+R – replay video Shift+R - continuous (i.e. without end) video playback. [ - replay the previous card and the current card. ] - replay the current card and the next card. Shift+[ - join the current card with the previous card (and remove the previous card). Shift+] - join the current card with the next card (and remove the next card). , – subtract 0.25 ms. from the start time . – add 0.25 ms. to the start time < (Shift+,) – subtract 0.25 ms. from the end time > (Shift+.) – add 0.25 ms. to the end time Ctrl+Shift+, – set the start time to default Ctrl+Shift+. – set the end time to default ANKIMOBILE https://gist.githubusercontent.com/kelciour/d574a97f8727d207932452b13476396f/raw/4e881fbf707ba8ae118180818515c871a906b12d/movies2anki-ankimobile-question Update. Thanks to Mike, it looks like "movies2anki (subs2srs - video)" works fine on AnkiMobile and "movies2anki (add-on)" has an echo sound on the back side of the card. As a workaround, it can be fixed either by using <video ...></video> similar to "movies2anki (subs2srs - video)" instead of {{FrontSide}} or by removing [sound:{{Audio}}] from the back side of the card. For some reason, HTML5 Audio doesn't seem to work on AnkiMobile and can't be used as a possible alternative. EXPORT CONDENSED AUDIO Open the card browser, select a few cards that were generated by the add-on and click Edit - Export Condensed Audio. The cards with the same Path field will be joined into a single audio file. The "Store temporary audio files in the collection.media folder" option makes sense to check if you intend to later use, or maybe already used, Tools - Generate Mobile Cards to review cards on mobile. With the full movies or series, maybe try it in a new Anki profile (File - Switch Profile) by generating a new deck of cards with "Gap between Phrases" set to 1.25 or 1.75 and "Pad Timings" set to 750ms or something similar. For more information, see "Optimizing Passive Immersion: Condensed Audio" by Matt vs. Japan - https://youtu.be/QOLTeO-uCYU - and also "Online Directory Of Condensed Shows for Passive Listening" by No_Swing_6301 - https://www.reddit.com/r/MassImmersionApproach/comments/k2yflx/online_directory_of_condensed_shows_for_passive/ CHANGELOG 2018-08-11 Initial release. 2018 – 2020 https://gist.github.com/kelciour/caa2e035565d2c8609af915fb07d1336 2021-04-19 Add /opt/homebrew/bin for Apple Silicon 2021-04-24 Raise exception if returncode is not zero 2021-05-13 Fix progress bar stops at 0% 2021-05-14 Add logging to debug "progress bar stops at 0%" 2021-05-14 If mpv fails after 5 seconds, try to select last audio stream with ffprobe 2021-05-19 Sort subtitles time-wise 2021-05-23 Add config option to save video clips as webm 2021-06-30 Fix split_long_phrases IndexError: list index out of range NOT IMPLEMENTED The add-on doesn't work in the Preview window. ADDITIONAL INFORMATION This is the second Anki add-on. The first one is mpv2anki – create subs2srs cards with video player. Nickolay <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:

939347702

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 1635997272
Recently I had a problem with this add-on, but, it used to work normally

Error
Se ha producido un error. Por favor inicia la Anki manteniendo presionadas ples teclas Mayús y la flecha hacia abajo, lo que desactivará temporalmente los extensiones que tienes instaladas.
Si este error persiste sólo cuando tienes las extensiones activadas, utiliza Herramientas > Menú de Extensiones para deshabilitar alguna extensión y reinicia el Anki, repitiendo este proceso hasta que descubras qué extensión en concreto es la que causa el problema
Cuando hayas descubierto la extensión que causaba el problema, por favor informa de esto a [sitio de soporte de extensiones](https://help.ankiweb.net/discussions/add-ons/).
Información de depuración:
Anki 2.1.49 (dc80804a) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 7
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-11-02 22:53:27

Caught exception:
Traceback (most recent call last):
File "C:\Users\Usuario\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 1571, in start
self.startSingleMode()
File "C:\Users\Usuario\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 1684, in startSingleMode
self.model.create_subtitles()
File "C:\Users\Usuario\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 961, in create_subtitles
en_subs = self.load_subtitle(self.en_srt, self.is_ignore_sdh_subtitle, self.join_lines_separator, self.join_sentences_separator, self.is_gap_phrases)
File "C:\Users\Usuario\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 734, in load_subtitle
subs = pysubs2.load(filename, encoding=enc)
File "C:\Users\Usuario\AppData\Roaming\Anki2\addons21\939347702\vendor\pysubs2\ssafile.py", line 100, in load
return cls.from_file(fp, format_, fps=fps, **kwargs)
File "C:\Users\Usuario\AppData\Roaming\Anki2\addons21\939347702\vendor\pysubs2\ssafile.py", line 153, in from_file
format_ = autodetect_format(fragment)
File "C:\Users\Usuario\AppData\Roaming\Anki2\addons21\939347702\vendor\pysubs2\formats.py", line 67, in autodetect_format
raise FormatAutodetectionError("No suitable formats")
pysubs2.exceptions.FormatAutodetectionError: No suitable formats
Comment from author
The subtitle file isn't valid .srt, .ass or .vtt file and the add-on can't read it. Either try to use Subtitle Edit or Aegisub to convert it to .srt or .ass format, maybe they'll be able to read it just fine. Otherwise, use a different subtitle file.
on 1635166537
have some error!!!!plz take a look
######
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.48 (fb07bad3) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.16
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-10-25 20:38:53
Add-ons possibly involved: ⁨Watch Foreign Language Movies with Anki⁩

Exception in thread Thread-3:
Traceback (most recent call last):
File "threading.py", line 932, in _bootstrap_inner
File "threading.py", line 870, in run
File "aqt/mpv.py", line 506, in _event_reader
File "aqt/mpv.py", line 521, in _handle_event
File "aqt/sound.py", line 420, in on_property_idle_active
File "aqt/sound.py", line 196, in _on_play_finished
File "aqt/sound.py", line 204, in _play_next_if_idle
File "/Users/taiyangxiang/Library/Application Support/Anki2/addons21/939347702/player.py", line 271, in queueExternalAV
if mw.state == "review" and mw.reviewer.card != None and (mw.reviewer.card.model()["name"] == "movies2anki (add-on)" or mw.reviewer.card.model()["name"].startswith("movies2anki - subs2srs")):
AttributeError: 'NoneType' object has no attribute 'model'
Exception in threading.excepthook:
Exception ignored in thread started by: <bound method Thread._bootstrap of <Thread(Thread-3, started daemon 123145468379136)>>
Traceback (most recent call last):
File "threading.py", line 890, in _bootstrap
File "threading.py", line 934, in _bootstrap_inner
File "threading.py", line 1212, in invoke_excepthook
AttributeError: 'ErrorHandler' object has no attribute 'flush'
Exception ignored in sys.unraisablehook: <built-in function unraisablehook>
AttributeError: 'ErrorHandler' object has no attribute 'flush'
Comment from author
Thank you! But I'm actually surprised by this error message. The code seems to contain all necessary checks to make sure that this error won't never happen.

If it happens again, please let me know, it'll take some time but I'll try to change the code and update the add-on.

As a possible workaround, only use the add-on to generate cards with media. To disable the add-on during review, at first use Tools > Generate Mobile Cards, then either disable the addon and restart Anki or create a copy of the existing note type with a different name (not movies2anki) and from the browser change the note type for all movies2anki cards.
on 1635000768
Hello! Got this error while creating mobile cards. Is there any solution?

Caught exception:
Traceback (most recent call last):
File "C:\Users\VAK96\AppData\Roaming\Anki2\addons21\939347702\player.py", line 678, in run
raise CalledProcessError(retcode, cmd_debug)
subprocess.CalledProcessError: Command '['"C:\\Program Files\\ffmpeg\\bin\\ffmpeg.exe" "-y" "-ss" "0:04:54.823" "-i" "D:/Vuze Download/Westworld.2016.S02.1080p.AMZN.WEB-DL.H264/Westworld.S02E06.1080p.AMZN.WEB-DL.H264.RUS.SRT.mkv" "-t" "2.030" "-af" "afade=t=in:st=0.000:d=0.250,afade=t=out:st=1.780:d=0.250" "-map" "0:v:0" "-map" "0:a:1" "-ac" "2" "-vf" "scale=-2:320" "Westworld.S02E06.1080p.AMZN.WEB-DL.H264.RUS.SRT_0.04.54.823-0.04.56.853"']' returned non-zero exit status 1.
Comment from author
This is likely because the "Video" field doesn't end with ".mp4" or ".webm". If you copy the command to the Windows Command Prompt (cmd), i.e. everything between square brackets except single quotes, e.g. "C:\\Program Files\\ffmpeg\\bin\\ffmpeg.exe" ... 4.56.853", the output probably will be something like:

> Unable to find a suitable output format for '...'

Possible options:

1. If it's a new deck, remove it or use a new Anki profile, then use the add-on to generate a new deck of cards and run Tools > Generate Mobile Cards.
2. Otherwise, use Find-Replace from the browser to add .mp4 to the Video field.

Find: $
Replace: .mp4
Use regular expressions: yes
on 1634401793
Dear Nickolay,
I encountered this error and I don't know how to solve it. Could you please give me some hint?

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.48 (fb07bad3) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.15.5
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-10-17 00:04:28

Caught exception:
Traceback (most recent call last):
File "aqt/webview.py", line 541, in handler
File "aqt/reviewer.py", line 704, in _onTypedAnswer
File "aqt/reviewer.py", line 383, in _showAnswer
File "aqt/reviewer.py", line 759, in _showEaseButtons
File "aqt/reviewer.py", line 846, in _answerButtons
File "aqt/reviewer.py", line 832, in but
File "decorator.py", line 232, in fun
File "anki/hooks.py", line 89, in decorator_wrapper
File "anki/hooks.py", line 86, in repl
TypeError: buttonTime() got multiple values for argument '_old'
Comment from author
It looks like another add-on that modify review buttons. Either use Tools > Add-ons > Check for Updates to check for any add-on's updates if you just updated Anki, use Help > About > Copy Debug Info to get "===IDs of active AnkiWeb add-ons===" and copy it here so I could try to install them and reproduce the issue or try to disable any addons that modify review buttons and restart Anki. By searching for "buttonTime" on GitHub, it could be "Incremental Reading" - https://ankiweb.net/shared/info/935264945 - and after installing it I received the same error message. Take a look at Searching, PDF Reading & Note-Taking in Add Dialog - https://ankiweb.net/shared/info/1781298089 | https://www.youtube.com/watch?v=ymI_o_zxxZw (The AnKing Tutorial)
on 1634034368
The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\Lenovo\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 1571, in start
self.startSingleMode()
File "C:\Users\Lenovo\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 1708, in startSingleMode
self.model.create_tsv_file()
File "C:\Users\Lenovo\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 1027, in create_tsv_file
self.ffmpeg_split_timestamps.append(self.write_tsv_file(self.deck_name, self.en_subs_phrases, self.ru_subs_phrases, self.output_directory))
File "C:\Users\Lenovo\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 873, in write_tsv_file
note["Source"] = os.path.splitext(os.path.basename(self.video_file))[0]
File "anki\notes.py", line 158, in __setitem__
File "anki\notes.py", line 152, in _field_index
KeyError: 'Source
Comment from author
The 'Source' field is needed for the add-on to work properly. A simple workaround is to remove the existing movies2anki note type (Tools > Manage Note Types) and use the add-on to make a new deck of cards.
on 1632388586
Hi, thanks for creating this useful and amazing addon. But I got an error when start creating cards.

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.47 (dc156f34) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-09-23 14:40:29

Caught exception:
Traceback (most recent call last):
File "F:\AnkiDataLocation\AnkiStorage2.1.47\addons21\939347702\movies2anki.py", line 1175, in run
call(cmd)
File "anki\utils.py", line 278, in call
File "subprocess.py", line 854, in __init__
File "subprocess.py", line 1247, in _execute_child
File "subprocess.py", line 549, in list2cmdline
File "os.py", line 818, in fsdecode
TypeError: expected str, bytes or os.PathLike object, not NoneType.

I found someone also encounter this error and you said that ffmpeg didn't configure in Environment Path by typing ffmpeg in CMD. But I checked in CMD and it had been success.
Please help me fig this bug. Thanks.
Comment from author
Try to restart Anki.

If you use the debug console with this code - https://docs.ankiweb.net/misc.html#debug-console

print(sys.modules["939347702"].movies2anki.ffmpeg_executable)
from distutils.spawn import find_executable
ffmpeg_executable = find_executable("ffmpeg")
print(ffmpeg_executable)

the output should be something like

C:\Programs\ffmpeg\bin\ffmpeg.exe
C:\Programs\ffmpeg\bin\ffmpeg.exe

https://i.imgur.com/yZN4lTJ.png
on 1632083596
Hi, thank you for this add on, but the 'generate mobile cards' doesnt work for me. Can you help me out?

-------------
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.46 (94913ec2) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-09-19 15:29:25

Caught exception:
Traceback (most recent call last):
File "C:\Users\tu\AppData\Roaming\Anki2\addons21\939347702\player.py", line 543, in run
time_start, time_end = re.match(r"^.*?_(\d+\.\d\d\.\d\d\.\d+)-(\d+\.\d\d\.\d\d\.\d+).*$", fld).groups()
AttributeError: 'NoneType' object has no attribute 'groups'
Comment from author
It looks like the Audio field was modified in some way and the add-on can't extract the start timing and the end timing from the Audio field.

- If it's a new deck, remove this deck and use the add-on to generate a new deck or try in a new Anki profile.
- If it's not a new deck, maybe use Advanced Copy Fields - https://ankiweb.net/shared/info/1898445115 - to overwrite the Audio field by copying the Id field and adding '.mp3'. For example,

Id: Video_0.00.30.114-0.00.39.539
Audio: Video_0.00.30.114-0.00.39.539.mp3

Or maybe if it's just a few notes, maybe fix them manually in the card browser using this search string to find broken notes.

Audio:_* -"Audio:re:^.*?_(\d+\.\d\d\.\d\d\.\d+)-(\d+\.\d\d\.\d\d\.\d+).*$"
on 1631500773
This add on is sooooo great, but recently i have faced to this problem and i cannot study as normal =(((( please help me i rlly need this addon huhu

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.45 (355e66e8) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-09-12 17:27:45

Caught exception:
Traceback (most recent call last):
File "C:\Users\Thanh Tra\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 1571, in start
self.startSingleMode()
File "C:\Users\Thanh Tra\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 1684, in startSingleMode
self.model.create_subtitles()
File "C:\Users\Thanh Tra\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 961, in create_subtitles
en_subs = self.load_subtitle(self.en_srt, self.is_ignore_sdh_subtitle, self.join_lines_separator, self.join_sentences_separator, self.is_gap_phrases)
File "C:\Users\Thanh Tra\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 734, in load_subtitle
subs = pysubs2.load(filename, encoding=enc)
File "C:\Users\Thanh Tra\AppData\Roaming\Anki2\addons21\939347702\vendor\pysubs2\ssafile.py", line 100, in load
return cls.from_file(fp, format_, fps=fps, **kwargs)
File "C:\Users\Thanh Tra\AppData\Roaming\Anki2\addons21\939347702\vendor\pysubs2\ssafile.py", line 153, in from_file
format_ = autodetect_format(fragment)
File "C:\Users\Thanh Tra\AppData\Roaming\Anki2\addons21\939347702\vendor\pysubs2\formats.py", line 67, in autodetect_format
raise FormatAutodetectionError("No suitable formats")
pysubs2.exceptions.FormatAutodetectionError: No suitable formats
Comment from author
It looks like the add-on doesn't know how to read the subtitle file. To fix any errors, try to import the subtitle file with Aegisub, Subtitle Edit or https://nikse.dk/SubtitleEdit/Online and if it was successful, export it as a .srt or .ass file. Alternatively, maybe share a link or send it to me by email so I could open it with a text editor to see if it's something that can be fixed, or maybe try to use the add-on with a different subtitle file.
on 1629750141
I want to use this add-on in Night mode but the color of the second subtitle is Blue which makes it hard to see. Where can I change it white? I tried it in styles.py but it didn't work.
Comment from author
The add-on will reuse the existing note type if it's found and styles.py will be only used to generate a new note type if it doesn't exist yet.

A possible alternative is to edit existing note type and add some code to the Styling section of the card template. For example,

.nightMode .meaning {
color: yellow;
}

https://docs.ankiweb.net/templates/styling.html#night-mode
on 1629661623
Hi! Thank you for this great add-on! I would like to know if it is possible to cut differently the sentences, for example by modifying the subtitles field? Indeed, the sentences are sometimes too long and cutting them each 10 seconds, for example, is sometimes inappropriate because it cut the sentences in the middle of a word. I would like a cut for each line instead of each sentence. Thanks in advance.
Comment from author
Thank you! If I understood correctly, set "Gap between Phrases to 0.0" and uncheck the checkbox ("exact mode").

https://github.com/kelciour/movies2anki/issues/18#issuecomment-846584694
on 1628280074
great idea
on 1628185741
Works perfect for me. Thank you!
on 1626678069
good
on 1626200583
Is it just me or does this not work on ankidroid?

This is what happened when I tried to use "Generate Mobile Cards"


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.44 (b2b3275f) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-07-13 12:17:14

Caught exception:
Traceback (most recent call last):
File "C:\Users\Andrey\AppData\Roaming\Anki2\addons21\939347702\player.py", line 643, in run
self.fp = subprocess.Popen(cmd, startupinfo=info)
File "subprocess.py", line 854, in __init__
File "subprocess.py", line 1307, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified
Comment from author
I'm not sure why it fails on line 643 instead of line 589, but it looks like ffmpeg.exe couldn't be found.


If you press Win, type "cmd" to open a Command Prompt on Windows, and type "ffmpeg" (without double quotes), the output should be something like:
> ffmpeg version 4.3.1-2021-01-01-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
but you'll see something like
> 'ffmpeg' is not recognized as an internal or external command.

Download FFmpeg from https://www.gyan.dev/ffmpeg/builds/ if you didn't do it already (ffmpeg-git-full.7z or ffmpeg-release-full.7z), unpack it somewhere and update the PATH environment variable by adding the full path to the folder that contains ffmpeg.exe and ffprobe.exe, e.g. C:\Programs\ffmpeg\bin, and restart Anki.

How to update the PATH environment variable - https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/

---

It might be possible to make something similar and generate cards on Android directly using AnkiDroid API or by creating an apkg file, but an Anki deck generated with the add-on should work on AnkiDroid after using Generate Mobile Cards option.

If you didn't use Tools > Generate Mobile Cards, the collection.media folder will be empty and there will be no sound/video on AnkiDroid.
on 1626019207
Amazing !
But it took me a while to figure out how to install all the above-mentioned software. ( I am a newbie to tech stuffs )
I am wondering can it and does it co-work with others add-on that support PinYin, pop-up dictionary...?
And i got this problems :
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.35 (84dcaa86) Python 3.8.0 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2021-06-27 02:20:02

Caught exception:
Traceback (most recent call last):
File "C:\Users\user\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 1173, in run
call(cmd)
File "anki\utils.py", line 301, in call
File "subprocess.py", line 854, in __init__
File "subprocess.py", line 1247, in _execute_child
File "subprocess.py", line 549, in list2cmdline
File "os.py", line 816, in fsdecode
TypeError: expected str, bytes or os.PathLike object, not NoneType

=> Thanks for the last updated support. The cards are successfully generated with two different subtitiles...but no audios and videos are played when I reviewing the cards.
As i checked:
C:\Users\user>mpv
mpv 0.33.0-204-ga1c6762156 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
built on Sun Jun 27 21:28:02 +08 2021
FFmpeg library versions:
libavutil 57.0.100
libavcodec 59.2.100
libavformat 59.3.101
libswscale 6.0.100
libavfilter 8.0.103
libswresample 4.0.100
FFmpeg version: git-2021-06-27-49e3a816

Usage: mpv [options] [url|path/]filename

Basic options:
--start=<time> seek to given (percent, seconds, or hh:mm:ss) position
--no-audio do not play sound
--no-video do not play video
--fs fullscreen playback
--sub-file=<file> specify subtitle file to use
--playlist=<file> specify playlist file

--list-options list all mpv options
--h=<string> print options which contain the given string in their name
Comment from author before post was edited
About the last error, "TypeError: expected str, bytes or os.PathLike object, not NoneType", the add-on can't find ffmpeg.exe.

If you press Win, type "cmd" to open a Command Prompt on Windows, and type "ffmpeg" (without double quotes), the output will be something like: 'ffmpeg' is not recognized as an internal or external command.

Download FFmpeg from https://www.gyan.dev/ffmpeg/builds/ if you didn't do it already (ffmpeg-git-full.7z or ffmpeg-release-full.7z), unpack it somewhere and update the PATH environment variable by adding the full path to the folder that contains ffmpeg.exe and ffprobe.exe, e.g. C:\Programs\ffmpeg\bin, and restart Anki.

How to update the PATH environment variable - https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/

About PinYin and pop-up dictionary, I can't say for sure at the moment, but theoretically, yes, they should work just fine.

---
I think, there shouldn't be any problem with using any other add-on as long as the name of the note type stays the same, i.e. movies2anki (...). The only exception is "movies2anki (subs2srs - video)" note type. The card template contains JavaScript code to trigger video replay by clicking on any part of the card and it may cause some problems. I've updated the add-on and added the additional check in this card template to prevent replaying video on text selection, but maybe there's something else that needs to be fixed or maybe use another JavaScript code to disable it on desktop and only enable it on AnkiDroid.

About "Invalid HTML on card", thank you, it's been fixed. I used it to prevent playing audio at the same time as video by using a non-existing audio file that was later replaced with the correct audio filename to make audio button work on the back side of the card if it's been clicked.

Please go to Tools - Add-ons - Check for Updates to update the add-on and then use one of the following options to fix "Invalid HTML on card":
1. Install the "Replay buttons on cards" add-on - https://ankiweb.net/shared/info/498789867
2. Open Tools - Manage Note Types - "movies2anki - subs2srs (video)" and either delete it with all the cards, if it's okay, the add-on will create a new one with the updated card template on the next run, or click on Cards... and replace Front and Back Template with this code - https://gist.github.com/kelciour/c347951c74ab712c659a41e3e5edc422

It's possible to use VLC on Windows but it's been left as it is for legacy reasons and it's not something that I can support. There's no much difference with audio, but VLC doesn't play video as well as mpv, at least on my quite old laptop and PC.

The add-on only tried to play video using VLC if it couldn't find mpv executable in the PATH environment variable. It can be checked by pressing Win+R, type "cmd" (without double quotes) to open Command Prompt, then type "mpv" (without double quotes) and press Enter. The output should be something like
> mpv 0.30.0-195-gb31f2f6cb9 Copyright © 2000-2019 mpv/MPlayer/mplayer2 projects
but I guess the output will be something like
> "mpv" is not recognized as an internal or external command...
In this case, just add the path to the folder that contains mpv.exe to the PATH environment variable and restart Anki.
- https://streamable.com/2b1l6
- https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/
on 1625999793
Please help me, I don't know this problem.

Anki 2.1.35 (84dcaa86) Python 3.8.1 Qt 5.12.6 PyQt 5.12.3
Platform: Windows 7
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2021-07-11 08:25:47

Caught exception:
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 1544, in preview
self.model.create_subtitles()
File "C:\Users\Administrator\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 961, in create_subtitles
en_subs = self.load_subtitle(self.en_srt, self.is_ignore_sdh_subtitle, self.join_lines_separator, self.join_sentences_separator, self.is_gap_phrases)
File "C:\Users\Administrator\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 734, in load_subtitle
subs = pysubs2.load(filename, encoding=enc)
File "C:\Users\Administrator\AppData\Roaming\Anki2\addons21\939347702\vendor\pysubs2\ssafile.py", line 100, in load
return cls.from_file(fp, format_, fps=fps, **kwargs)
File "C:\Users\Administrator\AppData\Roaming\Anki2\addons21\939347702\vendor\pysubs2\ssafile.py", line 151, in from_file
text = fp.read()
File "C:\python38\lib\encodings\cp1254.py", line 23, in decode
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 911: character maps to <undefined>
Comment from author
It appears the subtitle file isn't in UTF-8 encoding and the add-on failed to correctly guess its encoding. Try to save the subtitle file in UTF-8, maybe with https://www.nikse.dk/subtitleedit/online or Sublime Text, Notepad++.

If you don't know its encoding, maybe this helps - https://stackoverflow.com/questions/8509339/what-is-the-most-common-encoding-of-each-language
on 1625390415
Now the add-on,works perfect, but I have a problem with 2 shortcuts increase 0.25 s and remove 0.25 s,I press them and it doesnt work, thanks a lot for the time!
Comment from author
At first, make sure that the current keyboard layout is English when the main window of Anki is active and focused, otherwise , and . won't work. Secondly, maybe temporarily turn off all the add-ons except this one, restart Anki and try again.
on 1625242102
AMAZING!!! Now I can watch series without burden on the conscience. Really great!
on 1625059819
nice plugin

Thank you but i have an issue.
Anki 2.1.22 (0ecc189a) 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: 2021-06-30 19:53:37

Caught exception:
Traceback (most recent call last):
File "C:\Users\11\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 1542, in preview
self.model.create_subtitles()
File "C:\Users\11\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 968, in create_subtitles
self.en_subs_phrases, self.subs_with_line_timings = convert_into_phrases(self.en_subs_sentences, self.time_delta, self.phrases_duration_limit, self.is_split_long_phrases, self.join_sentences_separator)
File "C:\Users\11\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 413, in convert_into_phrases
subs = split_long_phrases(subs, phrases_duration_limit)
File "C:\Users\11\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 297, in split_long_phrases
sub_splitted[pos].append((s_start, s_end, s_content))
IndexError: list index out of range
Comment from author
Thank you. Please use Tools - Add-ons - Check for updates to update the add-on and restart Anki.

Alternatively, maybe import the subtitle file to https://www.nikse.dk/subtitleedit/online and save/download it as SubRip (.srt).
on 1622959697
From a fan of Hiếu Cao with love =))))))))))) thanks
on 1622365203
Notes movies2anki - subs2srs (audio) type play the audio just fine, but when I try to create a new type of note based on it, the audio simply doesn't play.

I begin by duplicating movies2anki - subs2srs

Then I delete the "notes" and "video" fields, and add a extra field called "word"

Then I change the cards' css so "notes" and "video" are erased and "word" is there. Also add Awesome TSS to read the "Word" field.

Then when I preview the card or study it, I click on the player and noting comes out.

I have tested multiple times, the original movies2anki - subs2srs (audio) plays the audio just fine. I don't know why changing the css or deleting blank fields would interfere with anki reading the audio file.

I've tried keeping the original order of fields (Id, Source, Path...), installed mpv and ffmepg as instructed...

I really don't know what to do. Should I try to edit the fields and css of movies2anki - subs2srs (audio) itself instead of creating a new Note Type under a different name? Wouldn't that risk losing the cards' connection to the add-on?
on 1622188011
Works great. Thank you but i have an issue. When I press the button "genarate mobile cards", the add-on automatically converts all the videos to ".mp4" format. It may seem a bit odd but I need that add-on automatically converts all the videos to ".webm" format instead of ".mp4". I want it because I designed a flashcard template for playing embeded videos, but it only works with ".webm". So, I tried to change lines in "movies2anki.py" but i failed. Could you help me?

-----
Thanks a lot for help. After editing command lines of ffmpeg in both player.py and movies2anki.py, my problem has been solved. Now I can easily play embeded videos on anki windows.
Comment from author before post was edited
Thank you too. The code is a bit messy and in need of some refactoring. In addition to changes in "movies2anki.py" (to write to Anki database as webm), a few encoding options along with "libx264" will need to be removed from "player.py" (to save video clips in the collection.media folder).

The add-on was updated to make it a bit easier. Use Tools - Add-ons - Check for Updates, restart Anki and go to Add-ons - ... - Config and edit "video extension" by replacing "mp4" with "webm". Then either use find and replace in Anki to change .mp4 to .webm in notes or make a new deck of cards with the add-on and then run Tools > Generate Mobile Cards.
on 1621430030
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.44 (b2b3275f) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-05-19 19:31:27

Caught exception:
Traceback (most recent call last):
File "C:\Users\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 1531, in preview
self.model.create_subtitles()
File "C:\Users\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 957, in create_subtitles
self.en_subs_phrases, self.subs_with_line_timings = convert_into_phrases(self.en_subs_sentences, self.time_delta, self.phrases_duration_limit, self.is_split_long_phrases, self.join_sentences_separator)
File "C:\Users\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 406, in convert_into_phrases
subs = split_long_phrases(subs, phrases_duration_limit)
File "C:\Users\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 295, in split_long_phrases
sub_splitted[pos].append((s_start, s_end, s_content))
IndexError: list index out of range
Comment from author
Thank you! The add-on was updated to likely fix it. Use Tools > Add-ons > Check for Updates to install a newer version and restart Anki.

If the fix won't work, maybe import it to https://www.nikse.dk/subtitleedit/online and save/download it as SubRip (.srt).
on 1621243750
Thank you everything works for me!!!
on 1620145024
Please help or fix it or tell me how to fix it. I try it with ffmeg already


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.43 (0fbae6bc) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-05-04 21:53:36

Caught exception:
Traceback (most recent call last):
File "C:\Users\admin\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 1162, in run
call(cmd)
File "anki\utils.py", line 278, in call
File "subprocess.py", line 854, in __init__
File "subprocess.py", line 1247, in _execute_child
File "subprocess.py", line 549, in list2cmdline
File "os.py", line 818, in fsdecode
TypeError: expected str, bytes or os.PathLike object, not NoneType
Comment from author
It looks like the add-on can't locate ffmpeg.exe. If you press Win, type "cmd" to open the Windows Command Prompt, and type "ffmpeg", the output will be something like: 'ffmpeg' is not recognized as an internal or external command.

Download FFmpeg from https://www.gyan.dev/ffmpeg/builds/ if you didn't do it already (ffmpeg-git-full.7z or ffmpeg-release-full.7z), unpack it somewhere and update the PATH environment variable by adding the full path to the folder that contains ffmpeg.exe and ffprobe.exe, e.g. C:\Programs\ffmpeg\bin, and restart Anki.

How to update the PATH environment variable - https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/
on 1619272280
Very nice plugin!
But after Generate Mobile Cards...
All mp4 files are empty for 10bit encoded movies:(

Thank you very much!
Error message is:
x264 [error]: baseline profile doesn't support a bit depth of 10
[libx264 @ 0x557f4ae66800] Error setting profile baseline.

profile high10 is working, but not on Android.

So I changed these two lines and now it plays in Ankidroid again:

cmd += ["-map", "0:v:0", "-map", "0:a:{}".format(audio_id), "-c:v", "libx264", "-crf", "18", "-vf", vf, "-profile:v", "baseline", "-level", "3.0", "-c:a", "aac", "-ac", "2", note["Video"]]

vf = "scale=-2:320,format=yuv420p"
Comment from author before post was edited
Thank you! I'm not sure where is the problem. If it works in Anki during review, maybe ffmpeg doesn't like something and it'd be better to do encoding with mpv. It could be done but will take some time to implement.

So far I added a check for returncode. Please use Tools - Add-ons - Check for Updates to update the add-on and restart Anki. Mabe it will help to reproduce the issue without Anki and eventually fix it or found out where's the problem.

Try to encode again either using a new Anki profile, because the add-on will skip existing files and won't encode them, or maybe remove the deck, run Tools > Check Media to delete unused files and create a new deck.

If you don't see any error message, try to cancel the process. If it was in the middle of mp4 encoding, the error message should appear with the command line that was used for encoding mp4 files. Just copy everything between [ and ], open the Terminal app or Command Promt and paste it there. Maybe the output from ffmpeg will contain some useful information why it happens.

In addition, if the path to the video file contains non-latin characters, try to rename it, create a new deck in a new Anki profile and generate mobile cards again. Or maybe try with a different video file for example from https://ted2srt.org/ just to see if it makes any difference.
on 1618052701
Works great. However, I got an issue with an MKV:

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.42 (8eebfe18) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.16
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-04-07 15:49:16
Add-ons possibly involved: ⁨Watch Foreign Language Movies with Anki⁩

Caught exception:
Traceback (most recent call last):
File "/Users/cda/Library/Application Support/Anki2/addons21/939347702/movies2anki.py", line 1527, in preview
self.model.create_subtitles()
File "/Users/cda/Library/Application Support/Anki2/addons21/939347702/movies2anki.py", line 958, in create_subtitles
ru_subs = self.load_subtitle(self.ru_srt, self.is_ignore_sdh_subtitle, self.join_lines_separator, self.join_sentences_separator, is_gap_phrases=True)
File "/Users/cda/Library/Application Support/Anki2/addons21/939347702/movies2anki.py", line 721, in load_subtitle
subs = pysubs2.load(filename, encoding=enc)
File "/Users/cda/Library/Application Support/Anki2/addons21/939347702/vendor/pysubs2/ssafile.py", line 100, in load
return cls.from_file(fp, format_, fps=fps, **kwargs)
File "/Users/cda/Library/Application Support/Anki2/addons21/939347702/vendor/pysubs2/ssafile.py", line 151, in from_file
text = fp.read()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/encodings/ascii.py", line 26, in decode
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb8 in position 3: ordinal not in range(128)

----------
Update: My bad, issue was with a broken srt file. All good, works flawlessly :)
Comment from author before post was edited
Try to open the subtitle file with a text editor (Sublime Text, Visual Studio Code, ...) and save it with UTF-8 encoding.

I've never used it, but for some files something online might work too like https://subtitletools.com/convert-text-files-to-utf8-online or https://subsyncer.com/subtitle-utf8.php
on 1618018961
The plug-in works perfectly on my laptop with win7, 32 bit and vlc player, no need to download mpv, FFmpeg, or update PATH.

Just enter the code in anki.
on 1616842377
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.42 (8eebfe18) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-03-27 17:11:35

Caught exception:
Traceback (most recent call last):
File "C:\Users\Ahmed\AppData\Roaming\Anki2\addons21\939347702\player.py", line 537, in run
track_list_count = check_output([mpv_executable, "--msg-level=all=no,term-msg=info", '--term-playing-msg=${track-list/count}', "--vo=null", "--ao=null", "--frames=1", "--quiet", "--no-cache", "--", note["Path"]], shell=False, stdin=subprocess.PIPE, stderr=subprocess.PIPE, startupinfo=info, encoding='utf-8')
File "subprocess.py", line 411, in check_output
File "subprocess.py", line 512, in run
subprocess.CalledProcessError: Command '['mpv.exe', '--msg-level=all=no,term-msg=info', '--term-playing-msg=${track-list/count}', '--vo=null', '--ao=null', '--frames=1', '--quiet', '--no-cache', '--', 'C:/Users/Ahmed/Videos/Finding Mr. Right.mp4']' returned non-zero exit status 2.
Comment from author
About "returned non-zero exit status 2", maybe the video file was renamed, deleted or moved to a different folder. Please double check that it exists ("C:/Users/.../Videos/Finding Mr. Right.mp4"). Maybe use the add-on to create a new deck of cards, but maybe in a new Anki profile, using the same video file.

If the same error happens again, maybe open "cmd" (the Windows command prompt), copy-paste the following command, replace the last option with the correct path to the video file and press Enter. The error message should be different this time.

"mpv" --term-playing-msg=${track-list/count}" "--vo=null" "--ao=null" "--frames=1" "--no-cache" "--" "C:/Users/.../video.mp4"

----

Thank you for the upvote! I'd like to get the whole installation process a bit more user-friendly, maybe semi-automatic or maybe skip a few steps, but it'll take a while before I'll return to the add-on.

For now, try to do the following.

>>>

It looks like the add-on can't locate ffmpeg.exe. If you press Win, type "cmd" to open the Windows Command Prompt, type "ffmpeg" and press Enter, the output probably will be something like: 'ffmpeg' is not recognized as an internal or external command.

To fix it, download ffmpeg-release-full.7z from https://www.gyan.dev/ffmpeg/builds/ if you didn't do it already, unpack it somewhere usin 7-Zip File Manager and update the PATH environment variable by adding the folder that contains ffmpeg.exe and ffprobe.exe. Usually ffmpeg.exe could be found in the "bin" subfolder and the correct path might be some like "C:\Programs\ffmpeg\bin". And if Anki was opened, restart Anki.

How to update the PATH environment variable - https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/
on 1615507324
Cool idea!
on 1614978883
GG broooooooooooooooooo!!!!!
on 1614466146
Wonderful! I've been looking for a good subs2srs alternative for Mac OS, and this mostly does the job. It gives a timestamp for each card, it gives the source filename, the meaning (if you load a second subtitle file), and, of course, a screenshot, audio, and video. In particular, I use the timestamp heavily when I need to check the context for a given scene.

Easily configured batch processing with wildcard characters is terrific! I can let it sit overnight for a huge batch, then sort them into decks/tags the next day based on the filename or filepath.

There is one change I'd like to see: easily modified screenshot sizes. Even with glasses, I have awful eyesight. My workaround is to modify the add-on's code by going to the add-on's folder (Anki -> Add-ons -> View Files), opening movies2anki.py in a text editor, and changing "self.video_height = 320" to my desired card height. This isn't the most intuitive method, however. I also suspect that I'll need to modify this value each time the add-on updates.


This isn't strictly related to this add-on, but to anything that converts subs to Anki cards. Subtitle files can throw up a few interesting hiccups. In particular, if you're using .ass files, any kind of fancy formatting can create a massive block of gibberish in the expression/meaning field. For instance, here's some of the formatting for an anime OP's subtitles: {\an5\pos(52,47.5)\bord0\fad(150,150)\blur0.5\t(80,980,0.5,\fscx125\fscy125)\t(980,1380,\fry360\fscx100\fscy100)}. The entire card becomes a mess of formatting, with any meaning lost amidst the junk!

The best way to handle this is to probably trash the card: it's usually not worth the time and effort to fix it up. However, if it's a card you really want, or the entire set of subtitles uses this kind of formatting extensively, you have a few options. One is to find an entirely different subtitle file. If this isn't possible, converting a .ass file to a .srt file will remove quite a bit of this formatting. The previous mass of formatting in the anime's OP becomes the much more manageable {\an5} after converting it to a .srt file. If you opt for this option, this pastebin contains some useful scripts for extracting and converting your .ass files: https://pastebin.com/A7PphxKy

Another option is to VERY CAREFULLY use Anki's find and replace option to eliminate the formatting. A simple regex string to get rid of everything between a set of braces {} is \{[^\}]*\}. Put that expression into 'find', leave the 'replace with' blank, choose the right field, and check the "Treat input as regular expression box." I would use this very selectively, choosing a specific field on a small number of cards you want to keep. The biggest issue here is that you might delete too much. Make a backup first.
on 1612022822
The best! Just the best
on 1611180625
tengo un inconveniente . a la hora de crear las fraces me las crea muy largas . en un video de 5 minutos solo me da 4 frases . que puedo hacer
Comment from author
To create the same number of cards as subtitles in the file, set Gap between Phrases to 0.0 and uncheck the box - https://imgur.com/ddFyxmn
on 1610306739
It doesn't work, but it worked before and I didn't update my version of Anki and I tried to reinstall the add-on.
Everything works except the mobile card generation which gives this error.


Anki 2.1.33 (3f403040) Python 3.8.0 Qt 5.14.1 PyQt 5.14.1
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-01-10 18:41:33

Caught exception:
Traceback (most recent call last):
File "C:\Users\???????\AppData\Roaming\Anki2\addons21\939347702\player.py", line 519, in run
time_start, time_end = re.match(r"^.*?_(\d+\.\d\d\.\d\d\.\d+)-(\d+\.\d\d\.\d\d\.\d+).*$", fld).groups()
AttributeError: 'NoneType' object has no attribute 'groups'
Comment from author
The "Audio" field is either empty or contains some extra characters and the add-on can't extract the start time and the end time from this field using the pattern matching.

If making a new deck of cards is not an option, maybe open the card browser and search for

"Path:_*" -"Audio:re:^.*?_(\d+\.\d\d\.\d\d\.\d+)-(\d+\.\d\d\.\d\d\.\d+).*$"

It should find cards that don't match the regular expressons pattern.

If it's just a few cards, maybe try to replace the "Audio" field by copying the "Id" field and adding ".mp3"

Otherwise, maybe click on the "Audio" field, press Ctrl+Shift+X to open HTML Editor and let me know what it contains so I could apply a fix and update the addon.
on 1610086904
This is what I've been through.

Anki 2.1.33 (3f403040) 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: 2021-01-07 17:01:21

Caught exception:
Traceback (most recent call last):
File "C:\Users\hyuni\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 1158, in run
call(cmd)
File "anki\utils.py", line 301, in call
File "subprocess.py", line 854, in __init__
File "subprocess.py", line 1247, in _execute_child
File "subprocess.py", line 549, in list2cmdline
File "os.py", line 816, in fsdecode
TypeError: expected str, bytes or os.PathLike object, not NoneType

-----------------------
How could I fix it? please let me know
---------------------
One more thing, Could you add "smi" into subtitle format please?

I can't wait : )
Comment from author
It looks like the add-on can't locate ffmpeg.exe. If you press Win, type "cmd" to open the Windows Command Prompt, and type "ffmpeg", the output will be something like: 'ffmpeg' is not recognized as an internal or external command.

Download FFmpeg from https://www.gyan.dev/ffmpeg/builds/ if you didn't do it already, unpack it somewhere and update the PATH environment variable by adding the folder that contains ffmpeg.exe and ffprobe.exe, e.g. C:\Programs\ffmpeg\bin, and restart Anki.

How to update the PATH environment variable - https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/

If it's just a few .smi subtitles, it should be possible, I guess, to convert them to .srt with Subtitle Edit.
on 1608721504
Hello Nickolai,

Thank you for all your fantastic app, you might open a Patreon soon maybe ?

All the best,

Marc
on 1608193318
Great plugin!
on 1603185586
Hi great add-on! Running macOS Catalina 10.15.6 but receiving this error when trying to movies2anki-subs2srs-video. Please advise.

Anki 2.1.35 (84dcaa86) Python 3.8.0 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.15.6
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-10-19 14:07:57
Add-ons possibly involved: ⁨Watch Foreign Language Movies with Anki⁩

Caught exception:
Traceback (most recent call last):
File "/Users/iraklirekhviashvili/Library/Application Support/Anki2/addons21/939347702/movies2anki.py", line 1158, in run
call(cmd)
File "anki/utils.py", line 301, in call
File "subprocess.py", line 854, in __init__
File "subprocess.py", line 1583, in _execute_child
File "posixpath.py", line 152, in dirname
TypeError: expected str, bytes or os.PathLike object, not NoneType

I've tried reinstalling Homebrew on the latest version, restarting the computer and Anki. I noticed this issue was raised by a Windows user to change the PATH variable but not sure how to do this on Mac if applicable.
Comment from author
The add-on can't seem to find ffmpeg to generate screenshots. FFmpeg can be installed with brew and I'm not sure what went wrong.

https://trac.ffmpeg.org/wiki/CompilationGuide/macOS#ffmpegthroughHomebrew

Maybe open the Terminal app, copy-paste the following line and press Return.

which ffmpeg

The output should be something like


User-MacBook-Pro:~ user$ which ffmpeg
/usr/local/bin/ffmpeg

Maybe try to reinstall ffmpeg via brew, i.e.

brew reinstall ffmpeg
on 1600798687
Good job
جزاگم الله الاسلام
on 1599427996
#Edit: thanks!

Debug info:
Anki 2.1.22 (0ecc189a) Python 3.8.0 Qt 5.14.1 PyQt 5.14.1
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2020-09-05 20:24:37

Caught exception:
Traceback (most recent call last):
File "C:\Users\Aleni\AppData\Roaming\Anki2\addons21\939347702\player.py", line 519, in run
time_start, time_end = re.match(r"^.*?_(\d+\.\d\d\.\d\d\.\d+)-(\d+\.\d\d\.\d\d\.\d+).*$", fld).groups()
AttributeError: 'NoneType' object has no attribute 'groups'
Comment from author before post was edited
Once it happens, open the edit window and take a look at the Audio field. The add-on is looking for something like 00.26.43.226-00.26.47.019 but can't find it and shows this error. This is something I'd like to improve or maybe do differently, but at the moment the Audio field should be left intact.

The easy way to fix it would be to remove the deck and make a new one. As an alternative, if that's okay, I'll update the add-on and use the Id field as a fallback.
on 1599249782
problem solved. thank you
Comment from author
That's great you solved it on your own and I'm sorry for not replying sooner. For the time being, I'm no longer checking AnkiWeb every day for any new comments and only do it once a week or maybe a bit more frequently.sometimes. And if something is urgent it might be better to contact me directly by email kelciour@gmail.com
on 1598717835
Thanks for this lovely addon. It was working good. but after updating anki, I am getting the following error . please fix it.



Debug info:
Anki 2.1.32 (dee7d45d) Python 3.8.0 Qt 5.14.1 PyQt 5.14.1
Platform: Windows 7
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-08-29 19:04:12

Caught exception:
Traceback (most recent call last):
File "aqt\webview.py", line 37, in cmd
File "aqt\webview.py", line 123, in _onCmd
File "aqt\webview.py", line 547, in _onBridgeCmd
File "<C:\Program Files\Anki\decorator.pyc:decorator-gen-52>", line 2, in review_link_handler_wrapper
File "anki\hooks.py", line 638, in decorator_wrapper
File "anki\hooks.py", line 635, in repl
File "C:\Users\Mamun7\AppData\Roaming\Anki2\addons21\939347702\player.py", line 751, in myLinkHandler
return _old(reviewer, url)
File "C:\Users\Mamun7\AppData\Roaming\Anki2\addons21\498789867\__init__.py", line 103, in review_link_handler_wrapper
original_review_link_handler(reviewer, url)
File "<C:\Program Files\Anki\decorator.pyc:decorator-gen-40>", line 2, in linkHandler_wrap
File "anki\hooks.py", line 638, in decorator_wrapper
File "anki\hooks.py", line 635, in repl
File "C:\Users\Mamun7\AppData\Roaming\Anki2\addons21\385888438\reviewer.py", line 193, in myLinkHandler
saveThenRefreshFld(reviewer, note, fld, new_val)
File "C:\Users\Mamun7\AppData\Roaming\Anki2\addons21\385888438\reviewer.py", line 153, in saveThenRefreshFld
saveField(note, fld, new_val)
File "C:\Users\Mamun7\AppData\Roaming\Anki2\addons21\385888438\reviewer.py", line 135, in saveField
txt = Editor.mungeHTML(None, txt)
File "aqt\editor.py", line 421, in mungeHTML
File "aqt\gui_hooks.py", line 1606, in __call__
File "aqt\editor.py", line 1219, in reverse_url_quoting
AttributeError: 'NoneType' object has no attribute 'mw'
Comment from author
Thank you for the feedback!

It looks like it's been originated from Edit Field During Review (Cloze) and was reported on https://github.com/BlueGreenMagick/Edit-Field-During-Review-Cloze/issues/34
on 1597418925
Not examined yet, but great idea and work
on 1597196081
Hey, great when I did it on windows laptop. The tag type I chose is movies2anki (subs2srs - video), why doesn't it work with video and audio on Phone
Edit: Woah, fantastic. Can I use it to learn for any language, including Korean?
Thanks a lot of creating it
Comment from author
Yes, definitely. I haven't tested it and if there're any problem, just let me know.
on 1597017742
Works well so far. Good to see an active developer that delivers updates constantly :)
Comment from author before post was edited
This is strange. If I understand it correctly, it looks like mpv plays it fine during review but for some reason ffmpeg cuts it a bit differently with Generate Mobile Cards.

Since it doesn't work on AnkiDroid, I guess, you should be able to reproduce the issue by playing it on desktop from the collection.media folder with your favourite media player or mpv (after using Generate Mobile Cards).

https://docs.ankiweb.net/#/files?id=file-locations

Maybe the add-on still has a bug with converting milliseconds to seconds and vice versa. I believe it's been already fixed a while back but maybe I missed something. If it's true, in the worst case for some cards the audio might start 1 second too early or too late.

Maybe try with this video - https://ted2srt.org/talks/danielle_feinberg_the_magic_ingredient_that_brings_pixar_movies_to_life
For this video Generate Mobile Cards should work without any problem.

Since you're on Windows, maybe try to convert it with subs2srs - http://subs2srs.sourceforge.net
It works a bit differently, but since it uses FFmpeg too, I guess, the result will be the same and the audio will still be out of sync.

Maybe, if you could upload your video/audio file with subtitles somewhere, maybe https://wetransfer.com or https://send.firefox.com or something else, put a link in a reply or send it to me by email <kelciour@gmail.com>.
on 1597013551
Great app! This is kind of subs2srs Ultimate evolution. It would be great, if it had an option to change path by clicking, you know when one moves a file. You can do it with search and replace, of course. Just a suggestion. Keep up the great work
on 1596965016
Hello, thank you for creating this addon. I find it amazing when my friends use it. But I can't use it, can you tell me the tutorial video for Windows, I have installed Friends 1x01 tag (subs2srs) with the link https://mega.nz/folder/31dGQCyL#IpdQ5u15S_kdsWR6mbti7w .This set of cards works, I love it. But when I installed, I did not choose movies2anki - subs2srs.
It happened like this, I hope anyone can give me the tutorial video, it took me 3 days to do but the result is sad

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.29 (bbff62bf) 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-08-09 09:34:05

Caught exception:
Traceback (most interesting call last):
File "C: \ Users \ hp 9470m \ AppData \ Roaming \ Anki2 \ addons21 \ 939347702 \ movies2anki.py", line 1119, in run
call (cmd)
File "lib \ site-packages \ anki \ utils.py", line 301, in call
File "subprocess.py", line 854, in __init__
File "subprocess.py", line 1247, in _execute_child
File "subprocess.py", line 549, in list2cmdline
File "os.py", line 816, in fsdecode
TypeError: expected str, bytes or os.PathLike object, not NoneType
Comment from author
Hi, thank you, it's always great to know it's been used by someone.

Try to download FFmpeg from https://ffmpeg.zeranoe.com/builds/ if you didn't do it already, unpack it somewhere and update the PATH environment variable either in the User or System variables by adding the folder that contains ffmpeg.exe and ffprobe.exe, e.g. C:\Programs\ffmpeg\bin, and restart Anki.

How to update the PATH environment variable:
- https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/
on 1595477650
Excellent addon, really helps learning a foreign language.
on 1595426304
Its a very nice add-on thought I have a few problem with it which is the fading(both in condensed audio and in movie2anki mode, I want it turned off). I already looked into the add-on folder and found the lines with "fade" in the .py files but I have no idea how to tinker around it.
Comment from author
Please update the add-on (Tools - Add-ons - Check for Updates), restart Anki, open Tools - Add-ons - ... - Config and set the "audio fade in/out" option to 0.

In case of the condensed audio, if it's a new deck, it might be better, or maybe not, to temporarily create a new deck of cards in a new Anki profile with the "Gap between Phrases" option set to 0.75 or 1.25 to reduce number of gaps.
on 1595174613
Thank you so much! Works very well and it is really, really useful.
on 1594023992
Thanks for this.
Comment from author before post was edited
Try to download FFmpeg from https://ffmpeg.zeranoe.com/builds/ if you didn't do it already, unpack it somewhere and update the PATH environment variable either in the User or System variables by adding the folder that contains ffmpeg.exe and ffprobe.exe - https://streamable.com/2b1l6 - and restart Anki.
on 1593850723
well done !!
on 1593482232
This is such a great feature, hope to see any update, keep it up pal!
on 1593399531
Absolutely incredible, I can't believe the quality of these tools which are very underground and unknown but are of unparalleled value to the language learner. I cringe at myself remembering how I started with Duolingo a long time ago, and now looking at the tools I am using, this being the epitome. Thank you so much for your time you invested working on this tool.

Small issue: extending or cutting the audio/video does not seem to affect the note. It replays the extended/cut audio but it doesn't change the timestamps on the note. %% Edit: Thank you for fixing this so quick!

@ Japanese learners: to generate furigana on your kanji you must use MIA Japanese addon instead of Japanese Support. The latter requires changing the note type to contain 'japanese', which bugs this addon.
Comment from author before post was edited
Thank you for the feedback!

About the issue, if it's about ",", "." and "<", ">" shortcuts, at the moment only the Audio/Video fields will be updated. The Id field is left unchanged to be able to restore the initial timestamps.

I've updated the add-on and now, once the card had been reviewed, the Id field will be updated if it's different from the Audio field. It requires Anki 2.1.22+.
on 1592871093
When I try creating new video cards I get this error:
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.22 (0ecc189a) Python 3.8.1 Qt 5.14.1 PyQt 5.14.1
Platform: Linux
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-06-22 14:55:28
Add-ons possibly involved: ⁨Watch Foreign Language Movies with Anki⁩

Caught exception:
Traceback (most recent call last):
File "/home/diego/.local/share/Anki2/addons21/939347702/movies2anki.py", line 1497, in start
self.startSingleMode()
File "/home/diego/.local/share/Anki2/addons21/939347702/movies2anki.py", line 1610, in startSingleMode
self.model.create_subtitles()
File "/home/diego/.local/share/Anki2/addons21/939347702/movies2anki.py", line 887, in create_subtitles
en_subs = self.load_subtitle(self.en_srt, self.is_ignore_sdh_subtitle, self.join_lines_separator, self.join_sentences_separator, self.is_gap_phrases)
File "/home/diego/.local/share/Anki2/addons21/939347702/movies2anki.py", line 683, in load_subtitle
return read_subtitles(file_content, is_ignore_SDH, join_lines_separator, join_sentences_separator, is_gap_phrases)
File "/home/diego/.local/share/Anki2/addons21/939347702/movies2anki.py", line 184, in read_subtitles
sub_timecode = sub_chunks[1].split(' --> ')
IndexError: list index out of range

I'm using Linux Mint 19.3 specifically, not Ubuntu, although it was working perfectly before.
Comment from author
Thank you. It looks like the add-on can't read the subtitles file. Maybe the subtitles file is in UTF-16 encoding instead of UTF-8.

I've updated the add-on and added a possible fix to support UTF-16 encoding, please use Tools - Add-ons - Check for Updates and restart Anki.
on 1592342093
This is really a fantastic resource - an unbelievable job to have put this together. Can see that this would really be useful - although my issue is that most Chinese subtitles are ”hardcoded" into the video, rather than an accompanying SRS file. There are a few options around this but it does limit the choice a bit.
One problem I'm having is that the audio isn't quite lined up to the "back card" note. Usually the audio just plays the last few words of that subtitled phrase, even though the initial video played the full phrases. Seems weird- and when padding, it just adds length to the initial video (which was fine!). Any thoughts?
Comment from author
Hmm, the video and audio should be in sync, i.e. if the video plays the full subtitled phrase, the audio should play the same full subtitled phrase too. The only difference is that when the audio is playing with mpv, the video window won't be shown.

Something similar to the issue might happen if the Audio and Video fields are different since the add-on will use the Audio field, when playing the audio, and the Video field, when playing the video, but I'm not sure how it could have happened. They should be in sync too.

Maybe, if you could upload your video/audio file with subtitles somewhere, maybe https://wetransfer.com or https://send.firefox.com or something else, put a link in a reply or send it to me by email <kelciour@gmail.com>, and I could reproduce it myself, it would help to shed some light on the issue.
on 1592279930
Is it possible to autocreate cards only with difficult words like here?

-- https://ankiweb.net/shared/info/1152823001

Also does it work only for english?
Comment from author
It's language agnostic and the main options should work just fine for every language as long as subtitles in UTF-8.

For English, and maybe other languages too, the add-on can join a few short subtitles into one long subtitle if it's just one long sentence. The implementation is very naive, it might work for other languages or maybe it's something that can be improved.

About the option to autocreate cards only with difficult words, it won't be a problem to make a separate add-on to do something similar using data from wordfreq - https://github.com/LuminosoInsight/wordfreq - and maybe some other data, since it might be useful on its own, and movies2anki could rely on it to skip making some cards, but it'd be low priority and not something that I can do this or next month before I could clear up my backlog a bit and make a few new add-ons.

- Create subs2srs cards with LDOCE and mpv video player - https://ankiweb.net/shared/info/1937423705
- Import from LDOCE English Dictionary - https://ankiweb.net/shared/info/534294513
- Batch Create Sentence Cards from Books - https://ankiweb.net/shared/info/1200382751
- Convert AudioBooks to Anki - https://ankiweb.net/shared/info/1885548963
on 1591800878
Great!!
I like to use it with the movie2anki software on GitHub (https://github.com/kelciour/movies2anki) for different purposes. One save space on my Anki collection, the second gives audios and videos (if necessary) I want.
on 1591622816
I use this add on to not only learn new languages but to also help remember videos that I find interesting (could be movies, youtube videos or even some lecture videos).

Has changed my life, this add-on.
on 1591348229
I can't recommend this enough; and I can't thank the creator of this add-on enough. For countless reasons, this is one of the most amazing things I have seen done to utilize modern tech to help people learn.
on 1590648308
I think this is one of the most interesting addons for ANKI. I have been using this addon daily for the past month or so, and I can't recommend it enough. It is a wonderful way to learn and enjoy new languages.
on 1590496064
Great Addon.
on 1590428903
Generate Video Cards works fine.

Generate Mobile Cards worked for two days, now an error


Anki 2.1.26 (70784154) Python 3.8.0 Qt 5.13.1 PyQt 5.14.1
Platform: Mac 10.15.4
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2020-05-25 18:14:50
Причиной могли послужить: ⁨Watch Foreign Language Movies with Anki⁩

Caught exception:
Traceback (most recent call last):
File "/Users/vladikov/Library/Application Support/Anki2/addons21/939347702/player.py", line 525, in run
output = check_output([ffprobe_executable, "-v", "quiet", "-print_format", "json", "-show_format", "-show_streams", "-select_streams", "a", note["Path"]], startupinfo=si, encoding='utf-8')
File "subprocess.py", line 411, in check_output
File "subprocess.py", line 512, in run
subprocess.CalledProcessError: Command '['/usr/local/bin/ffprobe', '-v', 'quiet', '-print_format', 'json', '-show_format', '-show_streams', '-select_streams', 'a', '']' returned non-zero exit status 1.
Comment from author
If "Generate Mobile Cards" works in a new profile (File - Switch Profile), maybe the original video file has been renamed, moved to a different folder or deleted.

Otherwise, I'd check that ffprobe can be found and works fine, i.e. open the Terminal app, copy-paste the following line and press Return.
/usr/local/bin/ffprobe -version

If there's any error, I'd suggest to try to reinstall ffmpeg via brew, i.e.
brew reinstall ffmpeg

Maybe something wrong with brew. Maybe try to run:
brew doctor
on 1590324807
Great work!
Absolutely Love it.

I can see how much efforts you put into this, really appreciate it.
on 1589787227
Works Great! Thank you very much! I can't imagine how much effort has been put into this add-on!
on 1589585720
Debug info:
Anki 2.1.15 (442df9d6) Python 3.6.7 Qt 5.12.1 PyQt 5.11.3
Platform: Windows 10
Flags: frz=True ao=True sv=1

Caught exception:
File "C:\Users\Ian\AppData\Roaming\Anki2\addons21\939347702\player.py", line 525, in run
output = check_output([ffprobe_executable, "-v", "quiet", "-print_format", "json", "-show_format", "-show_streams", "-select_streams", "a", note["Path"]], startupinfo=si, encoding='utf-8')
File "subprocess.py", line 336, in check_output
File "subprocess.py", line 403, in run
File "subprocess.py", line 709, in __init__
File "subprocess.py", line 997, in _execute_child
<class 'FileNotFoundError'>: [WinError 2] The specified file could not be found



Any ideas on how to solve it? Cannot generate mobile cards.
Comment from author
Please download FFmpeg from https://ffmpeg.zeranoe.com/builds/ if you didn't do it already, unpack it somewhere and update the PATH environment variable (either in the User or System variables) by adding the path to the folder that contains ffmpeg.exe and ffprobe.exe - https://streamable.com/2b1l6 - and restart Anki.
on 1589357781
Thanks a lot for your amazing addon. This was really easy to use and helpful.

I was wondering if it is possible to disable auto-play of the audio for just the back of the card?
Comment from author
Yes, it's possible to disable auto-play of the audio for just the back of the card, but at the moment it might be a bit complicated or quite easy.

1. If you already have the same audio on the front side, you can disable it on the back side by using {{FrontSide}} instead of {{Field}}. You should be able to still play the audio on the back side manually.

> FrontSide will not automatically play any audio that was on the front side of the card. If you wish to have the same audio play automatically on both the front and back of the card, you’ll need to manually include the audio fields on the back as well.

https://docs.ankiweb.net/#/templates/fields?id=special-fields

2. If it's about this add-on and you're on Anki 2.1.22+, i.e. it probably won't work with Anki 2.1.15, you can use HTML5 Audio tag (<audio>) in the card template with the {{Audio}} field, i.e. something like <audio controls src="{{Audio}}">, but to make it work you'd need to also use Tools - Generate Mobile Cards. i.e.

2.1. Edit the card template and replace the following line in the Back Template
[sound:{{Audio}}]
with
<audio controls src="{{Audio}}" />
2.2. Use Tools - Generate Mobile Cards

HTML5 Audio isn't officially supported by Anki at the moment and seeking controls won't work, it probably only works on AnkiDroid at the moment, but the audio can be played manually.

If there're any problem, please let me know.
on 1589343939
I love it, very useful
on 1588642090
Solve this writing problem

Еде ФнБ Эн ЗбЮбИ
Comment from author
If I remember correctly, the error very likely was caused by subtitles in cp1251 encoding and saving them in utf-8 would most certainly fix it. The latest version of the add-on should be able to import subtitles in cp1251 encoding, but it might be removed or improved in a new version of the add-on.
-------------------------------
If there's some problem with the add-on, I'll try to help, but if I can't reproduce it or I don't understand why it's happening, it might be difficult for me to fix it.
-------------------------------
I'm not sure why it's happening and how to reproduce it. Maybe your .srt subtitles aren't valid or the add-on has a bug.
- Try to resave your .srt file with Aegisub, i.e. open your .srt file with Aegisub and use File - Export Subtitles to save it with .srt extension. Or maybe with Subtitle Edit.
- Try to open your .srt file in any text editor and remove some extra lines from the start of the file until the first number with the timestamp.
on 1588364117
I just love this.
on 1588090092
Don't work.
Comment from author
It's been a few months and I don't know if you receive the updated message or not, but maybe give it another try and if something doesn't work or maybe not clear, just let me know.
-----------------------------------------
I'd try to be a bit more specific.

- What OS are you on? It's Windows, Linux or Mac?
- What's your Anki version (Help - About)?
- What doesn't work?

As long as you have ffmpeg and mpv installed, the add-on should work. If there's any error, please let me know.
on 1587844183
really cool add-on. I was looking this something like this a long time.
on 1587684090
This add on is genius and such a great tool for language learning.

Btw it was working perfectly for me before, however for some reason now the video doesn't come up and only the audio is playing. Can't figure out what the issue could be.

Edit: It's been fixed with the new update. Thanks for responding so quickly.
Comment from author before post was edited
Thank you. Please try the latest version (Tools - Add-ons - Check for Updates).
on 1587660795
Thank you for your helpful supports.
on 1587648163
Wonderful!
on 1587642826
Really Fabulous.
He's so passionate. If you ask him for help, he will revise it and release the updated version.
I just want to thank him for his hard work.
Comment from author
Thank you very much for your kind words. I really appreciate it.
on 1585199562
Please help me. There still are some problems when I want to generate mobile cards. Thanks!
Anki 2.1.15 (442df9d6) Python 3.6.7 Qt 5.12.1 PyQt 5.11.3
Platform: Mac 10.15.3
Flags: frz=True ao=True sv=2
相关扩展:Watch Foreign Language Movies with Anki

Caught exception:
File "/Users/samanthanlee/Library/Application Support/Anki2/addons21/939347702/player.py", line 488, in run
time_start, time_end = re.match(r"^.*?_(\d+\.\d\d\.\d\d\.\d+)-(\d+\.\d\d\.\d\d\.\d+).*$", fld).groups()
<class 'AttributeError'>: 'NoneType' object has no attribute 'groups'
Comment from author
Please use Tools - Add-ons - Check for Updates to update the add-on and restart Anki. It won't fix it, but at least it will give a bit more information about the error and other notes will still be processed.

The add-on depends on the Audio field, e.g. Tangled_(2010)_00.26.43.226-00.26.47.019.mp3, it populates automatically, and usually shouldn't be edited. Maybe this field was accidentally edited since the add-on isn't smart enough to prevent it from happening.
on 1584317598
Your addon is superb!
May I have a question?
The audios aren't mp3 or any other kind of audio files, they are appointments of where the audios begin and finish.
My question is: Are there any way to convert these appointments in mp3 files?
I know that the program subs2srs do that but this program doesn't allows me to edit the files as your addon allows.
Comment from author
Yes, to generate mp3 files just use Tools - Generate Mobile Cards.
on 1582443273
Thank you for the great work! And I'm having some problems.

1. The video only plays when I press Ctrl+R (DEFAULT HOTKEY). When I press the replay button, I thought it would play the video but actually it only plays the audio. Is this because I did something wrong? (Platform is Windows 10.)
2. Also, I'm not sure what the "Pad timing" is for. Should I just keep it both default as 250 ms?

Your help would be much appreciated.

I just found it works perfectly on Ankidroid after I generate mobile cards and stuff- video play by itself. This is even better than on Windows 10 laptop.

update:
Yes, it worked perfectly with both Ctrl+R and replay button this morning. Now, however, when I try Ctrl+R, weirdly there's an error (the video still can play with replay button). Could you please help me check where it went wrong.


Debug info:
Anki 2.1.20 (47a1bf8b) 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-02-22 12:49:03

Caught exception:
Traceback (most recent call last):
File "C:\Users\AppData\Roaming\Anki2\addons21\939347702\player.py", line 354, in replayVideo
from aqt.qt import debug; debug()
File "aqt\qt.py", line 35, in debug
File "bdb.py", line 92, in trace_dispatch
File "bdb.py", line 151, in dispatch_return
File "pdb.py", line 292, in user_return
File "pdb.py", line 355, in interaction
File "pdb.py", line 320, in _cmdloop
File "cmd.py", line 126, in cmdloop
RuntimeError: input(): lost sys.stdin


Also, when generating cards, I wonder what is the difference between movie and phrase.
------------------------------
Yes, it works perfectly! Thank you so much for your effort and patience!
Comment from author before post was edited
Thank you. Please update the add-on. I forgot about "from aqt.qt import debug; debug()" and didn't remove it. It's fixed now and Ctrl+R should work the same way as before.
-------------------------------
For phrases, the add-on will only use timings from the subtitles to generate cards, i.e. everything that doesn't have subtitles will be ignored like the start of the video or scene changes where usually no one speaks and there are no subtitles.
For movie, the add-on will change the subtitles' timings to make them continuous to be able to watch the video from start to finish without missing anything, i.e. the end time of each line in the subtitles will be changed to match the start time of the next line.
-------------------------------
No, nothing wrong. I'm sorry, it's just that I thought the add-on would work just fine with Anki 2.1.20, but it didn't. I've updated the add-on. Could you please use Tools - Add-ons - Check for Updates to update the add-on and let me know if it works or not?

About the padding, if it's set to 250 ms it means that the audio will start 250 ms earlier or end 250 ms later. With correct timings in the subtitles, there's no need to change this option very much, I think. With Gap between Phrases set to 1.25 seconds, I used 750 ms padding.
on 1581106374
Works fine with very well-timed subtitles. Extra padding is necessary with less good ones, but then I need to add context manually.
on 1580949983
This is an excellent addon but I'm having some issues since the beggining of the week
That's the error message when I try to generate the cards:

Anki 2.1.15 (442df9d6) Python 3.6.7 Qt 5.12.1 PyQt 5.11.3
Platform: Windows 10
Flags: frz=True ao=True sv=1

Caught exception:
File "C:\Users\renat\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 1483, in start
self.startSingleMode()
File "C:\Users\renat\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 1596, in startSingleMode
self.model.create_subtitles()
File "C:\Users\renat\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 905, in create_subtitles
add_pad_timings_between_phrases(self.en_subs_phrases, self.shift_start, self.shift_end)
File "C:\Users\renat\AppData\Roaming\Anki2\addons21\939347702\movies2anki.py", line 430, in add_pad_timings_between_phrases
(start_time, end_time, subtitle) = subs[0]
<class 'IndexError'>: list index out of range

Could you help me please?
Comment from author
It seems like the subtitles file is empty.

If it's not empty, could you open it in Aegisub and then use File - Export Subtitles to save it with UTF-8 encoding using the filename that ends with .srt, or just edit one subtitle line by adding a space to the end of the line or something similar to make Aegisub think that file has changed (there're will be an asterisk in the window title, i.e. "* Balto (1995).srt" instead of "Balto (1995).srt") and then press Ctrl+S, the file will be saved with UTF-8 encoding.
on 1579467975
I've been waiting this for so many years.

Thank you for the great work!
on 1578925658
Amazing, thanks!
on 1578063588
Great
on 1576418283
Works very well, saves a lot of time
on 1576405678
This is the best addon for Anki!!! Thank you so much!!!
I noticed some interesting things
1.On my PC with windows 10 video plays not by mpv player, but by VLC. And VLC works perfectly. Maybe this addon uses VLC, because I installed mpv player incorrect.
2.On my laptop with WIndows 7 video played by mpv player, but video freezed all the time - it was impossible to watch. I tried to remove mpv player, and video opened by VLC. But it opened in minimazed window, and I had to maximaze it. The next day I installed videodrivers on my laptop and mpv player started to work without freezing and lags.
Comment from author
Thank you for the feedback!

That's great to know that VLC works perfectly! I thought about removing it after updating the add-on to Anki 2.1 because on my laptop and PC it didn't work as well as mpv.

Yes, the add-on only tries to play video using VLC if it couldn't find mpv executable in the PATH environment variable. It can be checked by pressing Win+R, type "cmd" (without double quotes) to open Command Prompt, then type "mpv" (without double quotes) and press Enter. The output should be something like
> mpv 0.30.0-195-gb31f2f6cb9 Copyright © 2000-2019 mpv/MPlayer/mplayer2 projects
but I guess the output will be something like
> "mpv" is not recognized as an internal or external command...
In this case, just update the PATH environment variable to make sure that it contains the path to the folder with mpv.exe and restart Anki.
- https://streamable.com/2b1l6
- https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/
on 1575806373
Great Work! Thank you.

I have a problem that when I use the option "movie2anki - subs2srs" , and there is no snapshots .

My OS is Win10.
Comment from author
It looks like the add-on couldn't find FFmpeg. If you press Win+R, type cmd, press Enter, type ffmpeg and press Enter, there should be an error message: 'ffmpeg' is not recognized as an internal or external command...

In this case, if you have FFmpeg already downloaded from https://ffmpeg.zeranoe.com/builds/, please check the PATH environment variable, it should contain the full path to the folder with ffmpeg.exe, e.g. C:\Programs\ffmpeg\bin

Or maybe install FFmpeg with https://chocolatey.org/ i.e. right-click the Start button, Windows PowerShell (Admin), "Do you want to allow this app to make changes to your device?" - Yes, copy "Now run the following command:" from https://chocolatey.org/install page, right-click in the Windows PowerShell window to paste the copied text, press Enter, wait a couple of seconds, then type "choco install ffmpeg" without double quotes to download FFmpeg, wait a couple of seconds for a confirmation message, "Do you want to run the script?" - type Y and press Enter, that's it, there's no need to update the PATH environment variable, just restart Anki.
on 1575058311
thanks for update!
on 1574537899
I just don't know how I can express my appreciation.
on 1571547226
Hello, please update for support Anki 2.1 last version. Please~~~
Comment from author
Hi! It's been updated to Anki 2.1. Please let me know if there're any problems.
on 1554110137
Hi, Please update add-in, for support Anki last version.
Comment from author
Hi, I've updated the add-on to Anki 2.1! Please let me know if there're any problems.
on 1550175971
Thank you so much for this add-on. It is such a life saver !!!
I have always wanted to learn languages with movies because they have all the good stories and contexts
but its a waste of time to watch a whole thing over and over again.
on 1545962513
So inovative!
on 1539858425
That's amazing
on 1538093143
For those of you guys using subs2srs, give this add-on a solid look. It's much better if you ask me.