animebook / animebook.github.io

In-browser video player for learning Japanese with subtitles
https://animebook.github.io
MIT License
273 stars 29 forks source link

FFMpeg error when adding screenshots #80

Open temccarthy opened 1 year ago

temccarthy commented 1 year ago

Every time I try to add a screenshot to an anki card, I get this error: image

I've tried restarting the browser (I'm running Thorium Version 105.0.5166.0), restarting Anki, restarting my computer, but nothing has worked.

soamsy commented 1 year ago

Can I see your settings? You can grab the json for your settings in the extension page by clicking "Export Settings".

Also, it may be worth looking at the Chrome DevTools console output by hitting F12 and seeing what shows up there when you record a flashcard. FFmpeg will often hide the real issue in there.

temccarthy commented 1 year ago

Here's my settings:

{
  "ankiBrowserFinalDisplay": "currentDeck",
  "ankiBrowserFinalQuery": "deck:current",
  "ankiDeck": "Master deck::Anime Mining",
  "ankiFieldTemplates": [
    {
      "behavior": "replace",
      "field": "wordDictionaryForm",
      "value": ""
    },
    {
      "behavior": "replace",
      "field": "sentence",
      "value": "{sentence}"
    },
    {
      "behavior": "replace",
      "field": "reading",
      "value": ""
    },
    {
      "behavior": "replace",
      "field": "definition",
      "value": ""
    },
    {
      "behavior": "replace",
      "field": "wordAudio",
      "value": ""
    },
    {
      "behavior": "replace",
      "field": "sentenceAudio",
      "value": "{sentence-audio}"
    },
    {
      "behavior": "replace",
      "field": "picture",
      "value": "{screenshot}"
    },
    {
      "behavior": "replace",
      "field": "pitchAccent",
      "value": ""
    },
    {
      "behavior": "replace",
      "field": "frequency",
      "value": ""
    }
  ],
  "ankiModel": "Eminent V2.4",
  "ankiServer": "http://127.0.0.1:8765",
  "ankiVocabField": "wordDictionaryForm",
  "audioClipFade": 0.2,
  "audioClipPadding": 0.5,
  "audioFfmpegFlags": "",
  "audioPlayback": "none",
  "audioVolumeMultiplier": 1,
  "forvoAudioPlayback": "none",
  "forvoAudioVolumeMultiplier": 1,
  "gifFPS": 6,
  "imageFfmpegFlags": "",
  "imageFormat": "png",
  "imageResizeHeight": 720,
  "imageResizeSelection": "height",
  "imageResizeWidth": 1280,
  "imageTiming": "middle",
  "newlineBehavior": "divs",
  "sentenceReplacements": []
}

Looking at devtools it looks like a missing audio encoder image

As a feature request, maybe you could add an indicator somewhere that says whether the video/audio codec is supported by FFMpeg or the browser