OnFailure - called when an exception occurred or video bitrate and size are below the minimum required for compression.OnSuccess - called when compression completed with no errors/exceptions.OnStart - called when compression started. ![]() The method has a callback for 5 functions Then just call and pass context, uris, isStreamable, configureWith, and either sharedStorageConfiguration OR appSpecificStorageConfiguration. ![]() Implementation ":kotlinx-coroutines-core: $ " Refer to the sample app for a reference on how to start compression with the right setup. To use this library, you must add the following permission to allow read and write to external storage. They might be changed based on the project needs and expectations. These values were tested on a huge set of videos and worked fine and fast with them. The compression will fail if height or width is specified without the other, so ensure you pass both values. You can as well pass custom videoHeight, videoWidth, and videoBitrate values if you don't want the library to auto-generate the values for you. VERY_HIGH -> (bitrate * 0.6).roundToInt() You can pass one of a 5 video qualities VERY_HIGH, HIGH, MEDIUM, LOW, OR VERY_LOW and the library will handle generating the right bitrate value for the output video This becomes handy if you don’t want the video to be compressed every time it is to be processed to avoid having very bad quality after multiple rounds of compression. When the video file is called to be compressed, the library checks if the user wants to set a min bitrate to avoid compressing low resolution videos.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |