Embed webm into Anki via movies2srs

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.

image

The webm video is in my collection under Anki roaming.

The HTML settings of the card are below.

image

The fields are below as well.

The video field has webm at the end of the name.

I honestly can’t seem to figure this out so any help is appreciated :slightly_smiling_face:

1 Like

Have you tried this method from Watch Foreign Language Movies with Anki # movies2anki comments

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).

  1. 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)
  2. Make a deck using “movies2anki - subs2srs (video)” note type (to generate notes and video posters)
  3. 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.
  4. 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.

1 Like

Perhaps a full path to the file cannot be used.(such as “C:\Users\shigeyuki\Desktop\movie01.webm”)

  1. Put the files in the “collection.media” folder
  2. use “movie01.webm”

I tried that but no luck :frowning:

Codes like <source src="{{Source}}"> will not work.
It must be input like <source src="Source01.webm"> in the HTML of the field.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.