Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit e593966
Merge: 7be25f5 f38004d
Author: Maël <legoffmael@gmail.com>
Date:   Wed Mar 30 20:43:05 2022 +0900

    Merge pull request LeGoffMael#81 from adigladi/dependencies/upgrade-to-stable-versions

    [dependencies] Upgrade ffmpeg_kit_flutter_min_gpl to stable version

commit f38004d
Author: adigladi <adigladi@hotmail.com>
Date:   Wed Mar 30 10:13:48 2022 +0200

    Update platform target

commit 77032c6
Author: adigladi <adigladi@hotmail.com>
Date:   Tue Mar 29 12:02:55 2022 +0200

    [dependencies] Upgrade ffmpeg_kit to stable ver

commit 7be25f5
Author: Maël Le Goff <legoffmael@gmail.com>
Date:   Tue Mar 29 20:23:17 2022 +0900

    [release] ready to 1.2.5

commit fade639
Author: Maël Le Goff <legoffmael@gmail.com>
Date:   Tue Mar 29 20:19:09 2022 +0900

    [dependencies] fix path issue + upgrade video_thumbnail

commit 18634fd
Author: Maël Le Goff <legoffmael@gmail.com>
Date:   Tue Mar 29 20:03:46 2022 +0900

    [clean] ignore and remove pubspec.lock

commit ff376b1
Author: Maël Le Goff <legoffmael@gmail.com>
Date:   Tue Mar 29 19:54:52 2022 +0900

    [clean] delete useless pubspec.lock

commit 8ed3919
Author: Mael Le Goff <m.legoff@xenoimpact.com>
Date:   Fri Mar 18 13:57:47 2022 +0900

    [clean] remove useless dependency

commit 2b384eb
Author: Mael Le Goff <m.legoff@xenoimpact.com>
Date:   Fri Mar 11 18:32:09 2022 +0900

    [release] update to 1.2.4

commit 2f72a88
Author: Mael Le Goff <m.legoff@xenoimpact.com>
Date:   Fri Mar 11 18:27:58 2022 +0900

    [new] add isFiltersEnabled param to extractCover

commit 63746c7
Author: Mael Le Goff <m.legoff@xenoimpact.com>
Date:   Fri Mar 11 18:10:37 2022 +0900

     add todo related to crop fix

commit 3890088
Author: Mael Le Goff <m.legoff@xenoimpact.com>
Date:   Fri Mar 11 17:52:32 2022 +0900

    [dependencies] upgrade dependencies to latest

commit a956b80
Author: Mael Le Goff <m.legoff@xenoimpact.com>
Date:   Fri Mar 11 15:06:04 2022 +0900

    update readme screenshots

commit c6a5d4b
Author: Mael Le Goff <m.legoff@xenoimpact.com>
Date:   Fri Mar 11 14:57:17 2022 +0900

    doc - improve readme
  • Loading branch information
rohanspyn committed Mar 31, 2022
1 parent 12c04cf commit d33eaf5
Show file tree
Hide file tree
Showing 13 changed files with 124 additions and 119 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# Miscellaneous
*.class
*.lock
*.log
*.pyc
*.swp
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## [1.2.5]

- Upgraded `video_thumbnail` dependency
- Fix dependency conflict with `path 1.8.1` [#79](https://github.com/seel-channel/video_editor/issues/79)

## [1.2.4]

- Updated dependencies
- Add `isFiltersEnabled` param to disable all changes at extraction [#76](https://github.com/seel-channel/video_editor/pull/76)
- Fix an error at extraction if the destination path contains a space [#74](https://github.com/seel-channel/video_editor/pull/74)

## [1.2.3]

- Update `ffmpeg_kit_flutter` to latest 4.5.1 [#65](https://github.com/seel-channel/video_editor/pull/65)
Expand Down
62 changes: 16 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,28 @@
# video_editor
# Flutter video editor

<br>
[![Platform](https://img.shields.io/badge/Platform-Flutter-yellow.svg)](https://flutter.io)
[![Pub](https://img.shields.io/pub/v/video_editor.svg?logo=flutter&color=blue&style=flat-square)](https://pub.dev/packages/video_editor)

## My other APIs
A video editor that allows to edit (trim, crop, rotate and scale) and choose a cover with a very flexible UI design.
The changes are then exported with `ffmpeg`.

### My other APIs

- [Scroll Navigation](https://pub.dev/packages/scroll_navigation)
- [Video Viewer](https://pub.dev/packages/video_viewer)
- [Helpers](https://pub.dev/packages/helpers)

<br>

## Features

- Super flexible UI Design.
- Support actions:
- Crop
- Trim
- Scale
- Rotate
- Cover selection

<br><br>

## **Installation** (More info on [Flutter ffmepeg kit](https://github.com/tanersener/ffmpeg-kit/tree/main/flutter/flutter))
Following steps will help you add this library as a dependency in your flutter project.

- In the `pubspec.yaml` file in the root of your project

```yaml
dependencies:
video_editor: ^1.2.3
video_editor: ^1.2.5
```

- Run the following command to get packages:
- Run the following command to install the package:

```bash
$ flutter packages get
Expand All @@ -43,36 +33,16 @@ $ flutter packages get
```dart
import 'package:video_editor/video_editor.dart';
```
<br><br>

## **Example** (The UI Design is fully customizable on the [example](https://pub.dev/packages/video_editor/example))

- Dependencies used:
- [Helpers](https://pub.dev/packages/helpers)
- [Image Picker](https://pub.dev/packages/image_picker)

<br>

| Crop Video | Rotate Video |
| ----------------------------------- | ------------------------------------- |
| ![](./assets/readme/crop_video.gif) | ![](./assets/readme/rotate_video.gif) |

<br>

| Trim Video | Export Video |
| ----------------------------------- | ------------------------------------- |
| ![](./assets/readme/trim_video.gif) | ![](./assets/readme/export_video.gif) |

| Trimmer if maxDuration < videoDuration | Trim timeline | Trim icons customization |
| --------------------------------------- | -------------------------------------- | ------------------------------------------ |
| ![](./assets/readme/new_trim_video.gif) | ![](./assets/readme/trim_timeline.gif) | ![](./assets/readme/new_trimmer_icons.gif) |

| Video cover (selection, viewer) | Export cover |
| ------------------------------------- | ------------------------------------- |
| ![](./assets/readme/cover_viewer.gif) | ![](./assets/readme/export_cover.gif) |
## **Screenshots** (The UI Design is fully customizable on the [example](https://pub.dev/packages/video_editor/example))

| Crop Video | Rotate Video | Video cover (selection, viewer) |
| ----------------------------------- | ------------------------------------- | ------------------------------------- |
| ![](./assets/readme/crop_video.gif) | ![](./assets/readme/rotate_video.gif) | ![](./assets/readme/cover_viewer.gif) |

<br><br>
| Trim video | Trimmer customization |
| --------------------------------------- | ------------------------------------------ |
| ![](./assets/readme/new_trim_video.gif) | ![](./assets/readme/new_trimmer_icons.gif) |

## Main Contributors

Expand Down
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '9.3'
platform :ios, '12.1'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
38 changes: 32 additions & 6 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 51;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -68,7 +68,6 @@
5E936127F84FC7ACCE9E4B1D /* Pods-Runner.release.xcconfig */,
3FBEB4B11E40AFFF53EED524 /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
Expand Down Expand Up @@ -139,6 +138,7 @@
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
2429AC40B28B8167C3DF858E /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand All @@ -155,7 +155,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -197,6 +197,23 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
2429AC40B28B8167C3DF858E /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
2D67C549E268C5158D0E3007 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -344,7 +361,10 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
Expand Down Expand Up @@ -476,7 +496,10 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
Expand All @@ -503,7 +526,10 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSPhotoLibraryUsageDescription</key>
<string>${PRODUCT_NAME} Library Access</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand All @@ -41,7 +43,5 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>NSPhotoLibraryUsageDescription</key>
<string>${PRODUCT_NAME} Library Access</string>
</dict>
</plist>
59 changes: 35 additions & 24 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ class _VideoPickerPageState extends State<VideoPickerPage> {

void _pickVideo() async {
final XFile? file = await _picker.pickVideo(source: ImageSource.gallery);
if (file != null) context.to(VideoEditor(file: File(file.path)));
if (file != null)
context.navigator.push(MaterialPageRoute<void>(
builder: (BuildContext context) =>
VideoEditor(file: File(file.path))));
}

@override
Expand All @@ -56,10 +59,12 @@ class _VideoPickerPageState extends State<VideoPickerPage> {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextDesigned(
Text(
"Click on Pick Video to select video",
color: Colors.black,
size: 18.0,
style: TextStyle(
color: Colors.black,
fontSize: 18.0,
),
),
ElevatedButton(
onPressed: _pickVideo,
Expand Down Expand Up @@ -109,12 +114,13 @@ class _VideoEditorState extends State<VideoEditor> {
super.dispose();
}

void _openCropScreen() => context.to(CropScreen(controller: _controller));
void _openCropScreen() => context.navigator.push(MaterialPageRoute<void>(
builder: (BuildContext context) => CropScreen(controller: _controller)));

void _exportVideo() async {
_isExporting.value = true;
bool _firstStat = true;
//NOTE: To use [-crf 17] and [VideoExportPreset] you need ["min-gpl-lts"] package
//NOTE: To use `-crf 1` and [VideoExportPreset] you need `ffmpeg_kit_flutter_min_gpl` package (with `ffmpeg_kit` only it won't work)
await _controller.exportVideo(
// preset: VideoExportPreset.medium,
// customInstruction: "-crf 17",
Expand Down Expand Up @@ -281,11 +287,12 @@ class _VideoEditorState extends State<VideoEditor> {
backgroundColor: Colors.white,
title: ValueListenableBuilder(
valueListenable: _exportingProgress,
builder: (_, double value, __) =>
TextDesigned(
builder: (_, double value, __) => Text(
"Exporting video ${(value * 100).ceil()}%",
color: Colors.black,
bold: true,
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
),
),
Expand Down Expand Up @@ -358,14 +365,14 @@ class _VideoEditorState extends State<VideoEditor> {
return Padding(
padding: Margin.horizontal(height / 4),
child: Row(children: [
TextDesigned(formatter(Duration(seconds: pos.toInt()))),
Text(formatter(Duration(seconds: pos.toInt()))),
Expanded(child: SizedBox()),
OpacityTransition(
visible: _controller.isTrimming,
child: Row(mainAxisSize: MainAxisSize.min, children: [
TextDesigned(formatter(Duration(seconds: start.toInt()))),
Text(formatter(Duration(seconds: start.toInt()))),
SizedBox(width: 10),
TextDesigned(formatter(Duration(seconds: end.toInt()))),
Text(formatter(Duration(seconds: end.toInt()))),
]),
)
]),
Expand Down Expand Up @@ -400,16 +407,14 @@ class _VideoEditorState extends State<VideoEditor> {
alignment: Alignment.bottomCenter,
child: SwipeTransition(
visible: _exported,
direction: SwipeDirection.fromBottom,
axisAlignment: 1.0,
child: Container(
height: height,
width: double.infinity,
color: Colors.black.withOpacity(0.8),
child: Center(
child: TextDesigned(
_exportText,
bold: true,
),
child: Text(_exportText,
style: TextStyle(fontWeight: FontWeight.bold)),
),
),
),
Expand Down Expand Up @@ -460,11 +465,11 @@ class CropScreen extends StatelessWidget {
Row(children: [
Expanded(
child: SplashTap(
onTap: context.goBack,
onTap: context.navigator.pop,
child: Center(
child: TextDesigned(
child: Text(
"CANCEL",
bold: true,
style: TextStyle(fontWeight: FontWeight.bold),
),
),
),
Expand All @@ -483,10 +488,13 @@ class CropScreen extends StatelessWidget {
controller.minCrop = controller.cacheMinCrop;
controller.maxCrop = controller.cacheMaxCrop;
*/
context.goBack();
context.navigator.pop();
},
child: Center(
child: TextDesigned("OK", bold: true),
child: Text(
"OK",
style: TextStyle(fontWeight: FontWeight.bold),
),
),
),
),
Expand All @@ -510,7 +518,10 @@ class CropScreen extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.aspect_ratio, color: Colors.white),
TextDesigned(title, bold: true),
Text(
title,
style: TextStyle(fontWeight: FontWeight.bold),
),
],
),
),
Expand Down
Loading

0 comments on commit d33eaf5

Please sign in to comment.