Screen recording of specific views in Android

这一生的挚爱 提交于 2019-11-30 09:26:11

问题


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.

来源:https://stackoverflow.com/questions/46497611/screen-recording-of-specific-views-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!