Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
7beb46a
Upgrade to Flutter Android Plugin API V2
ppornkitpras-agoda Sep 28, 2020
9dc4665
Handling includeAudio on Android
rafalplonka Sep 29, 2020
aee991c
Merge pull request #46 from snowb1shop/patch-1
jonataslaw Oct 14, 2020
6f6864c
[Android, LogLevel] Support for control over log level printings in A…
yanivshaked Oct 14, 2020
1cddeb9
Merge branch 'master' of https://github.com/jonataslaw/VideoCompress
yanivshaked Oct 14, 2020
f8bb8db
[Android, cancelCompression] Support for cancelling compression proce…
yanivshaked Oct 14, 2020
ce37a59
Merge pull request #50 from yanivshaked/feature_AndroidCancelCompress
jonataslaw Oct 14, 2020
8802edd
Merge branch 'master' into flutter-v2-plugin-upstream
jonataslaw Oct 14, 2020
8051285
Merge pull request #44 from dhitiwatAgoda/flutter-v2-plugin-upstream
jonataslaw Oct 14, 2020
54074aa
docs: update README.md [skip ci]
allcontributors[bot] Oct 14, 2020
d5a1ecf
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Oct 14, 2020
f502a12
Merge pull request #52 from jonataslaw/all-contributors/add-Martibis
jonataslaw Oct 14, 2020
bb1c066
docs: update README.md [skip ci]
allcontributors[bot] Oct 14, 2020
ed815ff
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Oct 14, 2020
71085cc
Merge pull request #53 from jonataslaw/all-contributors/add-marcobraghim
jonataslaw Oct 14, 2020
1d0e107
docs: update README.md [skip ci]
allcontributors[bot] Oct 14, 2020
0c0a04f
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Oct 14, 2020
ec58de0
Merge pull request #54 from jonataslaw/all-contributors/add-ppornkitp…
jonataslaw Oct 14, 2020
7e5f6bf
docs: update README.md [skip ci]
allcontributors[bot] Oct 14, 2020
c8eb226
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Oct 14, 2020
720954b
Merge pull request #55 from jonataslaw/all-contributors/add-snowb1shop
jonataslaw Oct 14, 2020
13c190b
docs: update README.md [skip ci]
allcontributors[bot] Oct 14, 2020
087deed
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Oct 14, 2020
95e6180
Merge pull request #56 from jonataslaw/all-contributors/add-yanivshaked
jonataslaw Oct 14, 2020
64b8d97
update to version 2.1.0
jonataslaw Oct 14, 2020
9cdfed2
Merge branch 'master' of https://github.com/jonataslaw/VideoCompress …
jonataslaw Oct 14, 2020
74ff42c
fix isCompressing getter
jonataslaw Oct 14, 2020
d8861a4
update to 2.1.0
jonataslaw Oct 14, 2020
1d594ec
Fix Typo - '_progresCallback' to '_progressCallback'
ArjanAswal Oct 21, 2020
758b594
Give 'includeAudio' parameter the default value of true to make it nu…
ArjanAswal Oct 21, 2020
c6dac13
Update README.md
Oct 23, 2020
8a55ad0
Merge pull request #58 from ArjanAswal/master
jonataslaw Oct 23, 2020
4d72ec9
Merge pull request #59 from justkawal/master
jonataslaw Oct 23, 2020
6b888fc
Added video trimming on Android
jonasN5 Nov 4, 2020
4e8dd1d
update to 2.1.1
jonataslaw Nov 18, 2020
82df027
upgrade android dependencies
jonataslaw Nov 18, 2020
b94cc70
Merge pull request #70 from themadmrj/master
jonataslaw Nov 19, 2020
9bd328d
Support null safety
StarK8912 Mar 10, 2021
250ffd1
feature: added macOS support
efraespada Mar 22, 2021
eb48374
Merge pull request #96 from efraespada/master
jonataslaw Mar 22, 2021
eea4e4b
Merge branch 'master' into master
leynier Mar 29, 2021
902d921
Merge pull request #92 from fluttercuba/master
jonataslaw Mar 29, 2021
e394457
update to 3.0.0
jonataslaw Mar 31, 2021
8b9b7f1
Bug fix on getMediaInfo
trustmefelix Apr 21, 2021
f6f1f76
Added explanation of bug fix on getMediaInfo()
FelixMoMo Apr 26, 2021
51cb8db
Removed strong-mode on variable in getFileThumbnail()
FelixMoMo Apr 26, 2021
762d2ce
Upgrade packages in example and add example for getFileThumbnail
trustmefelix Apr 27, 2021
0a83fdd
Merge pull request #103 from trustmefelix/null_safety
jonataslaw Apr 29, 2021
6875746
Invalidate updateProgress timer after the completion of video export
jinthislife Jul 2, 2021
ef123af
[Resolution Presets] Support for resolution presets
yanivshaked Jul 13, 2021
e6c936b
Merge pull request #119 from yanivshaked/feature_ResolutionPresets
jonataslaw Jul 14, 2021
583e700
Merge pull request #117 from jinthislife/fix-progress-timer
jonataslaw Jul 14, 2021
ec8a2df
Documentation
yanivshaked Jul 16, 2021
6cc45f2
Merge pull request #122 from yanivshaked/patch-1
jonataslaw Jul 16, 2021
81676dc
update to 3.1.0
jonataslaw Jul 16, 2021
4e1fbe7
upgrade kotlin and gradle plugin versions
mostafaAbdelazim Aug 1, 2021
a14d392
Merge pull request #129 from mostafaAbdelazim/master
jonataslaw Aug 12, 2021
2d1a3c6
fix issue with whitespaces in iOS
kaiquegazola Oct 13, 2021
225cf89
Merge pull request #141 from kaiquegazola/master
jonataslaw Oct 13, 2021
9de6471
Move to mavenCentral()
MilosKarakas Nov 9, 2021
537f9f9
Update VideoCompressPlugin.kt
MilosKarakas Nov 9, 2021
8ef39c0
Update build.gradle
MilosKarakas Dec 11, 2021
e51b3eb
Merge pull request #147 from MilosKarakas/master
jonataslaw Dec 13, 2021
3c0e283
Merge branch 'master' of https://github.com/jonataslaw/VideoCompress …
ysiraparapu Jan 31, 2022
bf0e7ee
Update build.gradle
ysiraparapu Jan 31, 2022
35718c7
Merge pull request #7 from agoda-com/upgradeMainRepo
ysiraparapu Jan 31, 2022
ae24604
Fix transcoder version
ysiraparapu Jan 31, 2022
6bb6589
Merge pull request #8 from agoda-com/upgradeMainRepo
ysiraparapu Jan 31, 2022
576385a
Fix the Kotlin.Unit unsupported value error caused in deleteAllCache()
ysiraparapu Feb 1, 2022
41f038d
Merge pull request #9 from agoda-com/fixDeleteAllCacheIssue
ysiraparapu Feb 1, 2022
8f4a1fe
Rebase to original code
Feb 1, 2022
b8d4a3c
Updated kotlin version
uditajmera Sep 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,51 @@
"contributions": [
"code"
]
},
{
"login": "Martibis",
"name": "Tibout Shaik",
"avatar_url": "https://avatars0.githubusercontent.com/u/13279066?v=4",
"profile": "http://www.tiboutshaik.com",
"contributions": [
"maintenance"
]
},
{
"login": "marcobraghim",
"name": "Marco A. Braghim",
"avatar_url": "https://avatars3.githubusercontent.com/u/2068045?v=4",
"profile": "https://www.thizer.com",
"contributions": [
"maintenance"
]
},
{
"login": "ppornkitpras-agoda",
"name": "ppornkitpras-agoda",
"avatar_url": "https://avatars3.githubusercontent.com/u/54128106?v=4",
"profile": "https://github.com/ppornkitpras-agoda",
"contributions": [
"maintenance"
]
},
{
"login": "snowb1shop",
"name": "Rafał Płonka",
"avatar_url": "https://avatars3.githubusercontent.com/u/18536122?v=4",
"profile": "https://github.com/snowb1shop",
"contributions": [
"maintenance"
]
},
{
"login": "yanivshaked",
"name": "Yaniv Shaked",
"avatar_url": "https://avatars3.githubusercontent.com/u/13107481?v=4",
"profile": "https://github.com/yanivshaked",
"contributions": [
"maintenance"
]
}
],
"contributorsPerLine": 7,
Expand Down
45 changes: 34 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,42 @@
## 0.1.0
- initial release
## 3.1.1
- Fix issue on iOS with files containing whitespaces

## 3.1.0
- Bug fix on getMediaInfo (@trustmefelix)
- Improve getFileThumbnail() (@FelixMoMo/@trustmefelix)
- invalidate updateProgress timer after the completion of video export (@jinthislife)
- Added Support for resolution presets (@yanivshaked)

## 0.1.1
- Change default value to HD
## 3.0.0
- Added MacOS support (thank's @efraespada)
- Null-safety support (thank's @rlazom feat @leynier)

## 0.1.2
- Removed unecessary intent when process is done
## 2.1.1
- Fix Subscription import
- Fix Error on android 10 with no includeAudio option

## 0.1.3
- added progress listen
## 2.1.0
- Added cancel compression to android
- Fix compress progress
- Added audio remove/include to android
- Upgrade to android v2
- Fix subscription progress receive same listener

## 2.0.0
- refactor code
Breaking changes, call VideoCompress.method directly, without having to instantiate it.

## 1.0.0
- release new version

## 2.0.0
- refactor code
Breaking changes, call VideoCompress.method directly, without having to instantiate it.
## 0.1.3
- added progress listen

## 0.1.2
- Removed unecessary intent when process is done

## 0.1.1
- Change default value to HD

## 0.1.0
- initial release
99 changes: 63 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,63 @@
# video_compress
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

Compress videos, remove audio, manipulate thumbnails, and make your video compatible with all platforms through this lightweight and efficient library.
100% native code was used, we do not use FFMPEG as it is very slow, bloated and the GNU license is an obstacle for commercial applications.
In addition, google chrome uses VP8/VP9, safari uses h264, and most of the time, it is necessary to encode the video in two formats, but not with this library.
All video files are encoded in an MP4 container with AAC audio that allows 100% compatibility with safari, mozila, chrome, android and iOS.

Works on ANDROID and IOS.
Works on ANDROID, IOS and desktop (just MacOS for now).

### How to use


# Table of Contents
- [Installing](#lets-get-started)
- [How to use](#how-to-use)
* [Imports](#imports)
* [Video compression](#video-compression)
* [Check compress state](#check-compress-state)
* [Get memory thumbnail from VideoPath](#get-memory-thumbnail-from-videopath)
* [Get File thumbnail from VideoPath](#get-file-thumbnail-from-videopath)
* [Get media information](#get-media-information)
* [delete all cache files](#delete-all-cache-files)
* [Listen the compression progress](#listen-the-compression-progress)
- [TODO](#todo)

# Lets Get Started

### 1. Depend on it
Add this to your package's `pubspec.yaml` file:

```yaml
dependencies:
video_compress: ^3.1.0
```

### 2. Install it

You can install packages from the command line:

with `pub`:

```css
$ pub get
```

### 3. Import it

Now in your `Dart` code, you can use:

````dart
import 'package:video_compress/video_compress.dart';
````

# How to use

### Imports

````dart
import 'package:video_compress/video_compress.dart';

````

## Video compression

Expand Down Expand Up @@ -91,19 +138,19 @@ class _Compress extends State<Compress> {
- Add cancel function to Android

## Methods
|Functions|Parameters|Description|Returns|
|--|--|--|--|
|getByteThumbnail|String `path`[video path], int `quality`(1-100)[thumbnail quality], int `position`[Get a thumbnail from video position]|get thumbnail from video `path`|`Future<Uint8List>`|
|getFileThumbnail|String `path`[video path], int `quality`(1-100)[thumbnail quality], int `position`[Get a thumbnail from video position]|get thumbnail file from video `path`|`Future<File>`|
|getMediaInfo|String `path`[video path]|get media information from video `path`|`Future<MediaInfo>`|
|compressVideo|String `path`[video path], VideoQuality `quality`[compressed video quality], bool `deleteOrigin`[delete the origin video], int `startTime`[compression video start time], int `duration`[compression video duration from start time], bool `includeAudio`[is include audio in compressed video], int `frameRate`[compressed video frame rate]|compression video at origin video `path`|`Future<MediaInfo>`|
|cancelCompression|`none`|cancel compressing|`Future<void>`|
|deleteAllCache|`none`|Delete all files generated by 'video_compress' will delete all files located at 'video_compress'|`Future<bool>`|
| Functions | Parameters | Description | Returns |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------- |
| getByteThumbnail | String `path`[video path], int `quality`(1-100)[thumbnail quality], int `position`[Get a thumbnail from video position] | get thumbnail from video `path` | `Future<Uint8List>` |
| getFileThumbnail | String `path`[video path], int `quality`(1-100)[thumbnail quality], int `position`[Get a thumbnail from video position] | get thumbnail file from video `path` | `Future<File>` |
| getMediaInfo | String `path`[video path] | get media information from video `path` | `Future<MediaInfo>` |
| compressVideo | String `path`[video path], VideoQuality `quality`[compressed video quality], bool `deleteOrigin`[delete the origin video], int `startTime`[compression video start time], int `duration`[compression video duration from start time], bool `includeAudio`[is include audio in compressed video], int `frameRate`[compressed video frame rate] | compression video at origin video `path` | `Future<MediaInfo>` |
| cancelCompression | `none` | cancel compressing | `Future<void>` |
| deleteAllCache | `none` | Delete all files generated by 'video_compress' will delete all files located at 'video_compress' | `Future<bool>` |

## Subscriptions
|Subscriptions|Description|Stream|
|--|--|--|
|compressProgress$|Subscribe the compression progress steam|double `progress`|
| Subscriptions | Description | Stream |
| ----------------- | ---------------------------------------- | ----------------- |
| compressProgress$ | Subscribe the compression progress steam | double `progress` |

## Contribute

Expand All @@ -115,23 +162,3 @@ Contributions are always welcome!
Inspired by the flutter_ffmpeg library.
https://github.com/rurico/flutter_video_compress

## Contributors ✨

Thanks goes to these wonderful people:

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="http://projectmeet.app"><img src="https://avatars1.githubusercontent.com/u/42075898?v=4" width="100px;" alt=""/><br /><sub><b>khainhero</b></sub></a><br /><a href="#maintenance-khainhero" title="Maintenance">🚧</a></td>
<td align="center"><a href="https://github.com/Serdnad"><img src="https://avatars1.githubusercontent.com/u/4723453?v=4" width="100px;" alt=""/><br /><sub><b>Andres Gutierrez</b></sub></a><br /><a href="#maintenance-Serdnad" title="Maintenance">🚧</a></td>
<td align="center"><a href="https://github.com/jonataslaw"><img src="https://avatars2.githubusercontent.com/u/35742643?v=4" width="100px;" alt=""/><br /><sub><b>Jonny Borges</b></sub></a><br /><a href="https://github.com/jonataslaw/VideoCompress/commits?author=jonataslaw" title="Code">💻</a></td>
</tr>
</table>

<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ group 'com.example.video_compress'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.3.31'
ext.kotlin_version = '1.3.40'
repositories {
google()
jcenter()
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
6 changes: 3 additions & 3 deletions android/src/main/kotlin/com/example/video_compress/Utility.kt
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ class Utility(private val channelName: String) {
return fileName
}

fun deleteAllCache(context: Context, result: MethodChannel.Result) {
fun deleteAllCache(context: Context): Boolean {
val dir = context.getExternalFilesDir("video_compress")
result.success(dir?.deleteRecursively())
return dir?.deleteRecursively() ?: false
}
}
}
Loading