Skip to content

Commit 498b133

Browse files
committed
video and compress support
1 parent 9530654 commit 498b133

File tree

101 files changed

+1808
-15
lines changed

Some content is hidden

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

101 files changed

+1808
-15
lines changed

app/app.iml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,10 @@
8686
<orderEntry type="sourceFolder" forTests="false" />
8787
<orderEntry type="library" exported="" name="support-v4-23.1.1" level="project" />
8888
<orderEntry type="library" exported="" name="library-1.2.4" level="project" />
89-
<orderEntry type="library" exported="" name="support-annotations-23.1.1" level="project" />
9089
<orderEntry type="library" exported="" name="glide-3.6.1" level="project" />
90+
<orderEntry type="library" exported="" name="support-annotations-23.1.1" level="project" />
9191
<orderEntry type="library" exported="" name="appcompat-v7-23.1.1" level="project" />
92+
<orderEntry type="module" module-name="ffmpeg4android_lib" exported="" />
9293
<orderEntry type="module" module-name="wxphoto" exported="" />
9394
component>
9495
module>

app/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ android {
1313

1414
defaultConfig {
1515
applicationId "com.foamtrace.photopickersample"
16-
minSdkVersion 11
16+
minSdkVersion 15
1717
targetSdkVersion 23
1818
versionCode 1
1919
versionName "1.0"
@@ -33,4 +33,5 @@ dependencies {
3333
compile project(':wxphoto')
3434
compile 'com.github.bumptech.glide:glide:3.6.1'
3535
compile 'com.github.chrisbanes.photoview:library:+'
36+
compile project(':ffmpeg4android_lib')
3637
}

app/src/main/java/com/foamtrace/photopickersample/MainActivity.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
import android.widget.Toast;
1818

1919
import com.bumptech.glide.Glide;
20+
import com.netcompss.ffmpeg4android.GeneralUtils;
21+
import com.netcompss.loader.LoadJNI;
22+
2023
import uuke.xinfu.wxphoto.ImageCaptureManager;
2124
import uuke.xinfu.wxphoto.ImageConfig;
2225
import uuke.xinfu.wxphoto.PhotoPickerActivity;
@@ -60,6 +63,7 @@ public class MainActivity extends AppCompatActivity {
6063
protected void onCreate(Bundle savedInstanceState) {
6164
super.onCreate(savedInstanceState);
6265
setContentView(R.layout.activity_main);
66+
GeneralUtils.checkForPermissionsMAndAbove(MainActivity.this, false);
6367

6468
btnMuilt = (Button) findViewById(R.id.btnMuilt);
6569
btnSingle = (Button) findViewById(R.id.btnSingle);
@@ -104,18 +108,30 @@ public void onClick(View v) {
104108
btnMuilt.setOnClickListener(new View.OnClickListener() {
105109
@Override
106110
public void onClick(View v) {
111+
// GeneralUtils.checkForPermissionsMAndAbove(Main.this, true);
112+
// LoadJNI vk = new LoadJNI();
113+
// try {
114+
// String workFolder = getApplicationContext().getFilesDir().getAbsolutePath();
115+
// String[] complexCommand = {"ffmpeg","-i", "/sdcard/videokit/in.mp4"};
116+
// vk.run(complexCommand , workFolder , getApplicationContext());
117+
// Log.i("test", "ffmpeg4android finished successfully");
118+
// } catch (Throwable e) {
119+
// Log.e("test", "vk run exception.", e);
120+
// }
121+
107122
PhotoPickerIntent intent = new PhotoPickerIntent(MainActivity.this);
108123
intent.setSelectModel(SelectModel.MULTI);
109124
intent.setShowCarema(true); // 是否显示拍照
110125
intent.setMaxTotal(9); // 最多选择照片数量,默认为9
111126
intent.setSelectedPaths(imagePaths); // 已选中的照片地址, 用于回显选中状态
127+
startActivityForResult(intent, REQUEST_CAMERA_CODE);
128+
112129
// ImageConfig config = new ImageConfig();
113130
// config.minHeight = 400;
114131
// config.minWidth = 400;
115132
// config.mimeType = new String[]{"image/jpeg", "image/png"};
116133
// config.minSize = 1 * 1024 * 1024; // 1Mb
117134
// intent.setImageConfig(config);
118-
startActivityForResult(intent, REQUEST_CAMERA_CODE);
119135
}
120136
});
121137

ffmpeg4android_lib/build.gradle

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apply plugin: 'com.android.library'
2+
3+
android {
4+
compileSdkVersion 23
5+
buildToolsVersion "23.0.1"
6+
7+
defaultConfig {
8+
minSdkVersion 15
9+
targetSdkVersion 23
10+
}
11+
12+
buildTypes {
13+
release {
14+
minifyEnabled false
15+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
16+
}
17+
}
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Automatically generated file. DO NOT MODIFY
3+
*/
4+
package com.netcompss.ffmpeg4android.test;
5+
6+
public final class BuildConfig {
7+
public static final boolean DEBUG = Boolean.parseBoolean("true");
8+
public static final String APPLICATION_ID = "com.netcompss.ffmpeg4android.test";
9+
public static final String BUILD_TYPE = "debug";
10+
public static final String FLAVOR = "";
11+
public static final int VERSION_CODE = -1;
12+
public static final String VERSION_NAME = "";
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Automatically generated file. DO NOT MODIFY
3+
*/
4+
package com.netcompss.ffmpeg4android;
5+
6+
public final class BuildConfig {
7+
public static final boolean DEBUG = Boolean.parseBoolean("true");
8+
public static final String APPLICATION_ID = "com.netcompss.ffmpeg4android";
9+
public static final String BUILD_TYPE = "debug";
10+
public static final String FLAVOR = "";
11+
public static final int VERSION_CODE = 252409;
12+
public static final String VERSION_NAME = "";
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Automatically generated file. DO NOT MODIFY
3+
*/
4+
package com.netcompss.ffmpeg4android;
5+
6+
public final class BuildConfig {
7+
public static final boolean DEBUG = false;
8+
public static final String APPLICATION_ID = "com.netcompss.ffmpeg4android";
9+
public static final String BUILD_TYPE = "release";
10+
public static final String FLAVOR = "";
11+
public static final int VERSION_CODE = 252409;
12+
public static final String VERSION_NAME = "";
13+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* AUTO-GENERATED FILE. DO NOT MODIFY.
2+
*
3+
* This class was automatically generated by the
4+
* aapt tool from the resource data it found. It
5+
* should not be modified by hand.
6+
*/
7+
package com.netcompss.ffmpeg4android;
8+
9+
public final class R {
10+
public static final class id {
11+
public static final int action_about = 0x7f050000;
12+
}
13+
public static final class menu {
14+
public static final int main = 0x7f040000;
15+
}
16+
public static final class string {
17+
public static final int app_name = 0x7f020000;
18+
public static final int commandText = 0x7f020001;
19+
public static final int commandTextView = 0x7f020002;
20+
public static final int email = 0x7f020003;
21+
public static final int full_app_name = 0x7f020004;
22+
public static final int welcome_1 = 0x7f020005;
23+
public static final int welcome_2 = 0x7f020006;
24+
public static final int welcome_3 = 0x7f020007;
25+
public static final int welcome_demo = 0x7f020008;
26+
}
27+
public static final class style {
28+
public static final int h1 = 0x7f030000;
29+
public static final int h2 = 0x7f030001;
30+
public static final int t1 = 0x7f030002;
31+
}
32+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/* AUTO-GENERATED FILE. DO NOT MODIFY.
2+
*
3+
* This class was automatically generated by the
4+
* aapt tool from the resource data it found. It
5+
* should not be modified by hand.
6+
*/
7+
8+
package com.netcompss.ffmpeg4android.test;
9+
10+
public final class R {
11+
public static final class attr {
12+
}
13+
public static final class id {
14+
public static final int action_about=0x7f050000;
15+
}
16+
public static final class menu {
17+
public static final int main=0x7f040000;
18+
}
19+
public static final class string {
20+
public static final int app_name=0x7f020000;
21+
public static final int commandText=0x7f020001;
22+
public static final int commandTextView=0x7f020002;
23+
public static final int email=0x7f020003;
24+
public static final int full_app_name=0x7f020004;
25+
public static final int welcome_1=0x7f020005;
26+
public static final int welcome_2=0x7f020006;
27+
public static final int welcome_3=0x7f020007;
28+
public static final int welcome_demo=0x7f020008;
29+
}
30+
public static final class style {
31+
public static final int h1=0x7f030000;
32+
public static final int h2=0x7f030001;
33+
public static final int t1=0x7f030002;
34+
}
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/* AUTO-GENERATED FILE. DO NOT MODIFY.
2+
*
3+
* This class was automatically generated by the
4+
* aapt tool from the resource data it found. It
5+
* should not be modified by hand.
6+
*/
7+
8+
package com.netcompss.ffmpeg4android;
9+
10+
public final class R {
11+
public static final class attr {
12+
}
13+
public static final class id {
14+
public static int action_about=0x7f050000;
15+
}
16+
public static final class menu {
17+
public static int main=0x7f040000;
18+
}
19+
public static final class string {
20+
public static int app_name=0x7f020000;
21+
public static int commandText=0x7f020001;
22+
public static int commandTextView=0x7f020002;
23+
public static int email=0x7f020003;
24+
public static int full_app_name=0x7f020004;
25+
public static int welcome_1=0x7f020005;
26+
public static int welcome_2=0x7f020006;
27+
public static int welcome_3=0x7f020007;
28+
public static int welcome_demo=0x7f020008;
29+
}
30+
public static final class style {
31+
public static int h1=0x7f030000;
32+
public static int h2=0x7f030001;
33+
public static int t1=0x7f030002;
34+
}
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/* AUTO-GENERATED FILE. DO NOT MODIFY.
2+
*
3+
* This class was automatically generated by the
4+
* aapt tool from the resource data it found. It
5+
* should not be modified by hand.
6+
*/
7+
8+
package com.netcompss.ffmpeg4android;
9+
10+
public final class R {
11+
public static final class attr {
12+
}
13+
public static final class id {
14+
public static int action_about=0x7f050000;
15+
}
16+
public static final class menu {
17+
public static int main=0x7f040000;
18+
}
19+
public static final class string {
20+
public static int app_name=0x7f020000;
21+
public static int commandText=0x7f020001;
22+
public static int commandTextView=0x7f020002;
23+
public static int email=0x7f020003;
24+
public static int full_app_name=0x7f020004;
25+
public static int welcome_1=0x7f020005;
26+
public static int welcome_2=0x7f020006;
27+
public static int welcome_3=0x7f020007;
28+
public static int welcome_demo=0x7f020008;
29+
}
30+
public static final class style {
31+
public static int h1=0x7f030000;
32+
public static int h2=0x7f030001;
33+
public static int t1=0x7f030002;
34+
}
35+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.netcompss.ffmpeg4android"
4+
android:versionCode="252409"
5+
android:versionName="25.24.9" >
6+
7+
<uses-sdk
8+
android:minSdkVersion="15"
9+
android:targetSdkVersion="23" />
10+
11+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
12+
<uses-permission android:name="android.permission.WAKE_LOCK" />
13+
14+
manifest>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
int id action_about 0x7f050000
2+
int menu main 0x7f040000
3+
int string app_name 0x7f020000
4+
int string commandText 0x7f020001
5+
int string commandTextView 0x7f020002
6+
int string email 0x7f020003
7+
int string full_app_name 0x7f020004
8+
int string welcome_1 0x7f020005
9+
int string welcome_2 0x7f020006
10+
int string welcome_3 0x7f020007
11+
int string welcome_demo 0x7f020008
12+
int style h1 0x7f030000
13+
int style h2 0x7f030001
14+
int style t1 0x7f030002
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.netcompss.ffmpeg4android"
4+
android:versionCode="252409"
5+
android:versionName="25.24.9" >
6+
7+
<uses-sdk
8+
android:minSdkVersion="15"
9+
android:targetSdkVersion="23" />
10+
11+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
12+
<uses-permission android:name="android.permission.WAKE_LOCK" />
13+
14+
manifest>
Binary file not shown.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
2+
3+
<item
4+
android:id="@+id/action_about"
5+
android:title="About"
6+
android:showAsAction="never" />
7+
8+
menu>
9+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
4+
<eat-comment/>
5+
<string name="app_name">Demostring>
6+
<string name="commandText">ffmpeg -y -i /sdcard/videokit/in.mp4 -strict experimental -vf transpose=1 -s 160x120 -r 30 -aspect 4:3 -ab 48000 -ac 2 -ar 22050 -b 2097k /sdcard/videokit/out.mp4string>
7+
<string name="commandTextView">This command will rotate /sdcard/videokit/in.mp4 90 degrees, and create /sdcard/videokit/out.mp4:string>
8+
<string name="email">[email protected]string>
9+
<string name="full_app_name">FFmpeg4Android Demostring>
10+
<string name="welcome_1">Simple example using a AsyncTask without progress bar.\n
11+
When using this technique, you will not be able to stop the operation while its running.string>
12+
<string name="welcome_2">Simple progress bar example with stop support (you can cancel the transcoding when its running).string>
13+
<string name="welcome_3">Progress bar with notification example (and stop / cancel support).\n
14+
The notification will work only on Android 4 or above.\n
15+
To support notifications on older versions, use the Android support librarystring>
16+
<string name="welcome_demo">FFmpeg4Android Demo shows how easy it is for every application to run FFMpeg commands.string>
17+
18+
<eat-comment/>
19+
<style name="h1">
20+
<item name="android:textSize">16spitem>
21+
<item name="android:textColor">@android:color/whiteitem>
22+
<item name="android:textStyle">bolditem>
23+
style>
24+
<style name="h2">
25+
<item name="android:textSize">18spitem>
26+
<item name="android:textColor">@android:color/whiteitem>
27+
<item name="android:textStyle">bolditem>
28+
style>
29+
<style name="t1">
30+
<item name="android:textSize">14spitem>
31+
<item name="android:textColor">@android:color/whiteitem>
32+
style>
33+
resources>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.netcompss.ffmpeg4android"
4+
android:versionCode="252409"
5+
android:versionName="25.24.9" >
6+
7+
<uses-sdk
8+
android:minSdkVersion="15"
9+
android:targetSdkVersion="23" />
10+
11+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
12+
<uses-permission android:name="android.permission.WAKE_LOCK" />
13+
14+
manifest>

0 commit comments

Comments
 (0)