Feature workaround avi
Purpose / Description
.avi media file playback
Fixes
Fixes #15772
Approach
We used the ffmpeg LTS library to enable codec conversion in the .avi file. This is a workaround. To enable .avi conversion the new advanced setting must be enabled. When enabled, when a .avi file is imported, its codec is transcoded into H.264. Although not an ideal implementation (would be best to implement the actual codec), the performance impact doesn't hinder the user experience in a significant way. A 46 second HD video takes ~2-3 seconds to convert during the import in a 2022 Samsung Tab S6.
How Has This Been Tested?
We created tests to test correctness of file paths and to test if the conversion occurs only when the advanced preference is enabled and when the file has the .avi extension.
Links to blog posts, patterns, libraries or addons used to solve this problem https://github.com/arthenica/ffmpeg-kit https://developer.android.com/media/platform/supported-formats
Checklist
- [X] You have a descriptive commit message with a short title (first line, max 50 chars).
- [X] You have commented your code, particularly in hard-to-understand areas
- [X] You have performed a self-review of your own code
- [X] UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
- [ ] UI Changes: You have tested your change using the Google Accessibility Scanner
Co-authored-by: Bernardo Galante [email protected]
Message to maintainers, this PR contains strings changes.
- Before merging this PR, it is best to run the "Sync Translations" GitHub action, then make and merge a PR from the i18n_sync branch to get translations cleaned out.
- Then merge this PR, and immediately do another translation PR so the huge change made by this PR's key changes are all by themselves.
Read more about updating strings on the wiki,
Have you researched or tried another approach? ~2-3 seconds doens't seem like a good experience to me. Specially if this happens in many cards.
Also, how much that library impacts the app in terms of APK size?
Old APK size: 70742716 New APK size: 99845507
I'm going to "draft" this one so it is out of the queue as it is not actionable in the current state It appears that 2.17 used to work because we used an external webview
Perhaps with the javascript add-on system you could make a javascript add-on for the reviewer that looked for .avi media elements, and if it saw them it rewrote that part of the HTML using DOM tricks in javascript such that it would send the avi to an external media player?
IIRC, the Android Media3 library will be introduced in @criticalAY's GSoC project. From a quick glance, it has a richer external player than the one we used. Maybe it can be used for solving that (I'm leaving the onus of researching to the PR authors)
Yep! will use it for audio and video attachments
Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically