Downloading rtsp stream to play locally
<p>I manage to play a live stream from a url such as this </p>

<p><code>rtsp://192.168.0.18:554/user=admin&amp;password=&amp;channel=1&amp;stream=0.sdp?</code></p>

<p>But I want to download this stream into a temporary file and then play it locally so that I can make it seems like the buffering time is short (around 2-4 seconds delay maybe)</p>

<p>Is it possible to do this with <code>rtsp</code>? or do I have to use <code>http</code>?Because this url only works on <code>rtsp</code> protocol</p>

<p>If so,a bit of example would help me alot</p>

<p>Example of my codes</p>

<pre><code>cA.mPlayer1 = new MediaPlayer();
  try {
    cA.mPlayer1.setDataSource("rtsp://192.168.0.18:554/user=admin&amp;password=&amp;channel=1&amp;stream=0.sdp?");
    cA.mPlayer1.prepareAsync();
    cA.mPlayer1.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
      @Override
      public void onPrepared(MediaPlayer mediaPlayer) {
        cA.mPlayer1.start();
        Toast.makeText(getBaseContext(), "Connecting...", Toast.LENGTH_LONG).show();
      }
    });
  } catch (IOException e) {
    e.printStackTrace();
  }
  cA.mCallback1 = new SurfaceHolder.Callback() {
    @Override
    public void surfaceCreated(SurfaceHolder surfaceHolder) {

      cA.mPlayer1.setDisplay(surfaceHolder);

    }
    @Override
    public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i2, int i3) {
    }
    @Override
    public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
    }
  };

final SurfaceView surfaceView1 =
        (SurfaceView) findViewById(R.id.surfaceView1);
// Configure the Surface View.
surfaceView1.setKeepScreenOn(true);
// Configure the Surface Holder and register the callback.
SurfaceHolder holder1 = surfaceView1.getHolder();
holder1.addCallback(cA.mCallback1);
holder1.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
</code></pre>