Hi, I am using the movies2anki addon to convert a YouTube video into Anki cards. I am trying to embed a downloaded Youtube video (webm), that is hardcoded in target language subs.
The problem I have been running into is the embedded video does not play and remains blank while the audio sometimes plays. See below.
The webm video is in my collection under Anki roaming.
The add-on can’t show the video as embedded, and to make it work, the video file needs to be split and encoded as separate video clips in the collection.media folder (.webm for Desktop, .mp4 for AnkiMobile, .webm/.mp4 for AnkiDroid).
The desktop version of Anki only supports .webm video as embedded. At first, use the add-on to make a new deck with .webm video references, then use Tools > Generate Mobile Cards to generate .webm video clips in the collection.media folder and either use the existing note type or change the note type to another one (and remove some fields if they are no longer needed).
At first, go to Tools > Add-ons > Watch Foreign … > Config and change “video extension” from “mp4” to “webm” (or use Find > Replace from the card browser to replace .mp4 with .webm in the Video field)
Make a deck using “movies2anki - subs2srs (video)” note type (to generate notes and video posters)
Use Tools > Generate Mobile Cards (to generate .webm video files in the collection.media folder). The .webm encoding is a few times slower than .mp4 and it might take some time.
If you try to review a card, the video should be embedded now. To stop autoplay on the back, open the Back Template and remove “autoplay” from the first line (<video … autoplay …>). The tags (to replay the video by clicking anywhere on the page) doesn’t seem to work properly and it might be better to update the Front/Back Template using this code - movies2anki - subs2srs (video) v1 FIX · GitHub - or maybe change the note type to Harry Potter (French Dub) from Reddit - Dive into anything
MacOS users:
If you’re on Mac, it’s better to additionally install mpv or ffmpeg via brew and restart Anki. Otherwise, Tools > Generate Mobile Cards might fail to encode mp3 and mp4 and will only work with opus and webm, because the mpv version that is packaged with Anki doesn’t seem to have libmp3lame and libx264 encoders built-in.