Android Webrtc Record Video From The Stream Coming From The Other Peer


Answer :

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

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android SDK Location Should Not Contain Whitespace, As This Cause Problems With NDK Tools