将实时视频保存到Android

时间:2016-03-16 01:48:52

标签: video save real-time rtsp video-recording

我需要将实时视频保存到我的Android设备上的SD卡上没有代码可以做到我搜索了很多但我发现的所有代码都不起作用  我需要使用实时流媒体从安全摄像头流式传输视频 协议  我正在使用视频视频来流式传输视频,但它能够成功运行,但无法将其录制到SD卡

if(isNetworkStatusAvialable (getApplicationContext())) {

        // Execute StreamVideo AsyncTask

        // Create a progressbar
        pDialog = new ProgressDialog(MainActivity.this);
        // Set progressbar title
        pDialog.setTitle("Android Video Streaming");
        // Set progressbar message
        pDialog.setMessage("Buffering...");
        pDialog.setIndeterminate(true);
        pDialog.setCancelable(true);
        // Show progressbar
        pDialog.show();
        try {
            // Start the MediaController
            MediaController mediacontroller = new MediaController(
                    MainActivity.this);
            mediacontroller.setAnchorView(videoview);
            // Get the URL from String VideoURL
            Uri video = Uri.parse(url);
            videoview.setMediaController(mediacontroller);
            videoview.setVideoURI(video);

        } catch (Exception e) {
            Log.e("Error", e.getMessage());
            e.printStackTrace();
        }

        videoview.requestFocus();
        videoview.setOnPreparedListener(new OnPreparedListener() {
            // Close the progress bar and play the video
            public void onPrepared(MediaPlayer mp) {
                pDialog.dismiss();
                videoview.start();





            }
        });
    } else {
        showMessage("internet is not avialable", buffer.toString());


    }

0 个答案:

没有答案