Skip to content

Commit

Permalink
更换视频压缩ffmpeg命令
Browse files Browse the repository at this point in the history
  • Loading branch information
r17171709 committed Oct 16, 2020
1 parent c599249 commit 3a98c75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ android {

ndk {
//选择要添加的对应cpu类型的.so库。
abiFilters 'armeabi-v7a', 'x86' // 还可以添加 'armeabi', 'x86_64', 'mips', 'mips64', 'arm64-v8a'
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86' // 还可以添加 'armeabi', 'x86_64', 'mips', 'mips64'
}
}
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
public class MainActivity extends AppCompatActivity {
private MyRxFFmpegSubscriber myRxFFmpegSubscriber;

private String command = "ffmpeg -i " + InitParams.IMAGE_PATH + "/input.mp4 -s 720x1280 -vcodec libx264 -crf 22 -preset veryfast -c:a copy " + InitParams.IMAGE_PATH + "/result.mp4";
// private String command = "ffmpeg -i " + InitParams.IMAGE_PATH + "/input.mp4 -s 480x800 -vcodec libx264 -crf 22 -preset superfast -c:a copy " + InitParams.IMAGE_PATH + "/result.mp4";
private String command = "ffmpeg -y -i " + InitParams.IMAGE_PATH + "/input.mp4 -b 2097k -r 30 -vcodec libx264 -preset superfast " + InitParams.IMAGE_PATH + "/result.mp4";

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -196,7 +197,8 @@ public void onFinish() {
public void onProgress(int progress, long progressTime) {
MainActivity mainActivity = weakReference.get();
if (mainActivity != null) {
Log.d("TAG", "onProgress: " + progressTime);
File file = new File(InitParams.IMAGE_PATH + "/input.mp4");
Log.d("TAG", "onProgress: " + progress);
}
}

Expand Down

0 comments on commit 3a98c75

Please sign in to comment.