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

Commit c785bf1

Browse files
committed
release v0.2.7
1 parent acdcc95 commit c785bf1

File tree

348 files changed

+204
-34977
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

348 files changed

+204
-34977
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.2.7
2+
- Uses new package selection mechanism
3+
- Fixes issue #52
4+
15
## 0.2.6
26
- Adds support for single quotes and double quotes in command strings
37

README.md

+43-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# flutter_ffmpeg
22

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

66
FFmpeg plugin for Flutter. Supports iOS and Android.
@@ -70,26 +70,57 @@ FFmpeg plugin for Flutter. Supports iOS and Android.
7070
Add `flutter_ffmpeg` as a dependency in your `pubspec.yaml file`.
7171
```
7272
dependencies:
73-
flutter_ffmpeg: ^0.2.6
73+
flutter_ffmpeg: ^0.2.7
7474
```
7575

7676
#### 2.1 Packages
7777

7878
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.
7979

80-
1. Use the following dependency block in your `pubspec.yaml` file.
80+
##### 2.1.1 Android
81+
82+
- Edit `android/build.gradle` file and define package name in `ext.flutterFFmpegPackage` variable.
83+
84+
```
85+
ext {
86+
flutterFFmpegPackage = "<package name>"
87+
}
88+
8189
```
82-
dependencies:
83-
flutter_ffmpeg:
84-
git:
85-
url: git://github.com/tanersener/flutter-ffmpeg.git
86-
ref: v0.2.6
87-
path: packages/flutter_ffmpeg_<package_name>
8890
91+
##### 2.1.2 iOS
92+
93+
- Edit `ios/Podfile` file and modify the default `# Plugin Pods` block as follows.
94+
Do not forget to specify package name in `<package name>` section.
95+
96+
```
97+
plugin_pods = parse_KV_file('../.flutter-plugins')
98+
plugin_pods.map { |p|
99+
symlink = File.join('.symlinks', 'plugins', p[:name])
100+
File.symlink(p[:path], symlink)
101+
if p[:name] == 'flutter_ffmpeg'
102+
pod p[:name]+'/<package name>', :path => File.join(symlink, 'ios')
103+
else
104+
pod p[:name], :path => File.join(symlink, 'ios')
105+
end
106+
}
89107
```
90-
2. Update version in `ref:` argument.
91108
92-
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.
109+
##### 2.1.3 Package Names
110+
111+
The following table shows all package names defined for `flutter_ffmpeg`.
112+
113+
| Package | Main Release | LTS Release |
114+
| :----: | :----: | :----: |
115+
| min | min | min-lts |
116+
| min-gpl | min-gpl | min-gpl-lts |
117+
| http | https | http-lts |
118+
| http-gpl | http-gpl | http-gpl-lts |
119+
| audio | audio | audio-lts |
120+
| video | video | video-lts |
121+
| full | full | full-lts |
122+
| full-gpl | full-gpl | full-gpl-lts |
123+
93124
94125
#### 2.2 Existing Applications
95126
@@ -107,7 +138,7 @@ Please execute the following additional steps if you are integrating into an iOS
107138
108139
`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.
109140
110-
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.
141+
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.
111142
112143
<table>
113144
<thead>

android/build.gradle

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1+
static String safePackageName(String prop) {
2+
prop.replace("-lts", "")
3+
}
4+
5+
static String safePackageVersion(String prop, String version, String ltsVersion) {
6+
prop.contains("-lts") ? ltsVersion + ".LTS" : version
7+
}
8+
9+
String safeExtGet(String prop, String fallback) {
10+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
11+
}
12+
113
group 'com.arthenica.flutter.ffmpeg'
2-
version '0.2.6'
14+
version '0.2.7'
315

416
buildscript {
517
repositories {
@@ -25,13 +37,13 @@ android {
2537
compileSdkVersion 28
2638

2739
defaultConfig {
28-
minSdkVersion 24
40+
minSdkVersion safeExtGet('flutterFFmpegPackage', 'https').contains("-lts") ? 16 : 24
2941
}
3042
lintOptions {
3143
disable 'InvalidPackage'
3244
}
3345
}
3446

3547
dependencies {
36-
implementation 'com.arthenica:mobile-ffmpeg-https:4.2.2'
48+
implementation 'com.arthenica:mobile-ffmpeg-' + safePackageName(safeExtGet('flutterFFmpegPackage', 'https')) + ':' + safePackageVersion(safeExtGet('flutterFFmpegPackage', 'https'), '4.2.2', '4.2.2')
3749
}

example/android/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ subprojects {
2424
project.evaluationDependsOn(':app')
2525
}
2626

27+
ext.flutterFFmpegPackage = 'full'
28+
2729
task clean(type: Delete) {
2830
delete rootProject.buildDir
2931
}

example/ios/Podfile

+5-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ target 'Runner' do
5656
plugin_pods.map { |p|
5757
symlink = File.join('.symlinks', 'plugins', p[:name])
5858
File.symlink(p[:path], symlink)
59-
pod p[:name], :path => File.join(symlink, 'ios')
59+
if p[:name] == 'flutter_ffmpeg'
60+
pod p[:name]+'/full', :path => File.join(symlink, 'ios')
61+
else
62+
pod p[:name], :path => File.join(symlink, 'ios')
63+
end
6064
}
6165
end
6266

example/ios/Podfile.lock

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
PODS:
22
- Flutter (1.0.0)
3-
- flutter_ffmpeg (0.2.6):
3+
- flutter_ffmpeg/full (0.2.7):
44
- Flutter
5-
- mobile-ffmpeg-https (= 4.2.2)
6-
- mobile-ffmpeg-https (4.2.2)
5+
- mobile-ffmpeg-full (= 4.2.2)
6+
- mobile-ffmpeg-full (4.2.2)
77
- path_provider (0.0.1):
88
- Flutter
99

1010
DEPENDENCIES:
1111
- Flutter (from `.symlinks/flutter/ios`)
12-
- flutter_ffmpeg (from `.symlinks/plugins/flutter_ffmpeg/ios`)
12+
- flutter_ffmpeg/full (from `.symlinks/plugins/flutter_ffmpeg/ios`)
1313
- path_provider (from `.symlinks/plugins/path_provider/ios`)
1414

1515
SPEC REPOS:
1616
https://github.com/cocoapods/specs.git:
17-
- mobile-ffmpeg-https
17+
- mobile-ffmpeg-full
1818

1919
EXTERNAL SOURCES:
2020
Flutter:
@@ -26,10 +26,10 @@ EXTERNAL SOURCES:
2626

2727
SPEC CHECKSUMS:
2828
Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a
29-
flutter_ffmpeg: c000927c8fbfcecf97489e4aeba435aaea39cc61
30-
mobile-ffmpeg-https: 9474e6e0958b6c12d981073d81a3b9484da02f48
29+
flutter_ffmpeg: 05ee218287a2b55a13df8f7970aab1a52094083e
30+
mobile-ffmpeg-full: 42f654ef799818c6b8344ffd5a63c83b53f86745
3131
path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259
3232

33-
PODFILE CHECKSUM: f89e2d3393e97ef827d5588a24b755fc03ebc243
33+
PODFILE CHECKSUM: 3c42d7d5cb11914bdcd50bd04ea49997cf3f22b5
3434

3535
COCOAPODS: 1.7.3

example/lib/flutter_ffmpeg_example.dart

+5-5
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,17 @@ class VideoUtil {
7777
image3Path +
7878
"\" " +
7979
"-filter_complex " +
80-
"\"[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];" +
81-
"[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];" +
82-
"[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];" +
80+
"\"[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];" +
81+
"[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];" +
82+
"[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];" +
8383
"[stream1out1]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=3,select=lte(n\\,90)[stream1overlaid];" +
8484
"[stream1out2]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=1,select=lte(n\\,30)[stream1ending];" +
8585
"[stream2out1]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=2,select=lte(n\\,60)[stream2overlaid];" +
8686
"[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];" +
8787
"[stream3out1]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=2,select=lte(n\\,60)[stream3overlaid];" +
8888
"[stream3out2]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=1,select=lte(n\\,30)[stream3starting];" +
89-
"[stream2starting][stream1ending]blend=all_expr=\'if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)\':shortest=1[stream2blended];" +
90-
"[stream3starting][stream2ending]blend=all_expr=\'if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)\':shortest=1[stream3blended];" +
89+
"[stream2starting][stream1ending]blend=all_expr='if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)':shortest=1[stream2blended];" +
90+
"[stream3starting][stream2ending]blend=all_expr='if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)':shortest=1[stream3blended];" +
9191
"[stream1overlaid][stream2blended][stream2overlaid][stream3blended][stream3overlaid]concat=n=5:v=1:a=0,scale=w=640:h=424,format=yuv420p[video]\"" +
9292
" -map [video] -vsync 2 -async 1 " +
9393
customOptions +

example/pubspec.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ packages:
4444
flutter_ffmpeg:
4545
dependency: "direct main"
4646
description:
47-
name: flutter_ffmpeg
48-
url: "https://pub.dartlang.org"
49-
source: hosted
50-
version: "0.2.6"
47+
path: ".."
48+
relative: true
49+
source: path
50+
version: "0.2.7"
5151
flutter_test:
5252
dependency: "direct dev"
5353
description: flutter

example/pubspec.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ dependencies:
1111
cupertino_icons: ^0.1.2
1212
path: ^1.6.2
1313
path_provider: ^0.5.0+1
14-
flutter_ffmpeg: 0.2.6
14+
flutter_ffmpeg:
15+
path: ../
1516

1617
dev_dependencies:
1718
flutter_test:

ios/flutter_ffmpeg.podspec

+115-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'flutter_ffmpeg'
3-
s.version = '0.2.6'
3+
s.version = '0.2.7'
44
s.summary = 'FFmpeg plugin for Flutter.'
55
s.description = 'FFmpeg plugin based on mobile-ffmpeg for Flutter.'
66
s.homepage = 'https://github.com/tanersener/flutter-ffmpeg'
@@ -16,8 +16,120 @@ Pod::Spec.new do |s|
1616
s.source_files = 'Classes/**/*'
1717
s.public_header_files = 'Classes/**/*.h'
1818

19+
s.default_subspec = 'https'
20+
1921
s.dependency 'Flutter'
20-
s.dependency 'mobile-ffmpeg-https', '4.2.2'
2122

22-
end
23+
s.subspec 'min' do |ss|
24+
ss.source_files = 'Classes/**/*'
25+
ss.public_header_files = 'Classes/**/*.h'
26+
27+
ss.dependency 'mobile-ffmpeg-min', '4.2.2'
28+
end
29+
30+
s.subspec 'min-lts' do |ss|
31+
ss.source_files = 'Classes/**/*'
32+
ss.public_header_files = 'Classes/**/*.h'
33+
34+
ss.dependency 'mobile-ffmpeg-min', '4.2.2.LTS'
35+
end
36+
37+
s.subspec 'min-gpl' do |ss|
38+
ss.source_files = 'Classes/**/*'
39+
ss.public_header_files = 'Classes/**/*.h'
40+
41+
ss.dependency 'mobile-ffmpeg-min-gpl', '4.2.2'
42+
end
43+
44+
s.subspec 'min-gpl-lts' do |ss|
45+
ss.source_files = 'Classes/**/*'
46+
ss.public_header_files = 'Classes/**/*.h'
47+
48+
ss.dependency 'mobile-ffmpeg-min-gpl', '4.2.2.LTS'
49+
end
50+
51+
s.subspec 'https' do |ss|
52+
ss.source_files = 'Classes/**/*'
53+
ss.public_header_files = 'Classes/**/*.h'
54+
55+
ss.dependency 'mobile-ffmpeg-https', '4.2.2'
56+
end
57+
58+
s.subspec 'https-lts' do |ss|
59+
ss.source_files = 'Classes/**/*'
60+
ss.public_header_files = 'Classes/**/*.h'
61+
62+
ss.dependency 'mobile-ffmpeg-https', '4.2.2.LTS'
63+
end
64+
65+
s.subspec 'https-gpl' do |ss|
66+
ss.source_files = 'Classes/**/*'
67+
ss.public_header_files = 'Classes/**/*.h'
68+
69+
ss.dependency 'mobile-ffmpeg-https-gpl', '4.2.2'
70+
end
71+
72+
s.subspec 'https-gpl-lts' do |ss|
73+
ss.source_files = 'Classes/**/*'
74+
ss.public_header_files = 'Classes/**/*.h'
75+
76+
ss.dependency 'mobile-ffmpeg-https-gpl', '4.2.2.LTS'
77+
end
2378

79+
s.subspec 'audio' do |ss|
80+
ss.source_files = 'Classes/**/*'
81+
ss.public_header_files = 'Classes/**/*.h'
82+
83+
ss.dependency 'mobile-ffmpeg-audio', '4.2.2'
84+
end
85+
86+
s.subspec 'audio-lts' do |ss|
87+
ss.source_files = 'Classes/**/*'
88+
ss.public_header_files = 'Classes/**/*.h'
89+
90+
ss.dependency 'mobile-ffmpeg-audio', '4.2.2.LTS'
91+
end
92+
93+
s.subspec 'video' do |ss|
94+
ss.source_files = 'Classes/**/*'
95+
ss.public_header_files = 'Classes/**/*.h'
96+
97+
ss.dependency 'mobile-ffmpeg-video', '4.2.2'
98+
end
99+
100+
s.subspec 'video-lts' do |ss|
101+
ss.source_files = 'Classes/**/*'
102+
ss.public_header_files = 'Classes/**/*.h'
103+
104+
ss.dependency 'mobile-ffmpeg-video', '4.2.2.LTS'
105+
end
106+
107+
s.subspec 'full' do |ss|
108+
ss.source_files = 'Classes/**/*'
109+
ss.public_header_files = 'Classes/**/*.h'
110+
111+
ss.dependency 'mobile-ffmpeg-full', '4.2.2'
112+
end
113+
114+
s.subspec 'full-lts' do |ss|
115+
ss.source_files = 'Classes/**/*'
116+
ss.public_header_files = 'Classes/**/*.h'
117+
118+
ss.dependency 'mobile-ffmpeg-full', '4.2.2.LTS'
119+
end
120+
121+
s.subspec 'full-gpl' do |ss|
122+
ss.source_files = 'Classes/**/*'
123+
ss.public_header_files = 'Classes/**/*.h'
124+
125+
ss.dependency 'mobile-ffmpeg-full-gpl', '4.2.2'
126+
end
127+
128+
s.subspec 'full-gpl-lts' do |ss|
129+
ss.source_files = 'Classes/**/*'
130+
ss.public_header_files = 'Classes/**/*.h'
131+
132+
ss.dependency 'mobile-ffmpeg-full-gpl', '4.2.2.LTS'
133+
end
134+
135+
end

packages/flutter_ffmpeg_audio/.gitignore

-8
This file was deleted.

packages/flutter_ffmpeg_audio/.metadata

-10
This file was deleted.

0 commit comments

Comments
 (0)