Search in sources :

Example 36 with MediaInfo

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;
}
Also used : MediaInfo(com.lansosdk.videoeditor.MediaInfo)

Example 37 with MediaInfo

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;
}
Also used : MediaInfo(com.lansosdk.videoeditor.MediaInfo)

Example 38 with MediaInfo

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);
}
Also used : MediaInfo(com.lansosdk.videoeditor.MediaInfo) OnClickListener(android.view.View.OnClickListener) Handler(android.os.Handler) Intent(android.content.Intent) GLSurfaceView(android.opengl.GLSurfaceView) ImageView(android.widget.ImageView) View(android.view.View) StereoView(com.example.advanceDemo.view.StereoView) TextView(android.widget.TextView) DrawPadView(com.lansosdk.videoeditor.DrawPadView) VideoPlayerActivity(com.example.advanceDemo.VideoPlayerActivity)

Example 39 with MediaInfo

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);
}
Also used : MediaInfo(com.lansosdk.videoeditor.MediaInfo) Handler(android.os.Handler)

Example 40 with MediaInfo

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);
}
Also used : MediaInfo(com.lansosdk.videoeditor.MediaInfo) CanvasRunnable(com.lansosdk.box.CanvasRunnable) Handler(android.os.Handler)

Aggregations

MediaInfo (com.lansosdk.videoeditor.MediaInfo)59 Handler (android.os.Handler)12 com.lansosdk.box.onDrawPadSizeChangedListener (com.lansosdk.box.onDrawPadSizeChangedListener)9 Paint (android.graphics.Paint)8 TextView (android.widget.TextView)6 Intent (android.content.Intent)5 View (android.view.View)5 OnClickListener (android.view.View.OnClickListener)5 CanvasRunnable (com.lansosdk.box.CanvasRunnable)5 DrawPad (com.lansosdk.box.DrawPad)5 Bitmap (android.graphics.Bitmap)4 DrawPadView (com.lansosdk.videoeditor.DrawPadView)4 File (java.io.File)3 SurfaceTexture (android.graphics.SurfaceTexture)2 MediaPlayer (android.media.MediaPlayer)2 DisplayMetrics (android.util.DisplayMetrics)2 Surface (android.view.Surface)2 SurfaceTextureListener (android.view.TextureView.SurfaceTextureListener)2 VideoPlayerActivity (com.example.advanceDemo.VideoPlayerActivity)2 DrawPadVideoRunnable (com.lansosdk.box.DrawPadVideoRunnable)2