use of com.lansosdk.videoeditor.MediaInfo in project LanSoEditor_advance by LanSoSdk.
the class DemoFunctions method demoAVSplite.
/**
* 演示音视频分离
* <p>
* 音视频分离:\n把多媒体文件如mp4,flv等中的的音频和视频分离开,形成独立的音频文件和视频文件 \n\n
*/
public static int demoAVSplite(VideoEditor editor, String srcVideo, String dstVideo, String dstAudio) {
MediaInfo info = new MediaInfo(srcVideo);
int ret = -1;
if (info.prepare()) {
ret = editor.executeDeleteAudio(srcVideo, dstVideo);
ret = editor.executeDeleteVideo(srcVideo, dstAudio);
}
return ret;
}
use of com.lansosdk.videoeditor.MediaInfo in project LanSoEditor_advance by LanSoSdk.
the class MediaInfoActivity method getMediaInfo.
private String getMediaInfo() {
String retStr = "";
MediaInfo info = new MediaInfo(videoPath);
if (info.prepare()) {
retStr += "文件路径: " + info.filePath + " \n";
retStr += "文件名字: " + info.fileName + " \n";
retStr += "文件后缀: " + info.fileSuffix + " \n";
if (info.vCodecHeight > 0 && info.vCodecWidth > 0) {
retStr += "\n视频信息----------------------\n";
retStr += "宽度: " + info.vWidth + " \n";
retStr += "高度: " + info.vHeight + " \n";
retStr += "编码宽度: " + info.vCodecWidth + " \n";
retStr += "编码高度: " + info.vCodecHeight + " \n";
retStr += "总时长: " + info.vDuration + "(秒)" + " \n";
retStr += "比特率(码率): " + info.vBitRate + " bit/s" + " \n";
retStr += "帧率: " + info.vFrameRate + " frame/s" + " \n";
retStr += "像素格式: " + info.vPixelFmt + " \n";
retStr += "旋转角度: " + info.vRotateAngle + " \n";
retStr += "总帧数: " + info.vTotalFrames + " \n";
retStr += "是否有B帧: " + info.vHasBFrame + " \n";
retStr += "可采用的解码器: ";
if (info.vCodecName.equals("lansoh264_dec"))
retStr += "h264,";
retStr += info.vCodecName + " \n";
}
if (info.aBitRate > 0) {
retStr += "\n音频信息----------------------\n";
retStr += "时长: " + info.aDuration + "(秒)" + "\n";
retStr += "采样率: " + info.aSampleRate + "\n";
retStr += "通道数: " + info.aChannels + "\n";
retStr += "总帧数: " + info.aTotalFrames + "\n";
retStr += "比特率(码率): " + info.aBitRate + "\n";
retStr += "最大比特率(最大码率): " + info.aMaxBitRate + "\n";
retStr += "可采用的解码器: " + info.aCodecName + "\n";
}
} else {
retStr = "无法获取文件的音视频信息,请检查您的文件是否是音视频文件.";
}
return retStr;
}
use of com.lansosdk.videoeditor.MediaInfo in project LanSoEditor_advance by LanSoSdk.
the class VViewImage3DDemoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.vview_image3d_demo_layout);
mVideoPath = getIntent().getStringExtra("videopath");
mInfo = new MediaInfo(mVideoPath, false);
if (mInfo.prepare() == false) {
Toast.makeText(this, "传递过来的视频文件错误", Toast.LENGTH_SHORT).show();
this.finish();
}
drawpadView = (DrawPadView) findViewById(R.id.id_image3d_drawpadview);
mGLRelativeLayout = (ViewLayerRelativeLayout) findViewById(R.id.id_image3d_viewlayout);
mStereoView = (StereoView) findViewById(R.id.id_image3d_stereoView);
mStereoView.setVisibility(View.INVISIBLE);
findViewById(R.id.id_image3d_saveplay).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (SDKFileUtils.fileExist(dstPath)) {
Intent intent = new Intent(VViewImage3DDemoActivity.this, VideoPlayerActivity.class);
intent.putExtra("videopath", dstPath);
startActivity(intent);
} else {
Toast.makeText(VViewImage3DDemoActivity.this, "目标文件不存在", Toast.LENGTH_SHORT).show();
}
}
});
findViewById(R.id.id_image3d_saveplay).setVisibility(View.GONE);
editTmpPath = SDKFileUtils.newMp4PathInBox();
dstPath = SDKFileUtils.newMp4PathInBox();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
startPlayVideo();
}
}, 300);
}
use of com.lansosdk.videoeditor.MediaInfo in project LanSoEditor_advance by LanSoSdk.
the class LayerLayoutDemoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.videopicture_layout);
videoPath = getIntent().getStringExtra("videopath");
mInfo = new MediaInfo(videoPath, false);
if (mInfo.prepare() == false) {
Toast.makeText(this, "传递过来的视频文件错误", Toast.LENGTH_SHORT).show();
this.finish();
}
drawPadView = (DrawPadView) findViewById(R.id.id_videopicture_drawpadview);
initView();
// 在手机的默认路径下创建一个文件名,用来保存生成的视频文件,(在onDestroy中删除)
editTmpPath = SDKFileUtils.newMp4PathInBox();
dstPath = SDKFileUtils.newMp4PathInBox();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
startPlayVideo();
}
}, 100);
}
use of com.lansosdk.videoeditor.MediaInfo in project LanSoEditor_advance by LanSoSdk.
the class MoreLayHeadSeekActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.videolay_transform_layout);
mContext = getApplicationContext();
copySecondVideoAsync();
initView();
mVideoPath = getIntent().getStringExtra("videopath");
drawPadView = (DrawPadView) findViewById(R.id.id_videolayer_drawpad);
dstPath = SDKFileUtils.newMp4PathInBox();
firstInfo = new MediaInfo(mVideoPath, false);
if (firstInfo.prepare() == false) {
finish();
}
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
setupDrawPad();
}
}, 500);
}
Aggregations