title: How to record WebRTC local video stream to file on Android?
body: <p>I have using WebRTC. I want to local video stream to file.
  I'd appreciate it if you gave me a hint to approach this.</p>
  
  <p>Thank you for reading it.</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      //sigConnect("http://10.54.36.19:8000/");
      sigConnect("http://unwebrtc.herokuapp.com/");
      initWebRTC();
  
      Log.i(TAG, "VideoCapturerAndroid.getDeviceCount() = " + VideoCapturerAndroid.getDeviceCount());
      String nameOfFrontFacingDevice = VideoCapturerAndroid.getNameOfFrontFacingDevice();
      String nameOfBackFacingDevice = VideoCapturerAndroid.getNameOfBackFacingDevice();
      Log.i(TAG, "VideoCapturerAndroid.getNameOfFrontFacingDevice() = " + nameOfFrontFacingDevice);
      Log.i(TAG, "VideoCapturerAndroid.getNameOfBackFacingDevice() = " + nameOfBackFacingDevice);
      VideoCapturerAndroid capturer = VideoCapturerAndroid.create(nameOfFrontFacingDevice);
  
      MediaConstraints videoConstraints = new MediaConstraints();
  
      VideoSource videoSource = peerConnectionFactory.createVideoSource(capturer, videoConstraints);
      localVideoTrack = peerConnectionFactory.createVideoTrack(VIDEO_TRACK_ID, videoSource);
  
      glview = (GLSurfaceView) findViewById(R.id.glview);
      VideoRendererGui.setView(glview, null);
      try {
          rendereRemote = VideoRendererGui.createGui(0, 0, 100, 100, VideoRendererGui.ScalingType.SCALE_ASPECT_FILL, true);
          rendereLocal = VideoRendererGui.createGui(72, 72, 25, 25, VideoRendererGui.ScalingType.SCALE_ASPECT_FILL, true);
          localVideoTrack.addRenderer(rendereLocal);
      } catch (Exception e) {
          e.printStackTrace();
      }
  
      mediaStream = peerConnectionFactory.createLocalMediaStream(LOCAL_MEDIA_STREAM_ID);
      mediaStream.addTrack(localVideoTrack);
  
  }
  </code></pre>