Screen recording of specific views in Android

2020-04-11 03:58发布

I need to record certain views in an android application, both audio and video. Say, I have a layout inside .xml file and I want to create a video(.mp4) of only that view. Whats the best approach or possible solution? So far, my finding is:

  1. MediaProjection only records the whole screen which is NOT my requirement.
  2. Javacv - Since the size of JAR file is way too large and I am already at the edge of meeting the apk size limit(100mb), plus I am already using FFMPEG and OpenCV and facing UnsatisfiedLinkingError with Javacv. (I don't want to go for this unless there is no other option left.)

One possible solution that comes to my mind is to grab frames(bitmaps) of that view and combine them with audio to create a video file.

Question: Is this possible with MediaRecorder to use the frames and audio to create a video file? How can I pass the frames to MediaRecorder. All I could find about MediaRecorder is how to stream Camera frames on TextureView.

0条回答
登录 后发表回答