use of com.lansosdk.videoeditor.VideoEditor in project LanSoEditor_advance by LanSoSdk.
the class ExecuteAllDrawpadActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.execute_edit_demo_layout);
mContext = getApplicationContext();
videoPath = getIntent().getStringExtra("videopath");
mInfo = new MediaInfo(videoPath, false);
initView();
// 在手机的默认路径下创建一个文件名,用来保存生成的视频文件,(在onDestroy中删除)
dstPath = SDKFileUtils.newMp4PathInBox();
new Thread(new Runnable() {
@Override
public void run() {
videoPath2 = CopyFileFromAssets.copyAssets(getApplicationContext(), "ping25s.mp4");
}
}).start();
if (// 为了很快演示, 这里只要前3秒.
mInfo.prepare() && mInfo.vDuration > 3.0f) {
VideoEditor editor = new VideoEditor();
video3S = SDKFileUtils.createFileInBox(mInfo.fileSuffix);
editor.executeVideoCutOut(videoPath, video3S, 0, 3.0f);
} else {
video3S = videoPath;
}
}
use of com.lansosdk.videoeditor.VideoEditor in project LanSoEditor_advance by LanSoSdk.
the class VHeaderConcat method drawPadCompleted.
/**
* 完成后, 去播放
*/
private void drawPadCompleted() {
if (SDKFileUtils.fileExist(editTmpPath)) {
// 合并音频文件.
boolean ret = VideoEditor.encoderAddAudio(videoPath, editTmpPath, SDKDir.TMP_DIR, dstPath);
Log.i(TAG, "视频转换完成, 转换后的是:" + dstPath);
if (!ret) {
dstPath = editTmpPath;
} else {
SDKFileUtils.deleteFile(editTmpPath);
}
// 一下是测试.
VideoEditor editor = new VideoEditor();
String[] videoArray = { dstPath, recordVideo };
editor.executeConcatMP4(videoArray, "/sdcard/concat3.mp4");
Log.i(TAG, "拼接完成----------------");
dstPath = "/sdcard/concat3.mp4";
}
}
use of com.lansosdk.videoeditor.VideoEditor in project LanSoEditor_advance by LanSoSdk.
the class CameraLayerFullSegmentActivity method stopDrawPad.
/**
* 结束录制, 并开始另一个Activity 去预览录制好的画面.
*/
private void stopDrawPad() {
if (drawPadCamera != null && drawPadCamera.isRunning()) {
/**
* 如果正在录制,则把最后一段增加进来.
*/
if (drawPadCamera.isRecording()) {
String segmentPath = drawPadCamera.segmentStop();
segmentArray.add(segmentPath);
}
String musicPath = null;
if (isRecordMp3) {
musicPath = drawPadCamera.getRecordMusicPath();
}
/**
* 停止 容器.
*/
drawPadCamera.stopDrawPad();
mCameraLayer = null;
mAudioLine = null;
/**
* 开始拼接
*/
if (segmentArray.size() > 0) {
VideoEditor editor = new VideoEditor();
String[] segments = new String[segmentArray.size()];
for (int i = 0; i < segmentArray.size(); i++) {
segments[i] = (String) segmentArray.get(i);
}
if (musicPath != null) {
// 录制的是MP3;
String tmpVideo = SDKFileUtils.createMp4FileInBox();
editor.executeConcatMP4(segments, tmpVideo);
editor.executeVideoMergeAudio(tmpVideo, musicPath, dstPath);
SDKFileUtils.deleteFile(tmpVideo);
} else {
editor.executeConcatMP4(segments, dstPath);
}
}
/**
* 开始播放.
*/
if (SDKFileUtils.fileExist(dstPath)) {
Intent intent = new Intent(CameraLayerFullSegmentActivity.this, VideoPlayerActivity.class);
intent.putExtra("videopath", dstPath);
startActivity(intent);
} else {
Toast.makeText(CameraLayerFullSegmentActivity.this, "目标文件不存在", Toast.LENGTH_SHORT).show();
}
}
}
use of com.lansosdk.videoeditor.VideoEditor in project LanSoEditor_advance by LanSoSdk.
the class AVEditorDemoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.test_cmd_layout);
TextView tvText = (TextView) findViewById(R.id.id_test_cmd_demo_hint);
findViewById(R.id.id_test_cmd_btn).setOnClickListener(this);
findViewById(R.id.id_test_cmdvideo_play_btn).setOnClickListener(this);
findViewById(R.id.id_test_cmdaudio_play_btn).setOnClickListener(this);
srcVideo = getIntent().getStringExtra("videopath1");
demoID = getIntent().getIntExtra("demoID", 0);
isOutVideo = getIntent().getBooleanExtra("outvideo", false);
isOutAudio = getIntent().getBooleanExtra("outaudio", false);
textID = getIntent().getIntExtra("textID", 0);
if (demoID != 0) {
setTitle(demoID);
}
if (textID != 0) {
tvText.setText(textID);
}
if (isOutVideo == false) {
findViewById(R.id.id_test_cmdvideo_play_btn).setVisibility(View.GONE);
}
if (isOutAudio == false) {
findViewById(R.id.id_test_cmdaudio_play_btn).setVisibility(View.GONE);
}
/**
* 第一步,创建VideoEditor对象, 并设置进度监听,当然您也可以不设置监听.
*/
mEditor = new VideoEditor();
mEditor.setOnProgessListener(new onVideoEditorProgressListener() {
@Override
public void onProgress(VideoEditor v, int percent) {
if (mProgressDialog != null) {
mProgressDialog.setMessage("正在处理中..." + String.valueOf(percent) + "%");
}
}
});
dstVideo = SDKFileUtils.newMp4PathInBox();
dstAudio = SDKFileUtils.newMp4PathInBox();
}
use of com.lansosdk.videoeditor.VideoEditor in project LanSoEditor_common by LanSoSdk.
the class AVEditorDemoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.test_cmd_layout);
TextView tvText = (TextView) findViewById(R.id.id_test_cmd_demo_hint);
findViewById(R.id.id_test_cmd_btn).setOnClickListener(this);
findViewById(R.id.id_test_cmdvideo_play_btn).setOnClickListener(this);
findViewById(R.id.id_test_cmdaudio_play_btn).setOnClickListener(this);
srcVideo = getIntent().getStringExtra("videopath1");
demoID = getIntent().getIntExtra("demoID", 0);
isOutVideo = getIntent().getBooleanExtra("outvideo", false);
isOutAudio = getIntent().getBooleanExtra("outaudio", false);
textID = getIntent().getIntExtra("textID", 0);
if (demoID != 0) {
setTitle(demoID);
}
if (textID != 0) {
tvText.setText(textID);
}
if (isOutVideo == false) {
findViewById(R.id.id_test_cmdvideo_play_btn).setVisibility(View.GONE);
}
if (isOutAudio == false) {
findViewById(R.id.id_test_cmdaudio_play_btn).setVisibility(View.GONE);
}
/**
* 第一步,创建VideoEditor对象, 并设置进度监听,当然您也可以不设置监听.
*/
mEditor = new VideoEditor();
mEditor.setOnProgessListener(new onVideoEditorProgressListener() {
@Override
public void onProgress(VideoEditor v, int percent) {
// TODO Auto-generated method stub
if (mProgressDialog != null) {
mProgressDialog.setMessage("正在处理中..." + String.valueOf(percent) + "%");
}
}
});
dstVideo = SDKFileUtils.newMp4PathInBox();
dstAudio = SDKFileUtils.newMp4PathInBox();
}
Aggregations