media_compress_kit 0.1.0
media_compress_kit: ^0.1.0 copied to clipboard
Compress images and videos with native encoders (Media3, AVFoundation): size limits, progress, cancel, batch, URLs, estimates, no-permission picker.
0.1.0 #
- Initial release.
MediaCompress.compressImage: upright (EXIF orientation), scaled to fit, JPEG, PNG, WebP (Android) or HEIC (iOS), amaxSizeKBlimit, and metadata removed, kept without GPS, or kept.MediaCompress.compressVideo: quality presets, resolution, bitrate, frame rate, H.264 or HEVC, trimming, removing audio, and amaxSizeMBlimit with extra passes when the encoder overshoots. HDR becomes standard dynamic range.onProgressfrom 0 to 1 and cancelling with aCompressController, for images, videos and batches.MediaCompress.compressAll: photos and videos together, a few at a time, with overall progress and a result or error per file. AnoutputPathis a folder there, with each result named after its input. The same path or URL twice is compressed once.MediaCompress.estimateImageandMediaCompress.estimateVideo: the result's size and dimensions before compressing.MediaCompress.pick: the system photo and video picker, with no permission.- URLs: compress,
getInfo,thumbnailandcompressAlltakehttps://links, downloaded with progress, cancel andheaders;MediaCompressError.networkfor failed downloads. - Returns the original instead when compressing wouldn't make it smaller.
MediaCompress.getInfo,MediaCompress.thumbnailandMediaCompress.clearCache.- Android: Media3 Transformer,
content://URIs. iOS: AVFoundation and ImageIO, Swift Package Manager and CocoaPods.
