Sfoglia il codice sorgente

修改视频压缩传入参数

1712772270@qq.com 8 anni fa
parent
commit
1a458e3e6d

+ 2 - 2
display-server/web/res/js/mobile/expand-mobile.js

@ -340,8 +340,8 @@ define(["require"],function(require) {
340 340
			},clickBaiduMap:function(callback,err){
341 341
				storageCallback("clickBaiduMap",callback);
342 342
				execute("clickBaiduMap",[],err);
343
			},videoCompressor:function(){
344
				execute("videoCompressor",[]);
343
			},videoCompressor:function(param){
344
				execute("videoCompressor",[param]);
345 345
			},sweetAlert:function(param){
346 346
				execute("sweetAlert",[param]);
347 347
			},sweetConfirm:function(param){

+ 10 - 5
ipu-VideoCompressor/src/com/ai/ipu/videocompressor/func/MobileVideoCompress.java

@ -2,6 +2,7 @@ package com.ai.ipu.videocompressor.func;
2 2
3 3
4 4
import org.json.JSONArray;
5
import org.json.JSONException;
5 6
6 7
import android.app.Activity;
7 8
import android.content.Context;
@ -19,12 +20,12 @@ public class MobileVideoCompress extends Plugin {
19 20
	// String filePath = AppInfoUtil.getSdcardPath() + "/video.mp4";
20 21
	// String desPath = AppInfoUtil.getSdcardPath() + "/videoto.mp4";
21 22
//	
22
	String filepath = "/sdcard" + "/video.mp4";
23
	
24
	String decpath = "/sdcard" + "/to.mp4";
23
//	String filepath = "/sdcard" + "/video.mp4";
24
//	
25
//	String decpath = "/sdcard" + "/to.mp4";
25 26
	
26 27
	private static final int VIDEO_CAPTURE = 0;
27
	String cmd = "-y -i " + filepath + " -strict -2 -vcodec libx264 -preset ultrafast -crf 24 -acodec aac -ar 44100 -ac 2 -b:a 96k -s 640x352 -aspect 16:9 " + decpath;
28
//	String cmd = "-y -i " + filepath + " -strict -2 -vcodec libx264 -preset ultrafast -crf 24 -acodec aac -ar 44100 -ac 2 -b:a 96k -s 640x352 -aspect 16:9 " + decpath;
28 29
	private Compressor com;
29 30
	private VideoCompressUtil vcUtil;
30 31
@ -37,8 +38,12 @@ public class MobileVideoCompress extends Plugin {
37 38
	/**
38 39
	 * ÊÓÆµÑ¹Ëõ
39 40
	 * @param params
41
	 * @throws Exception 
40 42
	 */
41
	public void videoCompressor(JSONArray params) {
43
	public void videoCompressor(JSONArray params) throws Exception {
44
		String filepath = params.getString(0);
45
		String decpath = "/sdcard" + "/to.mp4";
46
		String cmd = "-y -i " + filepath + " -strict -2 -vcodec libx264 -preset ultrafast -crf 24 -acodec aac -ar 44100 -ac 2 -b:a 96k -s 640x352 -aspect 16:9 " + decpath;
42 47
		vcUtil.videoCompressor(com, cmd);
43 48
	}
44 49
	/**