Skip to content
This repository has been archived by the owner on Oct 14, 2021. It is now read-only.

Commit

Permalink
release v0.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
tanersener committed Jul 22, 2019
1 parent acdcc95 commit c785bf1
Show file tree
Hide file tree
Showing 348 changed files with 204 additions and 34,977 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.2.7
- Uses new package selection mechanism
- Fixes issue #52

## 0.2.6
- Adds support for single quotes and double quotes in command strings

Expand Down
55 changes: 43 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# flutter_ffmpeg

![GitHub release](https://img.shields.io/badge/release-v0.2.6-blue.svg)
![GitHub release](https://img.shields.io/badge/release-v0.2.7-blue.svg)
![](https://img.shields.io/pub/v/flutter_ffmpeg.svg)

FFmpeg plugin for Flutter. Supports iOS and Android.
Expand Down Expand Up @@ -70,26 +70,57 @@ FFmpeg plugin for Flutter. Supports iOS and Android.
Add `flutter_ffmpeg` as a dependency in your `pubspec.yaml file`.
```
dependencies:
flutter_ffmpeg: ^0.2.6
flutter_ffmpeg: ^0.2.7
```

#### 2.1 Packages

Installation of `FlutterFFmpeg` using `pub` enables the default package, which is based on `https` package. It is possible to enable other packages using the following steps.

1. Use the following dependency block in your `pubspec.yaml` file.
##### 2.1.1 Android

- Edit `android/build.gradle` file and define package name in `ext.flutterFFmpegPackage` variable.

```
ext {
flutterFFmpegPackage = "<package name>"
}
```
dependencies:
flutter_ffmpeg:
git:
url: git://github.com/tanersener/flutter-ffmpeg.git
ref: v0.2.6
path: packages/flutter_ffmpeg_<package_name>
##### 2.1.2 iOS
- Edit `ios/Podfile` file and modify the default `# Plugin Pods` block as follows.
Do not forget to specify package name in `<package name>` section.
```
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.map { |p|
symlink = File.join('.symlinks', 'plugins', p[:name])
File.symlink(p[:path], symlink)
if p[:name] == 'flutter_ffmpeg'
pod p[:name]+'/<package name>', :path => File.join(symlink, 'ios')
else
pod p[:name], :path => File.join(symlink, 'ios')
end
}
```
2. Update version in `ref:` argument.
3. Set package name in `path: packages/flutter_ffmpeg_<package_name>[_lts]` section. Include `_lts` postfix only if you want to depend on an `LTS` release.
##### 2.1.3 Package Names
The following table shows all package names defined for `flutter_ffmpeg`.
| Package | Main Release | LTS Release |
| :----: | :----: | :----: |
| min | min | min-lts |
| min-gpl | min-gpl | min-gpl-lts |
| http | https | http-lts |
| http-gpl | http-gpl | http-gpl-lts |
| audio | audio | audio-lts |
| video | video | video-lts |
| full | full | full-lts |
| full-gpl | full-gpl | full-gpl-lts |
#### 2.2 Existing Applications
Expand All @@ -107,7 +138,7 @@ Please execute the following additional steps if you are integrating into an iOS
`flutter_ffmpeg` is published in two different variants: `Main Release` and `LTS Release`. Both releases share the same source code but is built with different settings. Below you can see the changes between the two.
In order to install the `LTS` variant, install the `flutter_ffmpeg_https_lts` package using instructions in `2.1` or append `_lts` to the package name you are using.
In order to install the `LTS` variant, install the `https-lts` package using instructions in `2.1` or append `-lts` to the package name you are using.
<table>
<thead>
Expand Down
18 changes: 15 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
static String safePackageName(String prop) {
prop.replace("-lts", "")
}

static String safePackageVersion(String prop, String version, String ltsVersion) {
prop.contains("-lts") ? ltsVersion + ".LTS" : version
}

String safeExtGet(String prop, String fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

group 'com.arthenica.flutter.ffmpeg'
version '0.2.6'
version '0.2.7'

buildscript {
repositories {
Expand All @@ -25,13 +37,13 @@ android {
compileSdkVersion 28

defaultConfig {
minSdkVersion 24
minSdkVersion safeExtGet('flutterFFmpegPackage', 'https').contains("-lts") ? 16 : 24
}
lintOptions {
disable 'InvalidPackage'
}
}

dependencies {
implementation 'com.arthenica:mobile-ffmpeg-https:4.2.2'
implementation 'com.arthenica:mobile-ffmpeg-' + safePackageName(safeExtGet('flutterFFmpegPackage', 'https')) + ':' + safePackageVersion(safeExtGet('flutterFFmpegPackage', 'https'), '4.2.2', '4.2.2')
}
2 changes: 2 additions & 0 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ subprojects {
project.evaluationDependsOn(':app')
}

ext.flutterFFmpegPackage = 'full'

task clean(type: Delete) {
delete rootProject.buildDir
}
6 changes: 5 additions & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ target 'Runner' do
plugin_pods.map { |p|
symlink = File.join('.symlinks', 'plugins', p[:name])
File.symlink(p[:path], symlink)
pod p[:name], :path => File.join(symlink, 'ios')
if p[:name] == 'flutter_ffmpeg'
pod p[:name]+'/full', :path => File.join(symlink, 'ios')
else
pod p[:name], :path => File.join(symlink, 'ios')
end
}
end

Expand Down
16 changes: 8 additions & 8 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
PODS:
- Flutter (1.0.0)
- flutter_ffmpeg (0.2.6):
- flutter_ffmpeg/full (0.2.7):
- Flutter
- mobile-ffmpeg-https (= 4.2.2)
- mobile-ffmpeg-https (4.2.2)
- mobile-ffmpeg-full (= 4.2.2)
- mobile-ffmpeg-full (4.2.2)
- path_provider (0.0.1):
- Flutter

DEPENDENCIES:
- Flutter (from `.symlinks/flutter/ios`)
- flutter_ffmpeg (from `.symlinks/plugins/flutter_ffmpeg/ios`)
- flutter_ffmpeg/full (from `.symlinks/plugins/flutter_ffmpeg/ios`)
- path_provider (from `.symlinks/plugins/path_provider/ios`)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
- mobile-ffmpeg-https
- mobile-ffmpeg-full

EXTERNAL SOURCES:
Flutter:
Expand All @@ -26,10 +26,10 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a
flutter_ffmpeg: c000927c8fbfcecf97489e4aeba435aaea39cc61
mobile-ffmpeg-https: 9474e6e0958b6c12d981073d81a3b9484da02f48
flutter_ffmpeg: 05ee218287a2b55a13df8f7970aab1a52094083e
mobile-ffmpeg-full: 42f654ef799818c6b8344ffd5a63c83b53f86745
path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259

PODFILE CHECKSUM: f89e2d3393e97ef827d5588a24b755fc03ebc243
PODFILE CHECKSUM: 3c42d7d5cb11914bdcd50bd04ea49997cf3f22b5

COCOAPODS: 1.7.3
10 changes: 5 additions & 5 deletions example/lib/flutter_ffmpeg_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,17 @@ class VideoUtil {
image3Path +
"\" " +
"-filter_complex " +
"\"[0:v]setpts=PTS-STARTPTS,scale=w=\'if(gte(iw/ih,640/427),min(iw,640),-1)\':h=\'if(gte(iw/ih,640/427),-1,min(ih,427))\',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1,split=2[stream1out1][stream1out2];" +
"[1:v]setpts=PTS-STARTPTS,scale=w=\'if(gte(iw/ih,640/427),min(iw,640),-1)\':h=\'if(gte(iw/ih,640/427),-1,min(ih,427))\',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1,split=2[stream2out1][stream2out2];" +
"[2:v]setpts=PTS-STARTPTS,scale=w=\'if(gte(iw/ih,640/427),min(iw,640),-1)\':h=\'if(gte(iw/ih,640/427),-1,min(ih,427))\',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1,split=2[stream3out1][stream3out2];" +
"\"[0:v]setpts=PTS-STARTPTS,scale=w='if(gte(iw/ih,640/427),min(iw,640),-1)':h='if(gte(iw/ih,640/427),-1,min(ih,427))',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1,split=2[stream1out1][stream1out2];" +
"[1:v]setpts=PTS-STARTPTS,scale=w='if(gte(iw/ih,640/427),min(iw,640),-1)':h='if(gte(iw/ih,640/427),-1,min(ih,427))',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1,split=2[stream2out1][stream2out2];" +
"[2:v]setpts=PTS-STARTPTS,scale=w='if(gte(iw/ih,640/427),min(iw,640),-1)':h='if(gte(iw/ih,640/427),-1,min(ih,427))',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1,split=2[stream3out1][stream3out2];" +
"[stream1out1]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=3,select=lte(n\\,90)[stream1overlaid];" +
"[stream1out2]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=1,select=lte(n\\,30)[stream1ending];" +
"[stream2out1]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=2,select=lte(n\\,60)[stream2overlaid];" +
"[stream2out2]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=1,select=lte(n\\,30),split=2[stream2starting][stream2ending];" +
"[stream3out1]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=2,select=lte(n\\,60)[stream3overlaid];" +
"[stream3out2]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=1,select=lte(n\\,30)[stream3starting];" +
"[stream2starting][stream1ending]blend=all_expr=\'if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)\':shortest=1[stream2blended];" +
"[stream3starting][stream2ending]blend=all_expr=\'if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)\':shortest=1[stream3blended];" +
"[stream2starting][stream1ending]blend=all_expr='if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)':shortest=1[stream2blended];" +
"[stream3starting][stream2ending]blend=all_expr='if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)':shortest=1[stream3blended];" +
"[stream1overlaid][stream2blended][stream2overlaid][stream3blended][stream3overlaid]concat=n=5:v=1:a=0,scale=w=640:h=424,format=yuv420p[video]\"" +
" -map [video] -vsync 2 -async 1 " +
customOptions +
Expand Down
8 changes: 4 additions & 4 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ packages:
flutter_ffmpeg:
dependency: "direct main"
description:
name: flutter_ffmpeg
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.6"
path: ".."
relative: true
source: path
version: "0.2.7"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down
3 changes: 2 additions & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ dependencies:
cupertino_icons: ^0.1.2
path: ^1.6.2
path_provider: ^0.5.0+1
flutter_ffmpeg: 0.2.6
flutter_ffmpeg:
path: ../

dev_dependencies:
flutter_test:
Expand Down
118 changes: 115 additions & 3 deletions ios/flutter_ffmpeg.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'flutter_ffmpeg'
s.version = '0.2.6'
s.version = '0.2.7'
s.summary = 'FFmpeg plugin for Flutter.'
s.description = 'FFmpeg plugin based on mobile-ffmpeg for Flutter.'
s.homepage = 'https://github.com/tanersener/flutter-ffmpeg'
Expand All @@ -16,8 +16,120 @@ Pod::Spec.new do |s|
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'

s.default_subspec = 'https'

s.dependency 'Flutter'
s.dependency 'mobile-ffmpeg-https', '4.2.2'

end
s.subspec 'min' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'

ss.dependency 'mobile-ffmpeg-min', '4.2.2'
end

s.subspec 'min-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'

ss.dependency 'mobile-ffmpeg-min', '4.2.2.LTS'
end

s.subspec 'min-gpl' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'

ss.dependency 'mobile-ffmpeg-min-gpl', '4.2.2'
end

s.subspec 'min-gpl-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'

ss.dependency 'mobile-ffmpeg-min-gpl', '4.2.2.LTS'
end

s.subspec 'https' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'

ss.dependency 'mobile-ffmpeg-https', '4.2.2'
end

s.subspec 'https-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'

ss.dependency 'mobile-ffmpeg-https', '4.2.2.LTS'
end

s.subspec 'https-gpl' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'

ss.dependency 'mobile-ffmpeg-https-gpl', '4.2.2'
end

s.subspec 'https-gpl-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'

ss.dependency 'mobile-ffmpeg-https-gpl', '4.2.2.LTS'
end

s.subspec 'audio' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'

ss.dependency 'mobile-ffmpeg-audio', '4.2.2'
end

s.subspec 'audio-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'

ss.dependency 'mobile-ffmpeg-audio', '4.2.2.LTS'
end

s.subspec 'video' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'

ss.dependency 'mobile-ffmpeg-video', '4.2.2'
end

s.subspec 'video-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'

ss.dependency 'mobile-ffmpeg-video', '4.2.2.LTS'
end

s.subspec 'full' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'

ss.dependency 'mobile-ffmpeg-full', '4.2.2'
end

s.subspec 'full-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'

ss.dependency 'mobile-ffmpeg-full', '4.2.2.LTS'
end

s.subspec 'full-gpl' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'

ss.dependency 'mobile-ffmpeg-full-gpl', '4.2.2'
end

s.subspec 'full-gpl-lts' do |ss|
ss.source_files = 'Classes/**/*'
ss.public_header_files = 'Classes/**/*.h'

ss.dependency 'mobile-ffmpeg-full-gpl', '4.2.2.LTS'
end

end
8 changes: 0 additions & 8 deletions packages/flutter_ffmpeg_audio/.gitignore

This file was deleted.

10 changes: 0 additions & 10 deletions packages/flutter_ffmpeg_audio/.metadata

This file was deleted.

Loading

0 comments on commit c785bf1

Please sign in to comment.