Android Webrtc record video from the stream coming from the other peer

VideoFileRenderer class just demonstrates how you can access to decoded raw video frames for remote/local peer. This is not recording valid video file.
You should implement manually the logic of encoding and muxing raw video frames into container, like mp4.

The main flow looks like that:

  • Switch to the latest webrtc version (v.1.0.25331 for now)
  • Create video container. For example see MediaMuxer class from Android SDK
  • Implement interface VideoSink for obtaining raw frames from certain video source. For example see apprtc/CallActivity.java class ProxyVideoSink
  • Encode every frame using MediaCodec and write to video container
  • Finalize muxer

Tags:

Android

Webrtc