Support for various file types (ogg, mp4, html5)

I’m a bit new to ios and I just bought ankimobile today from the app store. After some googling I found out that the iphone and ipad have never supported ogg. I make the majority of my flashcards directly from mpv (mpvacious and a similar subs2srs add-on), so I’m trying hard to keep the study process flowing. I can change the outputs to mp3 for now, but since I’ve read that VLC manages to play ogg files on ios, I’m wondering if this is a feature that can be implemented.

Additionally, I’ve been able to create some video flashcards but they’re not playing on my iphone at all. I can cut mp4 files directly into a flashcard and these types of videos work on my ankidroid app. But it’s also not running on ankimobile.

Any solution for either of these issues? (Besides getting another android phone?)

About mp4 not working on AnkiMobile, it’s odd, considering it was added as [sound:filename.mp4], everything was synced and Tools > Check Media doesn’t report anything missing. Just in case, I’d probably make a new card using this bigbuckbunny.mp4 file as it should work on AnkiMobile, and if it works maybe MediaInfo could give some hints why the original video file doesn’t work on AnkiMobile.

About ogg,

According to Apple adding WebM audio codec support to Safari with iOS 15 - 9to5Mac

Safari in iOS 15 Beta 5 adds support for the HTML5 “audio” tag to play the Opus audio codec (only) inside of a standalone MP4 file (only).

I don’t have an iPhone, but here’s a sample deck for anyone who’d like to test bbb-opus.mp4 with AnkiMobile. It’s about 10MB. The front side contains the audio file added as [sound:audio.mp4] and the back side contains HTML5 Audio that is not officially supported and might not work, or might work but autoplay by default won’t work.

изображение

1 Like

Thanks for the thoughtful reply. That’s a bit of a bummer about ogg, but I understand.

I have in fact managed to get certain mp4s to play and others have not. I was wondering if the file name with lots of spaces and periods could be the culprit.

But I’m just now testing this and it seems to play some files and not others. For example I’ve renamed my file to: Lost in 1949 01. It shows up as Lost_in_1949_01_00.01.17.080-00.01.40.800.mp4. It plays just fine on windows and linux desktop and on ankidroid. However, it doesn’t play on my iphone or ipad.

So that doesn’t seem to explain the issue. I’ve got another file with the same exact title formatting (that also adds in the extra numbers and periods) and it works on my iphone. Are all mp4 files not created equal? In any case, it’s strange that it would play on every other platform but ios.

I’ve tested your bbb-opus.mp4 file and neither the front side or the back side worked for me. The back side gave me an error. The front side loads, but doesn’t play anything. It’s the same issue I’ve had for other mp4s that aren’t playing.

Edit: I think it’s just a missing files issue. I went to tools > check media and found that 88 files are missing. How do I make sure they end up in the media folder? The missing files are mostly webp files. There’s also some jpg and mp3.

Please see Media files may take time to sync - Frequently Asked Questions

1 Like

Well unfortunately it’s not that simple. The media sync is completed. It’s still not playing the videos we’ve discussed, including the opus file.

About the opus file in mp4 container, thank you very much, really appreciate it, but since it failed to play, I think it’s not available for iOS developers yet and for now only works in Safari (as the “WebM Web Audio” experiment according to 9to5Mac).

About the videos, since some videos do work on AnkiMobile and there are no syncing issues, aside from comparing two video files (“good” and “bad”) for any difference in the encoding settings (with ffmpeg or MediaInfo), I can only suggest to try re-encoding one or two “bad” video files using iTunes, ffmpeg or HandBrake with encoding settings for old phones, just for testing.

For ffmpeg (how to use it on Windows), it’s probably something like this.

ffmpeg -i in.mp4 -c:v libx264 -profile:v baseline -level 3.0 -vf format=yuv420p -c:a aac -movflags +faststart output.mp4

For HandBrake, choose a preset “Apple 540p 30” and re-select “MP4” as otherwise the output file will be saved as .m4v (or change Preferences → Output Files → MP4 File Extension).

For testing purposes, it might be a bit better to create a new Basic card and add a new video file.

Anki will synchronize any sounds and images used by your notes. It will notice when media has been added or removed from your media folder, but will not notice if you have edited some existing files without adding or removing any. To get your edits noticed, you need to add or remove a file as well.

https://docs.ankiweb.net/syncing.html#media

1 Like

You said earlier that check media was reporting missing files. If the sync has since finished, no files are reported as missing anymore, and the videos still refuse to play, that does seem to imply that iOS’s webview doesn’t currently support them.