Using stories lib in video compression scenario#14256
Conversation
|
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
|
You can test the changes on this Pull Request by downloading the APK here. |
| String strSavingsKb = new DecimalFormat("0.00").format(savingsKb).concat("KB"); | ||
|
|
||
| // make sure the resulting file is smaller than the original | ||
| if (savings <= 0) { |
There was a problem hiding this comment.
Would it be nice to delete the produced file in mOutputPath, once we realize we're not going to be using it after all?
There was a problem hiding this comment.
Good point 👍 ! if you agree I created a dedicated issue for this here
| package org.wordpress.android.ui.uploads | ||
|
|
||
| // TODO: move here the VideoOptimizationListener interface and ProgressEvent. Leaving them in their original | ||
| // position for now to not change the files as they are |
There was a problem hiding this comment.
👍 agreed, it might be good to have them together
There was a problem hiding this comment.
Moved interfaces and data classe used by them to VideoOptimizerContracts.
| VideoFormatMimeType.AVC, | ||
| bitrate * 1024, | ||
| 2, | ||
| 96 * 1024, |
There was a problem hiding this comment.
Could we maybe move these to constants and add a comment next to each one, explaining the reasoning why these values are passed like this?
Also wondering, could it be possible that we need to pass any other values or will this work universally?
There was a problem hiding this comment.
Not a great study behind that tbh 😄 ....I basically just tried to use the set of parameters that were used (as a fixed set like here) in the previous implementation. Added a comment in the code that hope can help to clarify, let me know 🙇
There was a problem hiding this comment.
thanks for your answer! sounds good 👍
mzorz
left a comment
There was a problem hiding this comment.
Nice work here @develric 👏
Left a few comments but overall nothing really pressing to change. Already reviewed and approved the Stories PR Automattic/stories-android#652 so feel free to tackle the comments here and merge after everything is up to date with develop.
Ping me once it's updated (or let me know and I can open a new PR to update with develop, against your branch), so I can give it another good pass on both PRs 👍
# Conflicts: # WordPress/build.gradle
|
Hi @mzorz 👋 , merged from develop and followed up to your feedbacks, let me know wdyt 🙇 |
mzorz
left a comment
There was a problem hiding this comment.
Awesome job @develric, took the liberty to update the stories library hash after merging PR Automattic/stories-android#652 first in b56413c, leaving the same summary of things tested here as well so it's easier to track later.
Pixel 4a:
- tried with videos on device of a size smaller than the optimize target, verified the original file is returned
- tried with videos on device of a size larger than the optimize target, verified the conversion happens
- tried with videos on google drive, also worked fine for both cases above
- Also tested the optimizer gets called as well for videos being added to Stories (kind of schroedinger cat), and verified it plays along well with the web player (i.e. when you upload a video and add text to a video story slide, the mp4composer will be used once to process the new video, then called another time for optimizing)
- Also tested turning optimization off, verified it doesn't go through the mp4composer optimization process.
Samsung J2:
- tried with videos on device of a size smaller than the optimize target, verified the original file is returned
- tried with videos on device of a size larger than the optimize target, verified the conversion happens
- Also tested turning optimization off, verified it doesn't go through the mp4composer optimization process.
Generated by 🚫 dangerJS |
This PR aims to use the stories library to manage the video compression/optimization scenario in WPAndroid.
Companion stories PR in Automattic/stories-android#652
NOTE: the feature flag currently is disabled, and it
coversthe video compression only part. The stories lib modifications are not feature flagged so we need to test them well to avoid regressions or issues since we will not be able to remote disable the changes. Once we are ok with testing of stories and video compression we can decide to merge this PR and create another dedicated PR to activate the flag for video compression in production. We will keep the flag so that we can monitor the release and eventually disable remotely the video compression feature, falling back to the original implementation of the video compression.To test
The feature is behind feature flag, you need to activate the
MP4_COMPOSER_VIDEO_OPTIMIZATIONin App Settings > Test feature configuration, then restart the app to make the flag active.Also please turn on
Optimize Videosoption in App Settings.Stories use case
First things first 😄 , we need to test the stories scenarios to make sure no issues are introduced by the changes
Video compression ON
Optimize VideosandMP4_COMPOSER_VIDEO_OPTIMIZATIONwp-<auto created unique id>.<video format extension>Video compression OFF
Optimize VideosandMP4_COMPOSER_VIDEO_OPTIMIZATIONis ONwp-<auto created unique id>.<video format extension>Check everything works if feature flag is off
PR submission checklist:
RELEASE-NOTES.txtif necessary.