-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce the size of "mvid" file #22
Comments
There is a trade off, if the mvid is compressed then it takes longer to write and longer to read. But, there is already support for it built in. Take a look at the example named AVRender here http://www.modejong.com/AVAnimator/examples.html#AVRender , see how this class makes use of the define HAS_LIB_COMPRESSION_API. The resource loader classes support an optional BOOL named compressed, if this is set to TRUE and HAS_LIB_COMPRESSION_API for iOS 9 and newer then the MVID will be written as a compressed stream. This uses a lot less disk space but it uses more CPU and writing and reading the resource the first time. |
I am using AVAssetJoinAlphaResourceLoader to decompress a MP4 video to a "mvid" file , and the JoinAlphaResourceLoader does not have the "compressed" property.
Sorry I did not find the place where these two properties specifically used in. I tried to code like this :
But still don't work. |
I have now updated the impl of AVAssetJoinAlphaResourceLoader to properly support a compressed flag. This results in about 10x smaller files. For example, the Explosion video in the kitty boom example goes from 186793 kB down to 20201 kB. (200 megs to 20 megs). Please give it a try and let me know is that is working for you. Also, if you would like to include AVAnimator in a commercial app then feel free to contact me about a license. |
TBD, include compression in AVAssetMixAlphaResourceLoader. |
I tried it. After compressed, the "mvid" file's size reduce to 22MB from 71MB. It do helped. |
First of all thanks to AVAnimator such a good framework allows me to synthesize beautiful video.
I used a video with alpha chanel as a filter to cover an image, so users will always switch filter(video) to preview,
But as a middleware generated file,mvid is too large, and some even reached 200MB.
I have done zip compression, the size will be reduced to 1/10, but the speed in decompression is unstable, can not reach a quick preview.
Is there a better way to reduce the size of the "mvid" file?
The text was updated successfully, but these errors were encountered: